First step towards `u128` instead of `Const` in `PatternKind::Range`
This PR accomplishes two things:
* It adds `ty::Ty` to `PatternKind::Range`. The extra type information will make it easier to remove it from the `hi` and `lo` members.
* It exchanges `Const` for `u128` in `Constructor::ConstantRange`.
support ascription for patterns in NLL
This implements the strategy outlined in [this comment](https://github.com/rust-lang/rust/issues/47184#issuecomment-416669986):
- We first extend the NLL subtyping code so it can handle inference variables and subtyping.
- Then we extend HAIR patterns with type ascription.
- Then we treat the type `T` in `let pat: T = ...` as an ascription.
Before landing, a few things:
- [x] Fix the WF rule bug (filed a FIXME https://github.com/rust-lang/rust/issues/54105)
- [x] Fix an ICE I encountered locally around bound regions, or else file a follow-up
- [x] More tests probably =)
r? @pnkfelix
stabilize #[used]
closes#40289
RFC for stabilization: rust-lang/rfcs#2386
r? @Centril
Where should this be documented? Currently the documentation is in the unstable book
Invocation/expansion ID (aka `Mark`) is not really necessary for resolving a macro path.
What is really necessary is its parent module, parent expansion and parent legacy scope.
This is required for validation resolutions of built-in attributes, which don't get their own `Mark`s
Allow named lifetimes in async functions.
- Fixes#53174
Code by @eddyb; @cramertj suggested I lift it off another change so we can fix#53174.
r? @cramertj
For some weird reason this fixes `intrinsic-move-val`. It also affects
various test heuristics. I removed one test (`reborrow_basic`) that
didn't seem to really be testing anything in particular anymore,
compared to all the other tests we've got.
rustc_resolve: inject `uniform_paths` canaries regardless of the feature-gate, on Rust 2018.
This PR is an attempt at future-proofing "anchored paths" by emitting the same ambiguity errors that `#![feature(uniform_paths)]` would, with slightly changed phrasing (see added UI tests).
Also, on top of #54005, this PR allows this as well:
```rust
use crate_name;
use crate_name::foo;
```
In that any ambiguity between an extern crate and an import *of that same crate* is ignored.
r? @petrochenkov cc @aturon @Centril @joshtriplett
#53359: putting multiple unresolved import on single line
r? @estebank
Here is WIP implementation of #53359
this PR have clubbed multiple unresolved imports into a single line.
I think still two things need to improve like giving specific `label message` for each span of multi_span(how we can do this?) and second we are getting a warning while compiling, stating something like `E0432` have been passed before.
resolve: Split macro prelude into built-in and user-defined parts
This is a refactoring that will help to remove `unshadowable_attrs` when https://github.com/rust-lang/rust/pull/53410 lands.
UPDATE: The second commit actually removes `unshadowable_attrs`.
resolve: Relax shadowing restrictions on macro-expanded macros
Previously any macro-expanded macros weren't allowed to shadow macros from outer scopes.
Now only "more macro-expanded" macros cannot shadow "less macro-expanded" macros.
See comments to `fn may_appear_after` and added tests for more details and examples.
The functional changes are a21f6f588fc28c97533130ae44a6957b579ab58c and 46dd365ce9ca0a6b8653849b80267763c542842a, other commits are refactorings.