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

Const prop should finish propagation into user defined variables #67130

Merged
merged 1 commit into from
Dec 21, 2019

Conversation

wesleywiser
Copy link
Member

@wesleywiser wesleywiser commented Dec 7, 2019

Fixes #66638

Temporarily rebased on top of #67015 to get those fixes.

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 7, 2019
@wesleywiser

This comment has been minimized.

@bors

This comment has been minimized.

@bors

This comment has been minimized.

@wesleywiser

This comment has been minimized.

@rust-timer

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@Centril

This comment has been minimized.

@bors

This comment has been minimized.

bors added a commit that referenced this pull request Dec 7, 2019
Const prop should finish propagation into user defined variables

Fixes #66638

Temporarily rebased on top of #67015 to get those fixes.

r? @oli-obk
@rust-highfive

This comment has been minimized.

@bors

This comment has been minimized.

@rust-timer

This comment has been minimized.

@wesleywiser

This comment has been minimized.

@rust-timer

This comment has been minimized.

@kennytm

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Queued 556f29a with parent 5c5c8eb, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit 556f29a, comparison URL.

@wesleywiser wesleywiser force-pushed the const_prop_into_locals branch 2 times, most recently from 66353c5 to 4db6649 Compare December 11, 2019 13:48
@wesleywiser
Copy link
Member Author

Fixed failing unit test and rebased.

@oli-obk
Copy link
Contributor

oli-obk commented Dec 11, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Dec 11, 2019

📌 Commit 4db66491cc4d842cf2d819d83b48b1b50deed61d has been approved by oli-obk

@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 Dec 11, 2019
@bors
Copy link
Contributor

bors commented Dec 12, 2019

⌛ Testing commit 4db66491cc4d842cf2d819d83b48b1b50deed61d with merge 098e20383a1c5580a5115351573566102b79782f...

@bors
Copy link
Contributor

bors commented Dec 13, 2019

📌 Commit 0745b8c has been approved by oli-obk

Centril added a commit to Centril/rust that referenced this pull request Dec 13, 2019
… r=oli-obk

Const prop should finish propagation into user defined variables

Fixes rust-lang#66638

~~Temporarily rebased on top of rust-lang#67015 to get those fixes.~~

r? @oli-obk
@bors
Copy link
Contributor

bors commented Dec 14, 2019

