-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Rustup to rustc 1.41.0-nightly (35ef33a8 2019-11-21) #4825
Merged
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
aa5a95f
Rustup to rustc 1.41.0-nightly (a0d40f8bd 2019-11-18)
Manishearth d183bda
Rustup to rustc 1.41.0-nightly (d1da8023d 2019-11-19)
Manishearth 3c308b8
Remove never_type feature
flip1995 e4636f3
Rustup to rust-lang/rust#66515
flip1995 cadc35a
Rustup to rust-lang/rust#66389
flip1995 e3a74ed
Set mir_opt_level=0
flip1995 7bae5bd
Add comment for mir_opt_level=0
flip1995 fb18354
Temporarily disable serde integration test
flip1995 553db87
Disable chalk integration test. Output too large
flip1995 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// run-rustfix | ||
// rustfix-only-machine-applicable | ||
|
||
use std::ffi::OsString; | ||
use std::path::Path; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// run-rustfix | ||
// rustfix-only-machine-applicable | ||
|
||
use std::ffi::OsString; | ||
use std::path::Path; | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be linted still. Adding
const
to this function gives the error described in the comment. But for some reasonrustc_mir::transform::qualify_min_const_fn::is_min_const_fn
returnsOk(())
for this function:rust-clippy/clippy_lints/src/missing_const_for_fn.rs
Lines 108 to 110 in b4f1769
cc @oli-obk Does
optimized_mir
replace the static with a const value andis_min_const_fn
then thinks this could be a const fn?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did something change in the handling of
Statement
s in MIR recently? The error inredundant_clone
is similar. This coderust-clippy/clippy_lints/src/redundant_clone.rs
Lines 374 to 383 in b4f1769
stopped detecting, that in
(a.clone(), a)
botha
s are the same.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean with
is, that in both cases the code that should check for them is never actually reached by the traversal of the
Statement
(or theTerminator
?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh... we run is_min_const_fn on the optimized mir while rustc runs it on
mir_const
. This will keep causing problems. One thing clippy could do is to make theoptimized_mir
query not do any optimizations. This is possible since rust-lang/rust#66297This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So how do I override the
optimized_mir
query? When I just copy and paste its source code [1] from rustc and remove therun_optimization_passes
call¹, a lot of tests began to ICE. I added this:to
rust-clippy/src/driver.rs
Lines 63 to 64 in b4f1769
¹ I also removed this:
because the
shim
module is private.[1] https://github.com/rust-lang/rust/blob/9d6ff1553b7debbe5c99c102ce0978b6130592f8/src/librustc_mir/transform/mod.rs#L316-L333
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. So we'd need to make more things public. But that's probably not the failure reason. One thing you can try is set the mir opt level to 0 instead of trying to replace the query. If that doesn't work, reintroduce the mir optimizations but remove all the ones that break clippy (e.g. const_prop)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do I set the opt level? And how can I enable/disable mir passes?