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 12 pull requests #65733

Merged
merged 60 commits into from
Oct 24, 2019
Merged

Rollup of 12 pull requests #65733

merged 60 commits into from
Oct 24, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Oct 23, 2019

Successful merges:

Failed merges:

r? @ghost

Mark-Simulacrum and others added 30 commits October 17, 2019 19:16
Replace early_error and sess.err with bug!, in all cases. If the
compiler we're running with, including plugins, is registering something
twice, that's a (compiler/plugin) programmer error -- we should not try
to be nice at the cost of developer ergononomics (hiding the stacktrace
of the second registration is bad).

This also is basically a static bug in ~all cases so it should not be a
detriment to users, including with plugins.
This is straight up removing dead code, but is a separate commit from
the previous to avoid conflating clean up and important changes.
This extracts the call to get_lints() to callers.
This is in preparation for on-demand constructing passes
This moves from calling get_lints on instantiated pass objects to the
raw object
This stops storing the pass objects and instead stores constructor
functions.

The primary effect is that LintStore no longer has any interior
mutability.
Moves this information to a direct field of Lint, which is where it
belongs.
Avoid querying LintStore when not necessary
Access through tcx is fine -- by that point, the lint store is frozen,
but direct access through Session will go away in future commits, as
lint store is still mutable in early stages of Session, and will be
removed completely.
Remove lint store from Session
Move to using Box<dyn Fn() -> ...> so that we can let plugins register
state.

This also adds a callback that'll get called from plugin registration so
that Clippy and other tools can register lints without using the plugin
API. The plugin API still works, but this new API is more compatible
with drivers other than rustc.
`TokenStream` used to be a complex type, but it is now just a newtype
around a `Lrc<Vec<TreeAndJoint>>`. Currently it uses custom encoding
that discards the `IsJoint` and custom decoding that adds `NonJoint`
back in for every token tree. This requires building intermediate
`Vec<TokenTree>`s.

This commit makes `TokenStream` derive `Rustc{En,De}codable`. This
simplifies the code, and avoids the creation of the intermediate
vectors, saving up to 3% on various benchmarks. It also changes the AST
JSON output in one test.
This avoids the needs for various conversions, and makes the code
slightly faster, because `Symbol` comparisons and hashing is faster.
Its fourth argument is always `Some(pred)`, so the pattern matching is
unnecessary. This commit inlines and removes it.
It's a full conversion, except in `DefKey::compute_stable_hash()` where
a `Symbol` now is converted to an `InternedString` before being hashed.
This was necessary to avoid test failures.
This requires changing the `PartialOrd`/`Ord` implementations to look at
the chars rather than the symbol index.
This is a straightforward replacement except for two places where we
have to convert to `LocalInternedString` to get a stable sort.
By using `LocalInternedString` instead for the few remaining uses.
@bors
Copy link
Contributor

bors commented Oct 23, 2019

📌 Commit 3cd7a17 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 Oct 23, 2019
@bors
Copy link
Contributor

bors commented Oct 23, 2019

⌛ Testing commit 3cd7a17 with merge d147d5bcfd103390610408db021e299c5326672b...

@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
@bors
Copy link
Contributor

bors commented Oct 24, 2019

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 24, 2019
@Centril
Copy link
Contributor Author

Centril commented Oct 24, 2019

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 24, 2019
@bors
Copy link
Contributor

bors commented Oct 24, 2019

⌛ Testing commit 3cd7a17 with merge 55e0063...

bors added a commit that referenced this pull request Oct 24, 2019
Rollup of 12 pull requests

Successful merges:

 - #64178 (More Clippy fixes for alloc, core and std)
 - #65144 (Add Cow::is_borrowed and Cow::is_owned)
 - #65193 (Lockless LintStore)
 - #65479 (Add the `matches!( $expr, $pat ) -> bool` macro)
 - #65518 (Avoid ICE when checking `Destination` of `break` inside a closure)
 - #65583 (rustc_metadata: use a table for super_predicates, fn_sig, impl_trait_ref.)
 - #65641 (Derive `Rustc{En,De}codable` for `TokenStream`.)
 - #65648 (Eliminate `intersect_opt`.)
 - #65657 (Remove `InternedString`)
 - #65691 (Update E0659 error code long explanation to 2018 edition)
 - #65696 (Fix an issue with const inference variables sticking around under Chalk + NLL)
 - #65704 (relax ExactSizeIterator bound on write_bytes)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Oct 24, 2019

☀️ Test successful - checks-azure
Approved by: Centril
Pushing 55e0063 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 24, 2019
@bors bors merged commit 3cd7a17 into rust-lang:master Oct 24, 2019
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #65733!

Tested on commit 55e0063.
Direct link to PR: #65733

💔 clippy-driver on windows: test-pass → build-fail (cc @mcarton @oli-obk @Manishearth @flip1995 @yaahc @phansch @llogiq, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @mcarton @oli-obk @Manishearth @flip1995 @yaahc @phansch @llogiq, @rust-lang/infra).

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