Commit Graph

10 Commits

Author SHA1 Message Date
Huon Wilson
4016c729f1 Remove use of associated_types feature gate from tests. 2015-01-05 20:00:10 +11:00
Alex Crichton
340f3fd7a9 rollup merge of #20410: japaric/assoc-types
Conflicts:
	src/liballoc/lib.rs
	src/libcollections/lib.rs
	src/libcollections/slice.rs
	src/libcore/ops.rs
	src/libcore/prelude.rs
	src/libcore/ptr.rs
	src/librustc/middle/traits/project.rs
	src/libstd/c_str.rs
	src/libstd/io/mem.rs
	src/libstd/io/mod.rs
	src/libstd/lib.rs
	src/libstd/path/posix.rs
	src/libstd/path/windows.rs
	src/libstd/prelude.rs
	src/libstd/rt/exclusive.rs
	src/libsyntax/lib.rs
	src/test/compile-fail/issue-18566.rs
	src/test/run-pass/deref-mut-on-ref.rs
	src/test/run-pass/deref-on-ref.rs
	src/test/run-pass/dst-deref-mut.rs
	src/test/run-pass/dst-deref.rs
	src/test/run-pass/fixup-deref-mut.rs
	src/test/run-pass/issue-13264.rs
	src/test/run-pass/overloaded-autoderef-indexing.rs
2015-01-02 13:51:50 -08:00
Jorge Aparicio
64b7c22c46 core: use assoc types in Deref[Mut] 2015-01-02 12:19:59 -05:00
Nick Cameron
30e149231c Use derive rather than deriving in tests 2015-01-02 23:05:22 +13:00
Patrick Walton
496cc4c0d4 librustc: Fix up mutability in method autoderefs if incorrect, and
prefer `Deref` over `DerefMut` in all other circumstances.

Closes #12825.
2014-09-30 14:38:04 -07:00
Patrick Walton
6f99a27886 librustc: Implement lifetime elision.
This implements RFC 39. Omitted lifetimes in return values will now be
inferred to more useful defaults, and an error is reported if a lifetime
in a return type is omitted and one of the two lifetime elision rules
does not specify what it should be.

This primarily breaks two uncommon code patterns. The first is this:

    unsafe fn get_foo_out_of_thin_air() -> &Foo {
        ...
    }

This should be changed to:

    unsafe fn get_foo_out_of_thin_air() -> &'static Foo {
        ...
    }

The second pattern that needs to be changed is this:

    enum MaybeBorrowed<'a> {
        Borrowed(&'a str),
        Owned(String),
    }

    fn foo() -> MaybeBorrowed {
        Owned(format!("hello world"))
    }

Change code like this to:

    enum MaybeBorrowed<'a> {
        Borrowed(&'a str),
        Owned(String),
    }

    fn foo() -> MaybeBorrowed<'static> {
        Owned(format!("hello world"))
    }

Closes #15552.

[breaking-change]
2014-07-19 13:10:58 -07:00
Alex Crichton
748bc3ca49 std: Rename {Eq,Ord} to Partial{Eq,Ord}
This is part of the ongoing renaming of the equality traits. See #12517 for more
details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord}
or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}.

cc #12517

[breaking-change]
2014-05-30 15:52:24 -07:00
Alex Crichton
da3625161d Removing imports of std::vec_ng::Vec
It's now in the prelude.
2014-03-20 09:30:14 -07:00
Daniel Micay
14f656d1a7 rename std::vec_ng -> std::vec
Closes #12771
2014-03-20 04:25:32 -04:00
Eduard Burtescu
27c62449db Region + borrow checker support and tests for overloaded autoderef. 2014-03-13 14:21:46 +02:00