Commit Graph

78078 Commits

Author SHA1 Message Date
est31
f8c2598dfc Add E0696 for continue pointing to a labeled block 2018-05-16 13:56:25 +02:00
est31
50f063c75b Extend error E0695 to unlabeled continue statements 2018-05-16 13:56:25 +02:00
est31
63ef53f21d Add E0695 for unlabeled breaks 2018-05-16 13:56:24 +02:00
est31
5665980ad8 Make the compiler support the label-break-value feature
No error checking or feature gating yet
2018-05-16 13:56:24 +02:00
est31
ebca9c6ab9 Add a file with test cases 2018-05-16 13:56:24 +02:00
est31
11f5893610 label-break-value: Parsing and AST/HIR changes 2018-05-16 13:56:24 +02:00
bors
448cc578a9 Auto merge of #48557 - matthewjasper:allow-trvial-bounds, r=nikomatsakis
Implement RFC 2056 trivial constraints in where clauses

This is an implementation of the new behaviour for #48214. Tests are mostly updated to show the effects of this. Feature gate hasn't been added yet.

Some things that are worth noting and are maybe not want we want

* `&mut T: Copy` doesn't allow as much as someone might expect because there is often an implicit reborrow.
* ~There isn't a check that a where clause is well-formed any more, so `where Vec<str>: Debug` is now allowed (without a `str: Sized` bound).~

r? @nikomatsakis
2018-05-16 09:03:38 +00:00
bors
3ec2058bfe Auto merge of #50795 - nrc:update, r=oli-obk
Update RLS and Rustfmt

Fixes RLS tests

r? @alexcrichton
2018-05-16 06:19:29 +00:00
bors
75a00490c9 Auto merge of #50750 - est31:master, r=eddyb
Remove ScopeTarget and LoopIdResult

* Remove ScopeTarget in preparation of label-break-value (PR #50045)
* Replace LoopIdResult by Result which is possible now thanks to commit 8ac65af81f " Implement Encodable and Decodable for Result."

r? @eddyb
2018-05-16 04:00:33 +00:00
Nick Cameron
80bfca4ab2 Update RLS and Rustfmt 2018-05-16 15:59:55 +12:00
bors
3c31e17ddc Auto merge of #50541 - QuietMisdreavus:rustdoc-errors, r=GuillaumeGomez
rustdoc: replace most (e)println! statements with structured warnings/errors

Turns out, the rustc diagnostic handler doesn't need a whole lot of setup that we weren't already doing. For errors that occur outside a "dealing with source code" context, we can just use the format/color config we were already parsing and make up a `Handler` that we can emit structured warnings/errors from. So i did that. This will make it way easier to test things with `rustdoc-ui` tests, since those require the JSON error output. (In fact, this PR is a yak shave for a different one where i was trying to do just that. `>_>`)
2018-05-16 01:43:26 +00:00
bors
e44fc6c52d Auto merge of #48523 - varkor:generics-ty-generalisations, r=nikomatsakis
The Great Generics Generalisation: Ty Edition

Part of the generic parameter refactoring effort, split off from https://github.com/rust-lang/rust/pull/48149. Contains the `ty`-relative refactoring.

r? @eddyb
2018-05-15 23:03:04 +00:00
Matthew Jasper
be2900c33b Make is_global true for latebound regions 2018-05-15 21:48:35 +01:00
bors
f0fdaba04e Auto merge of #50767 - oli-obk:rls_clippy, r=kennytm
Don't inject clippy into the rls anymore

r? @kennytm

sorry about breaking nightlies.

The issue is that the `[patch.crates-io]` doesn't work if the versions differ. So every time we update clippy, we can only update it to the verison that rls is depending on.

I'm disabling the injection of clippy into rls for now. I'm not sure how to do this properly. We could

* add a version check, so rls only builds clippy if its dependency clippy is the same as the submodule clippy
* do something crazy like auto-patching the Cargo.toml of the rls tool repo to just use a path dependency on clippy
* build crates-io clippy instead of submodule clippy and gate clippy injection on that
    * that's somewhat automatic, and is essentially what is necessary right now, but done manually
* make clippy 0.1.* instead of 0.0.* and update patch versions for nightly updates and minor version updates for `clippy_lints` api changes.
    * not sure how semver-great this is
2018-05-15 20:18:13 +00:00
varkor
5be2bdb498 One must always remember to clean up after themselves 2018-05-15 14:52:53 +01:00
est31
4d328f786e Pattern match on Ok instead of Some of .ok() retval 2018-05-15 15:47:57 +02:00
est31
235e7c1b43 Remove LoopIdResult
It's redundant as Result already implements Encodable
as well as Decodable.
2018-05-15 15:47:32 +02:00
est31
3ef481a520 Remove hir::ScopeTarget
When we want to implement label-break-value,
we can't really decide whether to emit ScopeTarget::Loop or
ScopeTarget::Block in the code that is supposed to create it.
So we get rid of it and reconstruct the information when
needed.
2018-05-15 15:47:31 +02:00
varkor
5ea91ac531 Collapse Substs::identity_for_item in collect 2018-05-15 14:22:25 +01:00
varkor
39a68e9069 Clean up dropck_outlives PhantomData handling 2018-05-15 14:22:25 +01:00
varkor
0a9371ab77 Add mk_param_from_def 2018-05-15 14:22:25 +01:00
varkor
e9c28b2564 Use Kind instead of UnpackedKind in Substs methods 2018-05-15 14:22:25 +01:00
varkor
3ae2468261 Clean up shared subst code 2018-05-15 14:22:11 +01:00
varkor
d9190da982 Refactor Substs methods on generic parameters 2018-05-15 14:22:11 +01:00
varkor
030f10f752 Clean up generic param handling 2018-05-15 14:21:32 +01:00
varkor
25bf73d31c Update bad-annotation error message 2018-05-15 14:21:32 +01:00
varkor
b575c18992 Refactoring generic counting loops 2018-05-15 14:21:32 +01:00
varkor
fe1f651e4c Review refactoring 2018-05-15 14:21:32 +01:00
varkor
fd8e284a20 Rename param_counts to own_counts 2018-05-15 14:21:32 +01:00
varkor
365c8c3704 Remove GenericParamDef::to_type 2018-05-15 14:21:32 +01:00
varkor
007de2f896 Lift pure_wrt_drop to GenericParamDef 2018-05-15 14:21:32 +01:00
varkor
9200bdee26 Refactor generic params loops 2018-05-15 14:21:32 +01:00
varkor
18f77e25e9 Fix rebase fallout 2018-05-15 14:21:32 +01:00
varkor
9f9d4beda6 Rename RegionParamDef to LifetimeParamDef 2018-05-15 14:21:32 +01:00
varkor
4bed895cab Pull common parameters into GenericParamDef
This leads to a lot of simplifications, as most code doesn't actually need to know about the specific lifetime/type data; rather, it's concerned with properties like name, index and def_id.
2018-05-15 14:21:32 +01:00
varkor
5e89312a22 Inline get_type 2018-05-15 14:21:32 +01:00
varkor
fc27c2eb38 Fix typo in late-bound region testing message 2018-05-15 14:21:31 +01:00
varkor
d62fc236f9 Refactor to address comments 2018-05-15 14:21:31 +01:00
varkor
df1c256a2b Replace type_param_to_index with param_def_id_to_index 2018-05-15 14:21:31 +01:00
varkor
7b45a892a4 Use GenericParamCount instead of FxHashMap 2018-05-15 14:21:31 +01:00
varkor
a17896a3b6 Place Self at the start of ty::Generics' param lists 2018-05-15 14:21:03 +01:00
varkor
6f257bf26f Correct variable renaming fallout 2018-05-15 14:21:03 +01:00
varkor
0b8b14f6f5 Eliminate ty::Generics::types()
And with one final incanation, the specific kind iterators were banished from ty::Generics, never to be seen again!
2018-05-15 14:21:03 +01:00
varkor
d557ff983f Eliminate ty::Generics::lifetimes()
Begone lazy lifetime code!
2018-05-15 14:21:03 +01:00
varkor
b75f421ee9 Generalise more cases of explicit iteration of specific kinds 2018-05-15 14:21:03 +01:00
varkor
4a6c946368 Generalise cases of explicit iteration of specific kinds 2018-05-15 14:21:03 +01:00
varkor
cadf96e8e1 Fix tidy errors caused by renaming 2018-05-15 14:20:19 +01:00
varkor
06f0a7c89f Rename TypeParameterDef -> TypeParamDef and RegionParameterDef -> RegionParamDef 2018-05-15 14:20:19 +01:00
varkor
178a8f1139 Rename GenericParam to GenericParamDef 2018-05-15 14:20:19 +01:00
varkor
15d2759d90 Rename has_type_parameters to requires_monomorphization 2018-05-15 14:20:19 +01:00