478 Commits

Author SHA1 Message Date
bors
28bcffead7 Auto merge of #53815 - F001:if-let-guard, r=petrochenkov
refactor match guard

This is the first step to implement RFC 2294: if-let-guard. Tracking issue: https://github.com/rust-lang/rust/issues/51114

The second step should be introducing another variant `IfLet` in the Guard enum. I separated them into 2 PRs for the convenience of reviewers.

r? @petrochenkov
2018-09-01 20:31:29 +00:00
bors
fea32f1b77 Auto merge of #53604 - oli-obk:min_const_fn, r=Centril,varkor
Implement the `min_const_fn` feature gate

cc @RalfJung @eddyb

r? @Centril

implements the feature gate for #53555

I added a hack so the `const_fn` feature gate also enables the `min_const_fn` feature gate. This ensures that nightly users of `const_fn` don't have to touch their code at all.

The `min_const_fn` checks are run first, and if they succeeded, the `const_fn` checks are run additionally to ensure we didn't miss anything.
2018-09-01 11:26:24 +00:00
bors
163adf2860 Auto merge of #53699 - oli-obk:promotion_stability_hole, r=nikomatsakis
Fix promotion stability hole in old borrowck

r? @nikomatsakis

I screwed up the promotion stability checks. Big time. They were basically nonexistant. We had tests for it. I also screwed up said tests. This is in stable already :(

Basically stability checks of promotion only worked if you tried to use a const fn defined in the same crate.

cc @eddyb
2018-08-31 14:06:14 +00:00
Oliver Schneider
472ca71598 Implement the min_const_fn feature gate 2018-08-31 08:39:59 +02:00
F001
7a083ca25f introduce Guard enum 2018-08-30 12:18:11 +08:00
varkor
e2a1cce9c5 Rename hir::map::NodeKind to hir::Node 2018-08-27 21:46:23 +01:00
varkor
11665ca45a Remove path prefixes from NodeKind 2018-08-27 21:46:13 +01:00
varkor
befc4b1100 Rename hir::map::Node to hir::map::NodeKind 2018-08-27 21:45:46 +01:00
Oliver Schneider
458f5a21e2 Properly prevent the promotion of unstable const fns 2018-08-25 14:58:39 +02:00
Niko Matsakis
73fb1622b3 check that adding infer-outlives requirement to all crates works 2018-08-24 17:10:50 -04:00
bors
f1b506af02 Auto merge of #53607 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 10 pull requests

Successful merges:

 - #53418 (Mark some suggestions as MachineApplicable)
 - #53431 (Moved some feature gate ui tests to correct location)
 - #53442 (Update version of rls-data used with save-analysis)
 - #53504 (Set applicability for more suggestions.)
 - #53541 (Fix missing impl trait display as ret type)
 - #53544 (Point at the trait argument when using unboxed closure)
 - #53558 (Normalize source line and column numbers.)
 - #53562 (Lament the invincibility of the Turbofish)
 - #53574 (Suggest direct raw-pointer dereference)
 - #53585 (Remove super old comment on function that parses items)

Failed merges:

 - #53472 (Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.)
 - #53563 (use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into())

r? @ghost
2018-08-22 19:59:52 +00:00
Guillaume Gomez
4fa4bb5633
Rollup merge of #53504 - ekse:suggestions-applicability-2, r=estebank
Set applicability for more suggestions.

Converts a couple more calls to `span_suggestion_with_applicability`  (#50723). To be on the safe side, I marked suggestions that depend on the intent of the user or that are potentially lossy conversions as MaybeIncorrect.

r? @estebank
2018-08-22 17:45:34 +02:00
varkor
6f637da50c Remove Ty prefix from Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error} 2018-08-22 16:07:44 +01:00
bors
1558ae7cfd Auto merge of #51880 - varkor:generics-hir-generalisation-followup, r=eddyb
The Great Generics Generalisation: HIR Followup

Addresses the final comments in #48149.

r? @eddyb, but there are a few things I have yet to clean up. Making the PR now to more easily see when things break.

cc @yodaldevoid
2018-08-20 15:47:39 +00:00
varkor
aa3b5c58e4 Fix diagnostic regression 2018-08-20 16:16:39 +01:00
Sébastien Duquette
5a23a0d283 Set applicability for more suggestions. 2018-08-20 03:56:06 -04:00
Donato Sciarra
82607d2cf3 mv (mod) codemap source_map 2018-08-19 23:01:00 +02:00
varkor
11adc1300c Address minor comments 2018-08-19 20:02:32 +01:00
varkor
5c814e2e4e Clean up and add extra tests 2018-08-11 21:25:48 +01:00
varkor
e4c3b49fe7 Emit an error during parsing 2018-08-11 21:08:24 +01:00
varkor
a478cd41e3 Improve diagnostics 2018-08-11 21:08:24 +01:00
varkor
235905c080 Fix handling of trait methods with bodies and improve efficiency 2018-08-11 21:08:24 +01:00
varkor
b05f0bec1a Suggest replacing patterns with underscores 2018-08-11 21:08:24 +01:00
varkor
90a6954327 Emit error for pattern arguments in trait methods
The error and check for this already existed, but the parser didn't try to parse trait method arguments as patterns, so the error was never emitted. This surfaces the error, so we get better errors than simple parse errors.
2018-08-11 21:08:24 +01:00
memoryruins
95b64188c9 [nll] librustc_passes: enable feature(nll) for bootstrap 2018-08-09 04:09:07 -04:00
Mark Rousskov
3baec3cdd7 Add HirId to VisibilityKind::Restricted 2018-08-07 10:13:17 -06:00
Mark Rousskov
0ae2aa2320 Use diagnostic API on Session 2018-08-04 06:54:36 -06:00
Matthew Jasper
18d5f82148 Change order of copy and borrow to avoid conflict
Note that the first argument is `self as &mut dyn Delegate`, so this
isn't allowed with two-phase borrows.
2018-07-29 18:04:09 +01:00
kennytm
59f8422a17
Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakis
Use a slice where a vector is not necessary
2018-07-28 16:25:07 +08:00
ljedrz
1cca420435 Use slices where a vector is not necessary 2018-07-27 16:50:28 +02:00
Tatsuyuki Ishi
e098985939 Deny bare_trait_objects globally 2018-07-25 10:25:29 +09:00
Oliver Schneider
de511438cd Promoteds are statics and statics have a place, not just a value 2018-07-23 09:51:30 +02:00
csmoe
6a16b38198 ExprKind 2018-07-16 15:09:16 +02:00
csmoe
14893ba96b DeclKind 2018-07-16 15:09:16 +02:00
csmoe
114314c920 StmtKind 2018-07-16 15:09:16 +02:00
csmoe
fe8955bd58 BinOpKind 2018-07-16 15:09:16 +02:00
bors
49f1e5d8ab Auto merge of #52318 - TheDarkula:master, r=oli-obk
Removed the promotable field from CheckCrateVisitor...

and replaced it with the custom enum Promotability.

r? @oli-obk
2018-07-14 22:28:31 +00:00
Meade Kincke
07faca9741 Removed the promotable field from CheckCrateVisitor and replaced it with the structs Promotable and NotPromotable. 2018-07-14 21:46:19 +01:00
Vadim Petrochenkov
7d142c1e53 Address comments 2018-07-14 14:57:15 +03:00
Vadim Petrochenkov
4d1a30c92b Remove most of PartialEq impls from AST and HIR structures 2018-07-14 14:56:57 +03:00
ljedrz
5058af7003 Deny bare trait objects in the rest of rust 2018-07-12 13:50:22 +02:00
Meade Kincke
f629eb3595 General fixes and cleanup. 2018-07-07 01:09:09 +01:00
Meade Kincke
75bc0649b8 Omitted the walk in visit_expr() 2018-07-07 01:09:09 +01:00
varkor
4d66b65850 Fix issue-50585 test 2018-07-02 19:44:27 +01:00
varkor
7ad1c62d38 Fix an ICE using break and continue as array lengths 2018-07-02 19:43:16 +01:00
bors
ef9a322843 Auto merge of #51883 - estebank:placement-suggestion, r=varkor
Suggest correct comparison against negative literal

When parsing as emplacement syntax (`x<-1`), suggest the correct syntax
for comparison against a negative value (`x< -1`).

Fix #45651.
2018-07-01 13:37:05 +00:00
Esteban Küber
23d59d00be Suggest correct comparison against negative literal
When parsing as emplacement syntax (`x<-1`), suggest the correct syntax
for comparison against a negative value (`x< -1`).
2018-06-28 14:58:54 -07:00
Oliver Schneider
b2e2c32105 Generate the NodeId for existential type in the AST 2018-06-27 11:17:25 +02:00
bors
4fe88c05cd Auto merge of #51727 - varkor:expragain-to-exprcontinue, r=petrochenkov
Rename hir::ExprAgain to hir::ExprContinue

The current name is confusing and historical.

I also used this PR to clean up the annoying indentation in `check/mod.rs`. If that's viewed as too tangential a change, I'll split it up, but it seemed reasonable to slip it in to reduce @bors's work. It's easy to compare for the two commits individually.

r? @petrochenkov
2018-06-23 14:33:10 +00:00
varkor
7ba2952af6 Rename ExprAgain to ExprContinue 2018-06-23 10:51:01 +01:00