- 28 7月, 2014 2 次提交
-
-
由 Jonas Hietala 提交于
-
由 Jonas Hietala 提交于
-
- 27 7月, 2014 14 次提交
-
-
由 Jonas Hietala 提交于
Small corrections for TreeSet examples.
-
由 Jonas Hietala 提交于
-
由 bors 提交于
Implements PartialEq/Eq/Clone/Hash/FromIterator/Extendable for SmallIntMap and Clone/Show for TrieMap/TrieSet. cc #15294
-
由 bors 提交于
No longer does anything.
-
由 Brian Anderson 提交于
No longer does anything.
-
由 bors 提交于
Everyone agreed except @thestinger. As @thestinger contribution on this file is trivial, we can relicense it. Related to #14248, close #15330 @brson OK?
-
由 nham 提交于
-
由 bors 提交于
-
由 bors 提交于
This commit applies stability attributes to the contents of these modules, summarized here: * The `unit` and `bool` modules have become #[unstable] as they are purely meant for documentation purposes and are candidates for removal. * The `ty` module has been deprecated, and the inner `Unsafe` type has been renamed to `UnsafeCell` and moved to the `cell` module. The `marker1` field has been removed as the compiler now always infers `UnsafeCell` to be invariant. The `new` method i stable, but the `value` field, `get` and `unwrap` methods are all unstable. * The `tuple` module has its name as stable, the naming of the `TupleN` traits as stable while the methods are all #[unstable]. The other impls in the module have appropriate stability for the corresponding trait. * The `arc` module has received the exact same treatment as the `rc` module previously did. * The `any` module has its name as stable. The `Any` trait is also stable, with a new private supertrait which now contains the `get_type_id` method. This is to make the method a private implementation detail rather than a public-facing detail. The two extension traits in the module are marked #[unstable] as they will not be necessary with DST. The `is` method is #[stable], the as_{mut,ref} methods have been renamed to downcast_{mut,ref} and are #[unstable]. The extension trait `BoxAny` has been clarified as to why it is unstable as it will not be necessary with DST. This is a breaking change because the `marker1` field was removed from the `UnsafeCell` type. To deal with this change, you can simply delete the field and only specify the value of the `data` field in static initializers. [breaking-change]
-
由 Alex Crichton 提交于
This commit applies stability attributes to the contents of these modules, summarized here: * The `unit` and `bool` modules have become #[unstable] as they are purely meant for documentation purposes and are candidates for removal. * The `ty` module has been deprecated, and the inner `Unsafe` type has been renamed to `UnsafeCell` and moved to the `cell` module. The `marker1` field has been removed as the compiler now always infers `UnsafeCell` to be invariant. The `new` method i stable, but the `value` field, `get` and `unwrap` methods are all unstable. * The `tuple` module has its name as stable, the naming of the `TupleN` traits as stable while the methods are all #[unstable]. The other impls in the module have appropriate stability for the corresponding trait. * The `arc` module has received the exact same treatment as the `rc` module previously did. * The `any` module has its name as stable. The `Any` trait is also stable, with a new private supertrait which now contains the `get_type_id` method. This is to make the method a private implementation detail rather than a public-facing detail. The two extension traits in the module are marked #[unstable] as they will not be necessary with DST. The `is` method is #[stable], the as_{mut,ref} methods have been renamed to downcast_{mut,ref} and are #[unstable]. The extension trait `BoxAny` has been clarified as to why it is unstable as it will not be necessary with DST. This is a breaking change because the `marker1` field was removed from the `UnsafeCell` type. To deal with this change, you can simply delete the field and only specify the value of the `data` field in static initializers. [breaking-change]
-
由 bors 提交于
This adds examples for get(), get_mut(), swap(), iter() and mut_iter()
-
由 nham 提交于
-
由 bors 提交于
-
由 nham 提交于
-
- 26 7月, 2014 24 次提交
-
-
由 bors 提交于
LLVM recently added a new attribute, dereferenceable: http://reviews.llvm.org/D4449 >This patch adds a dereferencable attribute. In some sense, this is a companion to the nonnull attribute, but specifies that the pointer is known to be dereferencable in the same sense as a pointer generated by alloca is known to be dereferencable. With rust, everywhere that we previously marked `nonnull` we can actually mark as `dereferenceable` (which implies nonnull) since we know the size. That is, except for one case: when generating calls for TyVisitor. It seems like we haven't substituted the self type (so we have `ty_param`) and just treat it as an opaque pointer so I just left that bit as nonnull. With this, LLVM can for example hoist a load out of a loop where it previously couldn't: ```Rust pub fn baz(c: &uint, n: uint) -> uint { let mut res = 0; for i in range(0, n) { if i > 0 { res += *c * i; } } res } ``` Before: ```llvm define i64 @baz(i64* noalias nocapture nonnull readonly, i64) unnamed_addr #0 { entry-block: br label %for_loopback.outer for_loopback.outer: ; preds = %then-block-33-, %entry-block %.ph = phi i64 [ %.lcssa, %then-block-33- ], [ 0, %entry-block ] %res.0.ph = phi i64 [ %8, %then-block-33- ], [ 0, %entry-block ] br label %for_loopback for_exit: ; preds = %for_loopback %res.0.ph.lcssa = phi i64 [ %res.0.ph, %for_loopback ] ret i64 %res.0.ph.lcssa for_loopback: ; preds = %for_loopback.outer, %for_body %2 = phi i64 [ %4, %for_body ], [ %.ph, %for_loopback.outer ] %3 = icmp ult i64 %2, %1 br i1 %3, label %for_body, label %for_exit for_body: ; preds = %for_loopback %4 = add i64 %2, 1 %5 = icmp eq i64 %2, 0 br i1 %5, label %for_loopback, label %then-block-33- then-block-33-: ; preds = %for_body %.lcssa = phi i64 [ %4, %for_body ] %.lcssa15 = phi i64 [ %2, %for_body ] %6 = load i64* %0, align 8 ; <------- this load %7 = mul i64 %6, %.lcssa15 %8 = add i64 %7, %res.0.ph br label %for_loopback.outer } ``` After: ```llvm define i64 @baz(i64* noalias nocapture readonly dereferenceable(8), i64) unnamed_addr #0 { entry-block: %2 = load i64* %0, align 8 ; <------- load once instead br label %for_loopback.outer for_loopback.outer: ; preds = %then-block-33-, %entry-block %.ph = phi i64 [ %.lcssa, %then-block-33- ], [ 0, %entry-block ] %res.0.ph = phi i64 [ %8, %then-block-33- ], [ 0, %entry-block ] br label %for_loopback for_exit: ; preds = %for_loopback %res.0.ph.lcssa = phi i64 [ %res.0.ph, %for_loopback ] ret i64 %res.0.ph.lcssa for_loopback: ; preds = %for_loopback.outer, %for_body %3 = phi i64 [ %5, %for_body ], [ %.ph, %for_loopback.outer ] %4 = icmp ult i64 %3, %1 br i1 %4, label %for_body, label %for_exit for_body: ; preds = %for_loopback %5 = add i64 %3, 1 %6 = icmp eq i64 %3, 0 br i1 %6, label %for_loopback, label %then-block-33- then-block-33-: ; preds = %for_body %.lcssa = phi i64 [ %5, %for_body ] %.lcssa15 = phi i64 [ %3, %for_body ] %7 = mul i64 %2, %.lcssa15 %8 = add i64 %7, %res.0.ph br label %for_loopback.outer } ```
-
由 bors 提交于
SmallIntMap doesn't involve hashing?
-
由 Guillaume Pinot 提交于
Everyone agreed except @thestinger. As @thestinger contribution on this file is trivial, we can relicense it. Related to #14248, close #15330
-
由 bors 提交于
matching. This breaks code like: struct Foo<'a,'b> { x: &'a int, y: &'b int, } trait Tr { fn foo(x: Self) {} } impl<'a,'b> Tr for Foo<'a,'b> { fn foo(x: Foo<'b,'a>) {} // <-- bad } Change this code to not contain a lifetime mismatch error. For example: struct Foo<'a,'b> { x: &'a int, y: &'b int, } trait Tr { fn foo(x: Self) {} } impl<'a,'b> Tr for Foo<'a,'b> { fn foo(x: Foo<'a,'b>) {} // OK } Closes #15517. [breaking-change] r? @alexcrichton
-
由 bors 提交于
Add `check-secondary`, which runs the pretty and lexer tests so we can run them on a dedicated bot. Leaves the pretty tests running under `check` until the bots are switched over. Also fixes some issues. r? @cmr
-
由 bors 提交于
Rename and gensym the runtime on import, so that users can't refer to the `native` crate. This is unlikely to break code, but users should import the "native" crate directly. [breaking-change] cc @alexcrichton
-
由 bors 提交于
Sadly there's still a lot of open issues, but this tackles some of the more pressing ones. Each commit has its own description along with the issues it closes.
-
由 Michael Matuzak 提交于
-
由 bors 提交于
Currently we don't emit lifetime end markers when translating the unwinding code. I omitted that when I added the support for lifetime intrinsics, because I initially made the mistake of just returning true in clean_on_unwind(). That caused almost all calls to be translated as invokes, leading to quite awful results. To correctly emit the lifetime end markers, we must differentiate between cleanup that requires unwinding and such cleanup that just wants to emit code during unwinding.
-
由 Luqman Aden 提交于
-
由 nham 提交于
-
由 nham 提交于
Implement PartialEq/Eq/Clone/Hash/FromIterator/Extendable for SmallIntMap and Show/Clone for TrieMap and TrieSet
-
由 Luqman Aden 提交于
-
由 bors 提交于
This is super, super WIP, but I'm going to go get lunch for a while, and figured I'd toss my work up here in case anyone wants to see my work as I do it. This contains a new introductory section explaining the basics of pointers, and some pitfalls that Rust attempts to solve. I'd be interested in hearing how my explanation is, as well as if this belongs here. Pointers are such a crucial concept, I don't mind having a beginners' section on them in the main docs, even though our main audience is supposed to understand them already. Reasonable people may disagree, however.
-
由 Brian Anderson 提交于
-
由 Luqman Aden 提交于
-
由 bors 提交于
Add an example showing how to use the map with a custom type. Fill in examples for methods without ones. Also move `pop_equiv` next to related public methods, to not create a duplicate trait in the docs.
-
由 Patrick Walton 提交于
matching. This breaks code like: struct Foo<'a,'b> { x: &'a int, y: &'b int, } trait Tr { fn foo(x: Self) {} } impl<'a,'b> Tr for Foo<'a,'b> { fn foo(x: Foo<'b,'a>) {} // <-- bad } Change this code to not contain a lifetime mismatch error. For example: struct Foo<'a,'b> { x: &'a int, y: &'b int, } trait Tr { fn foo(x: Self) {} } impl<'a,'b> Tr for Foo<'a,'b> { fn foo(x: Foo<'a,'b>) {} // OK } Closes #15517. [breaking-change]
-
由 Brian Anderson 提交于
-
由 Brian Anderson 提交于
This appears to be redundantly named with a shortcut target for testing the syntax crate.
-
由 Brian Anderson 提交于
Rename and gensym the runtime on import, so that users can't refer to the `native` crate. This is unlikely to break code, but users should import the "native" crate directly. [breaking-change]
-
由 bors 提交于
-
由 bors 提交于
Adds methods for obtaining iterators over the keys or values of a SmallIntMap/TreeMap/TrieMap. Closes #14376
-
由 Alex Crichton 提交于
These were all just previously skipped. Closes #15648
-