⌛ Testing commit 0745b8c with merge 17881ecd4e4476dad7f51abf09c7b502def788b8...

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-tools of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-12-14T09:33:21.4862076Z {"message":"slicing may panic.","code":{"code":"clippy::indexing_slicing","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/indexing_slicing.rs","byte_start":445,"byte_end":455,"line_start":15,"line_end":15,"column_start":6,"column_end":16,"is_primary":true,"text":[{"text":"    &x[..index];","highlight_start":6,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"Consider using `.get(..n)`or `.get_mut(..n)` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: slicing may panic.\n  --> tests/ui/indexing_slicing.rs:15:6\n   |\nLL |     &x[..index];\n   |      ^^^^^^^^^^\n   |\n   = help: Consider using `.get(..n)`or `.get_mut(..n)` instead\n\n"}
2019-12-14T09:33:21.4863800Z {"message":"slicing may panic.","code":{"code":"clippy::indexing_slicing","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/indexing_slicing.rs","byte_start":462,"byte_end":485,"line_start":16,"line_end":16,"column_start":6,"column_end":29,"is_primary":true,"text":[{"text":"    &x[index_from..index_to];","highlight_start":6,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"Consider using `.get(n..m)` or `.get_mut(n..m)` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: slicing may panic.\n  --> tests/ui/indexing_slicing.rs:16:6\n   |\nLL |     &x[index_from..index_to];\n   |      ^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead\n\n"}
2019-12-14T09:33:21.4865426Z {"message":"slicing may panic.","code":{"code":"clippy::indexing_slicing","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/indexing_slicing.rs","byte_start":492,"byte_end":519,"line_start":17,"line_end":17,"column_start":6,"column_end":33,"is_primary":true,"text":[{"text":"    &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].","highlight_start":6,"highlight_end":33}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"Consider using `.get(..n)`or `.get_mut(..n)` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: slicing may panic.\n  --> tests/ui/indexing_slicing.rs:17:6\n   |\nLL |     &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].\n   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: Consider using `.get(..n)`or `.get_mut(..n)` instead\n\n"}
2019-12-14T09:33:21.4867716Z {"message":"slicing may panic.","code":{"code":"clippy::indexing_slicing","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/indexing_slicing.rs","byte_start":492,"byte_end":507,"line_start":17,"line_end":17,"column_start":6,"column_end":21,"is_primary":true,"text":[{"text":"    &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].","highlight_start":6,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"Consider using `.get(n..)` or .get_mut(n..)` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: slicing may panic.\n  --> tests/ui/indexing_slicing.rs:17:6\n   |\nLL |     &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].\n   |      ^^^^^^^^^^^^^^^\n   |\n   = help: Consider using `.get(n..)` or .get_mut(n..)` instead\n\n"}
2019-12-14T09:33:21.4869651Z {"message":"slicing may panic.","code":{"code":"clippy::indexing_slicing","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/indexing_slicing.rs","byte_start":767,"byte_end":779,"line_start":20,"line_end":20,"column_start":6,"column_end":18,"is_primary":true,"text":[{"text":"    &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].","highlight_start":6,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"Consider using `.get(..n)`or `.get_mut(..n)` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: slicing may panic.\n  --> tests/ui/indexing_slicing.rs:20:6\n   |\nLL |     &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].\n   |      ^^^^^^^^^^^^\n   |\n   = help: Consider using `.get(..n)`or `.get_mut(..n)` instead\n\n"}
2019-12-14T09:33:21.4871491Z {"message":"range is out of bounds","code":{"code":"clippy::out_of_bounds_indexing","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/indexing_slicing.rs","byte_start":769,"byte_end":770,"line_start":20,"line_end":20,"column_start":8,"column_end":9,"is_primary":true,"text":[{"text":"    &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].","highlight_start":8,"highlight_end":9}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`-D clippy::out-of-bounds-indexing` implied by `-D warnings`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error: range is out of bounds\n  --> tests/ui/indexing_slicing.rs:20:8\n   |\nLL |     &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].\n   |        ^\n   |\n   = note: `-D clippy::out-of-bounds-indexing` implied by `-D warnings`\n\n"}
2019-12-14T09:33:21.4874358Z {"message":"slicing may panic.","code":{"code":"clippy::indexing_slicing","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/indexing_slicing.rs","byte_start":885,"byte_end":896,"line_start":22,"line_end":22,"column_start":6,"column_end":17,"is_primary":true,"text":[{"text":"    &x[1..][..5];","highlight_start":6,"highlight_end":17}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"Consider using `.get(..n)`or `.get_mut(..n)` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: slicing may panic.\n  --> tests/ui/indexing_slicing.rs:22:6\n   |\nLL |     &x[1..][..5];\n   |      ^^^^^^^^^^^\n   |\n   = help: Consider using `.get(..n)`or `.get_mut(..n)` instead\n\n"}
2019-12-14T09:33:21.4875766Z {"message":"indexing may panic.","code":{"code":"clippy::indexing_slicing","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/indexing_slicing.rs","byte_start":1112,"byte_end":1116,"line_start":30,"line_end":30,"column_start":5,"column_end":9,"is_primary":true,"text":[{"text":"    y[0];","highlight_start":5,"highlight_end":9}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"Consider using `.get(n)` or `.get_mut(n)` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: indexing may panic.\n  --> tests/ui/indexing_slicing.rs:30:5\n   |\nLL |     y[0];\n   |     ^^^^\n   |\n   = help: Consider using `.get(n)` or `.get_mut(n)` instead\n\n"}
2019-12-14T09:33:21.4878159Z {"message":"slicing may panic.","code":{"code":"clippy::indexing_slicing","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/indexing_slicing.rs","byte_start":1123,"byte_end":1130,"line_start":31,"line_end":31,"column_start":6,"column_end":13,"is_primary":true,"text":[{"text":"    &y[1..2];","highlight_start":6,"highlight_end":13}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"Consider using `.get(n..m)` or `.get_mut(n..m)` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: slicing may panic.\n  --> tests/ui/indexing_slicing.rs:31:6\n   |\nLL |     &y[1..2];\n   |      ^^^^^^^\n   |\n   = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead\n\n"}
2019-12-14T09:33:21.4879839Z {"message":"slicing may panic.","code":{"code":"clippy::indexing_slicing","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/indexing_slicing.rs","byte_start":1137,"byte_end":1145,"line_start":32,"line_end":32,"column_start":6,"column_end":14,"is_primary":true,"text":[{"text":"    &y[0..=4];","highlight_start":6,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"Consider using `.get(n..m)` or `.get_mut(n..m)` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: slicing may panic.\n  --> tests/ui/indexing_slicing.rs:32:6\n   |\nLL |     &y[0..=4];\n   |      ^^^^^^^^\n   |\n   = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead\n\n"}
---
2019-12-14T10:16:01.1249387Z Verifying status of clippy-driver...
2019-12-14T10:16:01.1249464Z Verifying status of miri...
2019-12-14T10:16:01.1249762Z Verifying status of embedded-book...
2019-12-14T10:16:01.1250022Z Verifying status of rustc-guide...
2019-12-14T10:16:01.1250331Z error: Tool `clippy-driver` should be test-pass but is test-fail during beta week.
2019-12-14T10:16:01.1250771Z Build completed unsuccessfully in 0:00:01
2019-12-14T10:16:01.1335734Z == clock drift check ==
2019-12-14T10:16:01.1351479Z   local time: Sat Dec 14 10:16:01 UTC 2019
2019-12-14T10:16:01.4159517Z   network time: Sat, 14 Dec 2019 10:16:01 GMT
2019-12-14T10:16:01.4159517Z   network time: Sat, 14 Dec 2019 10:16:01 GMT
2019-12-14T10:16:01.4160286Z == end clock drift check ==
2019-12-14T10:16:01.9700094Z 
2019-12-14T10:16:01.9804201Z ##[error]Bash exited with code '1'.
2019-12-14T10:16:01.9849683Z ##[section]Starting: Checkout
2019-12-14T10:16:01.9865293Z ==============================================================================
2019-12-14T10:16:01.9865398Z Task         : Get sources
2019-12-14T10:16:01.9865499Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Dec 14, 2019

💔 Test failed - checks-azure

@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 Dec 14, 2019
@oli-obk
Copy link
Contributor

oli-obk commented Dec 14, 2019

oh no 🙈 this PR changes diagnostics in clippy. I guess lets keep it on hold until after the beta cutoff

@Centril Centril added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 15, 2019
@wesleywiser
Copy link
Member Author

I guess this is ready to go?

@oli-obk
Copy link
Contributor

oli-obk commented Dec 19, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Dec 19, 2019

💡 This pull request was already approved, no need to approve it again.

  • This pull request previously failed. You should add more commits to fix the bug, or use retry to trigger a build again.
  • There's another pull request that is currently being tested, blocking this pull request: Rollup of 3 pull requests #67435

@bors
Copy link
Contributor

bors commented Dec 19, 2019

📌 Commit 0745b8c has been approved by oli-obk

@bors
Copy link
Contributor

bors commented Dec 19, 2019

🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened

@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-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Dec 19, 2019
Centril added a commit to Centril/rust that referenced this pull request Dec 20, 2019
… r=oli-obk

Const prop should finish propagation into user defined variables

Fixes rust-lang#66638

~~Temporarily rebased on top of rust-lang#67015 to get those fixes.~~

r? @oli-obk
bors added a commit that referenced this pull request Dec 21, 2019
Rollup of 6 pull requests

Successful merges:

 - #67130 (Const prop should finish propagation into user defined variables)
 - #67163 (Split up ptr/mod.rs in libcore...)
 - #67314 (Don't suppress move errors for union fields)
 - #67392 (Fix unresolved type span inside async object)
 - #67404 (Separate region inference logic from error handling better)
 - #67428 (`is_binding_pat`: use explicit match & include or-pats in grammar)

Failed merges:

r? @ghost
@bors bors merged commit 0745b8c into rust-lang:master Dec 21, 2019
matthiaskrgr added a commit to matthiaskrgr/rust-clippy that referenced this pull request Dec 21, 2019
bors added a commit to rust-lang/rust-clippy that referenced this pull request Dec 21, 2019
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 21, 2019
Changes:
````
rustup "Merge `ast::Mutability` and `mir::Mutability`"
rustup rust-lang#67130
rustup rust-lang#67455
There are no per-file copyright headers anymore
Update lints for `iterator_step_by_zero` changes
Fix 'redudant' spelling in redundant_clone docs
Fix documentation example for unnecessary_filter_map.
Fix `expect_fun_call` false negative on references
Fix `iterator_step_by_zero` description in declaration
Fix `iterator_step_by_zero` definition
Correct `iterator_step_by_zero` documentation
Update iterator_step_by_zero
Prevent `cmp_nan` when inside constants
Detect comparisons with NAN constants
Fix clippy build failure
````
bors added a commit that referenced this pull request Dec 22, 2019
submodules: update clippy from 69f99e7 to acbc609

Changes:
````
rustup "Merge `ast::Mutability` and `mir::Mutability`"
rustup #67130
rustup #67455
Update lints for `iterator_step_by_zero` changes
Fix 'redudant' spelling in redundant_clone docs
Fix documentation example for unnecessary_filter_map.
Fix `expect_fun_call` false negative on references
Fix `iterator_step_by_zero` description in declaration
Fix `iterator_step_by_zero` definition
Correct `iterator_step_by_zero` documentation
Update iterator_step_by_zero
Prevent `cmp_nan` when inside constants
Detect comparisons with NAN constants
Fix clippy build failure
````

r? @oli-obk  @Manishearth
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 5, 2020
Changes:
````
rustup "Merge `ast::Mutability` and `mir::Mutability`"
rustup rust-lang/rust#67130
rustup rust-lang/rust#67455
There are no per-file copyright headers anymore
Update lints for `iterator_step_by_zero` changes
Fix 'redudant' spelling in redundant_clone docs
Fix documentation example for unnecessary_filter_map.
Fix `expect_fun_call` false negative on references
Fix `iterator_step_by_zero` description in declaration
Fix `iterator_step_by_zero` definition
Correct `iterator_step_by_zero` documentation
Update iterator_step_by_zero
Prevent `cmp_nan` when inside constants
Detect comparisons with NAN constants
Fix clippy build failure
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Const Prop does not finish propagation into user defined variables
7 participants