Commit Graph

8309 Commits

Author SHA1 Message Date
Mazdak Farrokhzad aa3779b4e9 Rollup merge of #58589 - matklad:remove-hack, r=petrochenkov
cleanup macro after 2018 transition

We can now use `?`
2019-02-22 14:58:04 +01:00
Mazdak Farrokhzad 94817aa87a Rollup merge of #58588 - matklad:dead-code, r=petrochenkov
remove a bit of dead code

[Six years](https://github.com/rust-lang/rust/commit/5dc5efefd47527067ab5b7862d89a99da4824f49) seem to be a long enough transition period 🤣
2019-02-22 14:58:03 +01:00
Mazdak Farrokhzad 894141b57d Rollup merge of #58198 - igorsdv:suggest-removing-parentheses-surrounding-lifetimes, r=estebank
Suggest removing parentheses surrounding lifetimes

Fixes #57386.

r? @estebank
2019-02-22 14:57:59 +01:00
Aleksey Kladov 65622e319e cleanup macro after 2018 transition
We can now use `?`
2019-02-20 10:10:11 +03:00
Aleksey Kladov abb07c42ec remove a bit of dead code 2019-02-20 09:49:52 +03:00
Dan Robertson f8b6449f80 Fix style nits
Fix style nits discovered in reading code.
2019-02-18 22:22:19 +00:00
kennytm f05e6bf708 Rollup merge of #58074 - scottmcm:stabilize-sort_by_cached_key, r=SimonSapin
Stabilize slice_sort_by_cached_key

I was going to ask on the tracking issue (https://github.com/rust-lang/rust/issues/34447), but decided to just send this and hope for an FCP here.  The method was added last March by https://github.com/rust-lang/rust/pull/48639.

Signature: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_by_cached_key
```rust
impl [T] {
    pub fn sort_by_cached_key<K, F>(&mut self, f: F)
        where F: FnMut(&T) -> K, K: Ord;
}
```

That's an identical signature to the existing `sort_by_key`, so I think the questions are just naming, implementation, and the usual "do we want this?".

The implementation seems to have proven its use in rustc at least, which many uses: https://github.com/rust-lang/rust/search?l=Rust&q=sort_by_cached_key

(I'm asking because it's exactly what I just needed the other day:
```rust
    all_positions.sort_by_cached_key(|&n|
        data::CITIES.iter()
            .map(|x| *metric_closure.get_edge(n, x.pos).unwrap())
            .sum::<usize>()
    );
```
since caching that key is a pretty obviously good idea.)

Closes #34447
2019-02-16 14:11:28 +08:00
Scott McMurray 3777b86f9b Stabilize slice_sort_by_cached_key 2019-02-12 22:26:44 -08:00
Mazdak Farrokhzad a5e869eb62 Rollup merge of #58387 - alexreg:fix-trait-alias-2, r=centril
Disallow `auto` trait alias syntax

See https://github.com/rust-lang/rust/issues/41517#issuecomment-462567679.

r? @Centril

CC @topecongiro @nikomatsakis
2019-02-13 04:37:07 +01:00
Mazdak Farrokhzad 0bc8f6f3f4 Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasper
Rename rustc_errors dependency in rust 2018 crates

I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules.

Related: rust-lang/cargo#5653

cc #58099

r? @Centril
2019-02-13 04:37:04 +01:00
Mazdak Farrokhzad 856e41142c Rollup merge of #58166 - euclio:deprecation-shorthand, r=petrochenkov
allow shorthand syntax for deprecation reason

Fixes #48271.

Created based on discussion in #56896.
2019-02-13 04:37:02 +01:00
bors 0f949c2fcc Auto merge of #58051 - SimonSapin:str_escape, r=alexcrichton
Stabilize str::escape_* methods with new return types…

… that implement `Display` and `Iterator<Item=char>`, as proposed in FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12 23:30:16 +00:00
bors b244f61b77 Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik
Cosmetic improvements to doc comments

This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase).

r? @steveklabnik

Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-12 19:09:24 +00:00
Taiki Endo c360ba285c Cleanup imports 2019-02-13 00:31:51 +09:00
Taiki Endo 3216c7656a Rename rustc_errors dependency in rust 2018 crates 2019-02-13 00:28:52 +09:00
bors c84e797642 Auto merge of #58098 - oli-obk:maybe_allow_internal_unstable, r=petrochenkov
Require a list of features in `#[allow_internal_unstable]`

The blanket-permission slip is not great and will likely give us trouble some point down the road.
2019-02-12 12:10:10 +00:00
Simon Sapin 55216f82a6 Stabilize str::escape_* methods
FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12 09:55:29 +01:00
Simon Sapin 7a077804a3 New return types for str::escape_* that impl Display and Iterator<char>
As FCP’ed in the tracking issue: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12 09:55:20 +01:00
Alexander Regueiro aafbf742c2 Disallow auto trait alias syntax. 2019-02-12 01:50:33 +00:00
Oliver Scherer bbe524d7c1 Parallel rustc needs synchronizing smart pointer cloning 2019-02-11 15:09:05 +01:00
Oliver Scherer b681433b9d Use Rc<[Symbol]> instead of Vec<Symbol> to reduce # of allocs 2019-02-11 15:08:17 +01:00
Oliver Scherer da8352cee4 Fixup RustcDeserialize internal features 2019-02-11 15:08:17 +01:00
Oliver Scherer 0b3d8de2a0 Consistent attribute argument suggestion 2019-02-11 15:08:17 +01:00
Oliver Scherer 87d5383ec3 Rename the exp field to mirror its uses 2019-02-11 15:08:17 +01:00
Oliver Scherer 33bf81eec0 Ease the transition to requiring features by just warning if there's no feature list
while we could make this change (it's all unstable after all), there are crates.io crates that use the feature and that the compiler depends upon. We can instead roll out this feature while still supporting the old way.
2019-02-11 15:08:17 +01:00
Oliver Scherer d3c212c552 Require a list of features to allow in allow_internal_unstable 2019-02-11 15:08:16 +01:00
Alexander Regueiro c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +00:00
Taiki Endo 2be0993c4e Revert removed #![feature(nll)] 2019-02-10 16:13:30 +09:00
bors 3315728c06 Auto merge of #57944 - estebank:unclosed-delim-the-quickening, r=oli-obk
Deduplicate mismatched delimiter errors

Delay unmatched delimiter errors until after the parser has run to deduplicate them when parsing and attempt recovering intelligently.

Second attempt at #54029, follow up to #53949. Fix #31528.
2019-02-09 20:15:57 +00:00
bors 618f5a08a1 Auto merge of #57617 - mark-i-m:multiple-matcher-bindings, r=petrochenkov
Error on duplicate matcher bindings

fix  #57593

This should not be merged without a crater run and maybe an FCP. Discussion is ongoing at  #57593.

TODO:
- [x] write tests
- [x] crater run
- [x] ~maybe need edition gating?~ not for 1 regression /centril

r? @petrochenkov
2019-02-09 09:48:41 +00:00
bors 43e04fb552 Auto merge of #58191 - varkor:const-generics-ast, r=petrochenkov
Add const generics to the AST

This is mostly split out from https://github.com/rust-lang/rust/pull/53645 in an effort to make progress merging const generics piecewise instead of in one go.

cc @yodaldevoid, @petrochenkov

r? @eddyb
2019-02-08 05:50:16 +00:00
Igor Sadikov f753d304c6 Suggest removing parentheses surrounding lifetimes 2019-02-07 16:13:19 -05:00
Mark Mansi 802b256283 Make it an incompatibility lint for now 2019-02-07 12:17:27 -06:00
mark 1b41c9a42e error on duplicate matcher bindings 2019-02-07 12:15:31 -06:00
Esteban Küber c54b230fa1 Add fixme 2019-02-07 06:20:23 -08:00
varkor 4e0e188999 Make name resolution handle consts in GenericParamsFromOuterFunction properly 2019-02-07 15:03:20 +01:00
varkor 451f128783 Parse negative literals in const generic arguments 2019-02-07 15:03:20 +01:00
varkor 9ad04b9960 Add warning for a parameter list with an attribute but no parameters 2019-02-07 15:03:20 +01:00
varkor b3015abfa0 Fix update to 2018 edition 2019-02-07 15:03:20 +01:00
varkor bbdcc4e7ce Adjust parser generic parameter errors 2019-02-07 15:02:17 +01:00
varkor 2fec52bf58 Add lowering errors for const generics
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07 15:02:17 +01:00
varkor ea0d99829d Add resolution errors for const generics
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07 15:02:17 +01:00
varkor b4ef753e8f Add pretty-printing for const generics
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07 15:02:16 +01:00
varkor d7695abb76 Support const generics in derive
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07 15:02:16 +01:00
varkor 0a8d98a270 Parse const generics
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07 15:02:16 +01:00
varkor 8d83521f0b Add const_generics feature flag
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07 15:02:16 +01:00
varkor 751dcdf606 Add Const kind to AST
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07 15:02:16 +01:00
Guillaume Gomez 8b886e07f5 Remove images' url to make it work even without internet connection 2019-02-07 11:06:19 +01:00
Esteban Küber 6e62129b36 add doc comment and revert angle bracket change 2019-02-07 01:42:54 -08:00
Esteban Küber 336c48cc7b tweak wording based on in person feedback 2019-02-07 01:42:54 -08:00