Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #69555

Merged
merged 32 commits into from Feb 28, 2020
Merged

Rollup of 10 pull requests #69555

merged 32 commits into from Feb 28, 2020

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Feb 28, 2020

Successful merges:

Failed merges:

r? @ghost

XAMPPRocky and others added 30 commits February 9, 2020 10:39
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
Co-Authored-By: Jonas Schievink <jonasschievink@gmail.com>
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
…matsakis

instantiate_value_path: on `SelfCtor`, avoid unconstrained tyvars

Fixes rust-lang#69306.

On `Self(...)` (that is, a `Res::SelfCtor`), do not use `self.impl_self_ty(...)`. The problem with that method is that it creates unconstrained inference variables for type parameters in the `impl` (e.g. `impl<T> S0<T>`). These variables then eventually get substituted for something else when they come in contact with the expected type (e.g. `S0<u8>`) or merely the arguments passed to the tuple constructor (e.g. the `0` in `Self(0)`).

Instead of using `self.impl_self_ty(...)`, we instead merely use `let ty = self.normalize_ty(span, tcx.at(span).type_of(impl_def_id));` to get the rewritten `res`.

r? @eddyb
parser: `token` -> `normalized_token`, `nonnormalized_token` -> `token`

So, after rust-lang#69006, its follow-ups and an attempt to remove `Parser::prev_span` I came to the conclusion that the unnormalized token and its span is what you want in most cases, so it should be default.

Normalization only makes difference in few cases where we are checking against `token::Ident` or `token::Lifetime` specifically.
This PR uses `normalized_token` for those cases.

Using normalization explicitly means that people writing code should remember about `NtIdent` and `NtLifetime` in general. (That is alleviated by the fact that `token.ident()` and `fn parse_ident_*` are already written.)
Remembering about `NtIdent`, was, however, already the case, kind of, because the implicit normalization was performed only for the current/previous token, but not for things like `look_ahead`.
As a result, most of token classification methods in `token.rs` already take `NtIdent` into account (this PR fixes a few pre-existing minor mistakes though).

The next step is removing `normalized(_prev)_token` entirely and replacing it with `token.ident()` (mostly) and `token.normalize()` (occasionally).
I want to make it a separate PR for that and run it though perf.
`normalized_token` filled on every bump has both a potential to avoid repeated normalization, and to do unnecessary work in advance (it probably doesn't matter anyway, the normalization is very cheap).

r? @Centril
typeck: use `Pattern` obligation cause more for better diagnostics

r? @estebank
…c-morse

use char instead of &str for single char patterns
error_derive_forbidden_on_non_adt: be more graceful

Fixes rust-lang#69341 which was injected by rust-lang#67052.

r? @petrochenkov
late resolve, visit_fn: bail early if there's no body.

Fixes rust-lang#69401 which was injected by rust-lang@b2c6eeb in rust-lang#68788.

r? @petrochenkov
…lacrum

remove redundant clones, references to operands, explicit boolean comparisons and filter(x).next() calls.
@Centril
Copy link
Contributor Author

Centril commented Feb 28, 2020

@bors r+ p=10 rollup=never

@bors
Copy link
Contributor

bors commented Feb 28, 2020

📌 Commit 13e4c6c has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 28, 2020
@Centril Centril added the rollup A PR which is a rollup label Feb 28, 2020
@bors
Copy link
Contributor

bors commented Feb 28, 2020

⌛ Testing commit 13e4c6c with merge 0eb878d...

@bors
Copy link
Contributor

bors commented Feb 28, 2020

☀️ Test successful - checks-azure
Approved by: Centril
Pushing 0eb878d to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants