Commit Graph

35380 Commits

Author SHA1 Message Date
Niko Matsakis
1085012cd2 Kill some warnings about shadowed lifetimes 2014-12-19 03:29:59 -05:00
Niko Matsakis
d4f8a5abc5 Work around #19982 by rewriting test impls to not use anonymous
lifetimes. This currently causes an ICE; it should (ideally) work, but
failing that at least give a structured error. For the purposes of
this PR, though, workaround is fine.
2014-12-19 03:29:59 -05:00
Niko Matsakis
aa20e2ff36 Document new algorithm at a high-level. 2014-12-19 03:29:31 -05:00
Niko Matsakis
0b88c5d392 Remove text on method matching, which is now out of date. 2014-12-19 03:29:31 -05:00
Niko Matsakis
dab6e70e03 Convert gigantic comment away from //! form. It is annoying to
read (`//!` is intrusive) and annoying to edit (must maintain a prefix
on every line). Since the only purpose of a `doc.rs` file is to have a
bunch of text, using `/*!` and `*/` without indentations seems
appropriate.
2014-12-19 03:29:31 -05:00
Niko Matsakis
f45c0ef51e Implement "perfect forwarding" for HR impls (#19730). 2014-12-19 03:29:31 -05:00
Niko Matsakis
c2ca1a4b62 Make all predicates higher-ranked, not just trait references. 2014-12-19 03:29:30 -05:00
Niko Matsakis
4f34524fcb Move leak_check into its own method, and ensure that all higher-ranked code is in
`higher_ranked.rs`.
2014-12-19 03:29:30 -05:00
Niko Matsakis
1205fd88df Centralize on using Binder to introduce new binding levels, rather than having FnSig carry an implicit binding level. This means that we be more typesafe in general, since things that instantiate bound regions can drop the Binder to reflect that. 2014-12-19 03:29:30 -05:00
Niko Matsakis
ed4952ef39 Add (currently unused) helper routine for skolemizing bound regions. 2014-12-19 03:29:30 -05:00
Niko Matsakis
416e62924e Rename the code that replaces unbound variables to "freshen" rather than "skolemize" -- strictly speaking, this is not skolemization, because it is not discharging quantifiers. Also, the trait selection code will still be doing true skolemization, so it would be a confusing overlap of names. 2014-12-19 03:29:30 -05:00
Niko Matsakis
3cf0fbeee9 Create distinct types for a PolyTraitRef (with bindings) and a normal TraitRef. 2014-12-19 03:29:30 -05:00
Niko Matsakis
b3dcb85404 Fix a bug in the opt-in-copy work: it was failing to liberate the regions bound in the impl before searching for Copy implements for all fields, leading to problems in the "copyability check". Basically the copyability check would wind up looking for an impl of for<'tcx> Foo<&'tcx T>. The impl that exists however is impl<T> Copy for Foo<T> and the current rules do not consider that a match (something I would like to revise in a later PR). 2014-12-19 03:29:30 -05:00
Niko Matsakis
1b24602ca0 Extract leak check into a distinct subroutine. 2014-12-19 03:29:30 -05:00
Niko Matsakis
885f7ee12e Extract skolemize_regions() helper function. 2014-12-19 03:29:30 -05:00
Niko Matsakis
ff35eeb80a Recycle skolemization counts and add some comments. 2014-12-19 03:29:29 -05:00
Niko Matsakis
7be059ffcd Propagate expected type more widely so that we can rewrite the
issue-14039 test in a more natural way. Previously the "type we will
cast to" was hidden unless it was an integer.
2014-12-19 03:29:29 -05:00
Niko Matsakis
5a6a26acd6 Delete tests that passed in error. We currently do not support a Clone
impl for fn pointer types including bound regions, unfortunately.
2014-12-19 03:29:29 -05:00
Niko Matsakis
eb6ea5d49b Cleanup type resolution to use type folding infrastructure and not
have such a silly over-engineered interface.
2014-12-19 03:29:29 -05:00
Niko Matsakis
3efc9d2c55 Fix bug in higher-ranked code that would sometimes leak skolemized regions and/or cause incorrect results. 2014-12-19 03:29:29 -05:00
Niko Matsakis
514dfdbf12 Add tests for sub relationship on free/bound regions, revealing a bug. 2014-12-19 03:29:29 -05:00
bors
6bdce25e15 auto merge of #19899 : japaric/rust/unops-by-value, r=nikomatsakis
- The following operator traits now take their argument by value: `Neg`, `Not`. This breaks all existing implementations of these traits.

- The unary operation `OP a` now "desugars" to `OpTrait::op_method(a)` and consumes its argument.

[breaking-change]

---

r? @nikomatsakis This PR is very similar to the binops-by-value PR
cc @aturon
2014-12-19 06:12:01 +00:00
bors
840de07208 auto merge of #19955 : Gankro/rust/kill-all-code, r=aturon
EnumSet lives on in libcollections so that librustc can still use it. This adds a direct dependency on libcollections to librustc and libserialize.

Should not be merged until https://github.com/rust-lang/rfcs/pull/509 is accepted.

All of these collections have already been moved to collect-rs where they will ideally be maintained and experimented with, or will be replaced by something better: https://github.com/Gankro/collect-rs/

[breaking-change]

r? @aturon @alexcrichton
2014-12-19 02:52:01 +00:00
Alexis Beingessner
67d3823fc3 enumset fallout 2014-12-18 16:20:32 -05:00
Alexis Beingessner
0bd4dc68e6 s/Tree/BTree 2014-12-18 16:20:32 -05:00
Alexis Beingessner
6c00f9c5ff remove TreeMap, TreeSet, TrieMap, TrieSet, LruCache. deprecate EnumSet's std re-export 2014-12-18 16:20:31 -05:00
bors
99d6956c3b auto merge of #19896 : ktossell/rust/allow-nodoc-install, r=alexcrichton
If you configure with `--disable-docs`, the `doc` directory does not get generated, so the
`cp -r doc dist/` step fails when you `make dist{,-tar-bins,-doc}` or `make install`.
2014-12-18 20:32:07 +00:00
Jorge Aparicio
9b5de39c25 Address Niko's comments 2014-12-18 15:02:29 -05:00
Jorge Aparicio
d15d1529e0 Test unop move semantics 2014-12-18 15:02:29 -05:00
Jorge Aparicio
5d49999ad3 Fix run pass tests 2014-12-18 15:02:29 -05:00
Jorge Aparicio
5f347d7708 libstd: convert Duration unops to by value 2014-12-18 15:02:29 -05:00
Jorge Aparicio
340f042e03 libstd: convert BitFlags unops to by value 2014-12-18 15:02:28 -05:00
Jorge Aparicio
5359879fb6 libcore: convert unop traits to by value 2014-12-18 15:02:27 -05:00
Jorge Aparicio
5caebb23cd Tell regionck that user unops are by value 2014-12-18 14:56:00 -05:00
Jorge Aparicio
b98c3bd4d2 Tell expr_use_visitor that user unops are by value 2014-12-18 14:56:00 -05:00
Jorge Aparicio
9a962a7bdc Tell trans that user unops are by value 2014-12-18 14:56:00 -05:00
Jorge Aparicio
c5b6d9412d Tell typeck that user unops are by value 2014-12-18 14:56:00 -05:00
Jorge Aparicio
7efaf3fa34 syntax/ast_util: add is_by_value_unop() 2014-12-18 14:56:00 -05:00
bors
f9a48492a8 auto merge of #19984 : japaric/rust/macro-expressions, r=alexcrichton
followed by a semicolon.

This allows code like `vec![1i, 2, 3].len();` to work.

This breaks code that uses macros as statements without putting
semicolons after them, such as:

    fn main() {
        ...
        assert!(a == b)
        assert!(c == d)
        println(...);
    }

It also breaks code that uses macros as items without semicolons:

    local_data_key!(foo)

    fn main() {
        println("hello world")
    }

Add semicolons to fix this code. Those two examples can be fixed as
follows:

    fn main() {
        ...
        assert!(a == b);
        assert!(c == d);
        println(...);
    }

    local_data_key!(foo);

    fn main() {
        println("hello world")
    }

RFC #378.

Closes #18635.

[breaking-change]

---

Rebased version of #18958
r? @alexcrichton 
cc @pcwalton
2014-12-18 17:32:07 +00:00
Patrick Walton
ddb2466f6a librustc: Always parse macro!()/macro![] as expressions if not
followed by a semicolon.

This allows code like `vec![1i, 2, 3].len();` to work.

This breaks code that uses macros as statements without putting
semicolons after them, such as:

    fn main() {
        ...
        assert!(a == b)
        assert!(c == d)
        println(...);
    }

It also breaks code that uses macros as items without semicolons:

    local_data_key!(foo)

    fn main() {
        println("hello world")
    }

Add semicolons to fix this code. Those two examples can be fixed as
follows:

    fn main() {
        ...
        assert!(a == b);
        assert!(c == d);
        println(...);
    }

    local_data_key!(foo);

    fn main() {
        println("hello world")
    }

RFC #378.

Closes #18635.

[breaking-change]
2014-12-18 12:09:07 -05:00
bors
c4d58ce15b auto merge of #19819 : vadimcn/rust/fix-demangle, r=alexcrichton
Windows dbghelp strips leading underscores from symbols, and I could not find a way to turn this off.  So let's accept  "ZN...E" form too.
Also, print PC displacement from symbols.  This is helpful in gauging whether the PC was indeed within the function displayed in the backtrace, or whether it just happened to be the closest public symbol in the module.
2014-12-18 14:42:06 +00:00
bors
2a231594c4 auto merge of #19780 : jakub-/rust/e-needstest, r=alexcrichton
Closes #5988.
Closes #10176.
Closes #10456.
Closes #12744.
Closes #13264.
Closes #13324.
Closes #14182.
Closes #15381.
Closes #15444.
Closes #15480.
Closes #15756.
Closes #16822.
Closes #16966.
Closes #17351.
Closes #17503.
Closes #17545.
Closes #17771.
Closes #17816.
Closes #17897.
Closes #17905.
Closes #18188.
Closes #18232.
Closes #18345.
Closes #18389.
Closes #18400.
Closes #18502.
Closes #18611.
Closes #18783.
Closes #19009.
Closes #19081.
Closes #19098.
Closes #19127.
Closes #19135.
2014-12-18 12:21:57 +00:00
bors
c0b2885ee1 auto merge of #19769 : nick29581/rust/coerce-if, r=nikomatsakis
r? @nikomatsakis 

We discussed coercions for `if` and `match` expressions. `if` seems to work already, was there some specific behaviour which wasn't working?
2014-12-18 06:41:59 +00:00
Nick Cameron
46eb72453f Propagate coercions through match expressions. 2014-12-18 13:48:05 +13:00
Ken Tossell
cbf80f3a68 Only try to install the doc directory if it exists.
If you configure with `--disable-docs`, the `doc` directory does not get generated, so
`cp -r doc dist/` fails when you `make dist{,-tar-bins,-doc}` or `make install`
2014-12-17 19:24:40 -05:00
Jakub Bukaj
62d80df0c9 Add tests for E-needstest issues 2014-12-17 23:00:32 +01:00
bors
22a9f250b5 auto merge of #19958 : alexcrichton/rust/rollup, r=alexcrichton 2014-12-17 21:33:15 +00:00
Alex Crichton
5c98952409 Test fixes and rebase conflicts 2014-12-17 11:50:32 -08:00
Alex Crichton
76fbb5d527 rollup merge of #19947: csouth3/arc-borrowfrom
Closes #19937.
2014-12-17 11:50:31 -08:00
Alex Crichton
7ffbd8bad5 rollup merge of #19943: steveklabnik/doc_std_vec
Random improvements to the `std::vec` docs.
2014-12-17 11:50:31 -08:00