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

Local is copy #68512

Merged
merged 9 commits into from
Jan 29, 2020
Merged

Local is copy #68512

merged 9 commits into from
Jan 29, 2020

Conversation

spastorino
Copy link
Member

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 24, 2020
@@ -174,7 +174,7 @@ impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
// We use `NonUseContext::VarDebugInfo` for the base,
// which might not force the base local to memory,
// so we have to do it manually.
self.visit_local(place_ref.local, context, location);
self.visit_local(&place_ref.local, context, location);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also take a Local instead of &Local but I'd leave that for a deeper change related to visitors.

@@ -1773,7 +1773,7 @@ rustc_index::newtype_index! {

#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PlaceRef<'a, 'tcx> {
pub local: &'a Local,
pub local: Local,
pub projection: &'a [PlaceElem<'tcx>],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orthogonal, but the 'a here could be 'tcx, right?

Copy link
Member Author

@spastorino spastorino Jan 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure, I just did it to try out and I'm getting ...

error[E0597]: `deref` does not live long enough
    --> src/librustc_mir/borrow_check/mod.rs:1400:41
     |
855  |   impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
     |             ---- lifetime `'tcx` defined here
...
1400 |                   root_place.projection = &deref;
     |                                           ^^^^^^ borrowed value does not live long enough
...
1413 |           if places_conflict::borrow_conflicts_with_place(
     |  ____________-
1414 | |             self.infcx.tcx,
1415 | |             &self.body,
1416 | |             place,
...    |
1420 | |             places_conflict::PlaceConflictBias::Overlap,
1421 | |         ) {
     | |_________- argument requires that `deref` is borrowed for `'tcx`
...
1433 |       }
     |       - `deref` dropped here while still borrowed

error[E0621]: explicit lifetime required in the type of `issued_borrow`
   --> src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs:547:9
    |
344 |         issued_borrow: &BorrowData<'tcx>,
    |                        ----------------- help: add explicit lifetime `'cx` to the type of `issued_borrow`: `&'cx borrow_check::borrow_set::BorrowData<'tcx>`
...
547 |         err
    |         ^^^ lifetime `'cx` required

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0597, E0621.
For more information about an error, try `rustc --explain E0597`.
error: could not compile `rustc_mir`.

To learn more, run the command again with --verbose.

Didn't pay a lot of attention to be honest, should I fix this in this PR or investigate this on a different one?.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no let's do it in another PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should start by replacing PlaceRef<'_, 'tcx> with PlaceRef<'tcx, 'tcx> and see where that breaks down (most things should be able to handle it, although... unsure how useful it is?).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was addressed here #69714

src/librustc/mir/mod.rs Outdated Show resolved Hide resolved
@oli-obk
Copy link
Contributor

oli-obk commented Jan 24, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Jan 24, 2020

📌 Commit 3859a47 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 Jan 24, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jan 25, 2020
@bors
Copy link
Contributor

bors commented Jan 25, 2020

⌛ Testing commit 3859a47 with merge 5a876001662d48c423f261d4dd619a551d48ec0a...

@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.
2020-01-25T13:12:53.7698407Z Verifying status of clippy-driver...
2020-01-25T13:12:53.7700211Z Verifying status of miri...
2020-01-25T13:12:53.7700951Z Verifying status of embedded-book...
2020-01-25T13:12:53.7701513Z Verifying status of rustc-guide...
2020-01-25T13:12:53.7701984Z error: Tool `clippy-driver` should be test-pass but is build-fail during beta week.
2020-01-25T13:12:53.7708687Z Build completed unsuccessfully in 0:00:01
2020-01-25T13:12:53.7750977Z == clock drift check ==
2020-01-25T13:12:53.7766093Z   local time: Sat Jan 25 13:12:53 UTC 2020
2020-01-25T13:12:53.9206628Z   network time: Sat, 25 Jan 2020 13:12:53 GMT
2020-01-25T13:12:53.9206628Z   network time: Sat, 25 Jan 2020 13:12:53 GMT
2020-01-25T13:12:53.9210298Z == end clock drift check ==
2020-01-25T13:12:54.4423465Z 
2020-01-25T13:12:54.4513725Z ##[error]Bash exited with code '1'.
2020-01-25T13:12:54.4550866Z ##[section]Starting: Checkout rust-lang/rust@auto to s
2020-01-25T13:12:54.4553197Z ==============================================================================
2020-01-25T13:12:54.4553295Z Task         : Get sources
2020-01-25T13:12:54.4553364Z 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 Jan 25, 2020

💔 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 Jan 25, 2020
@oli-obk
Copy link
Contributor

oli-obk commented Jan 25, 2020

Oh heh, yea this would break clippy. Let's hold up on it until the breakage week is done

@rust-highfive
Copy link
Collaborator

The job mingw-check 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.
2020-01-28T13:16:16.9164021Z ========================== Starting Command Output ===========================
2020-01-28T13:16:16.9166334Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/952ef9e6-9add-4dc7-8d23-23d135b160db.sh
2020-01-28T13:16:16.9166488Z 
2020-01-28T13:16:16.9170234Z ##[section]Finishing: Disable git automatic line ending conversion
2020-01-28T13:16:16.9176249Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68512/merge to s
2020-01-28T13:16:16.9178670Z Task         : Get sources
2020-01-28T13:16:16.9178709Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-28T13:16:16.9178788Z Version      : 1.0.0
2020-01-28T13:16:16.9178827Z Author       : Microsoft
---
2020-01-28T13:16:17.7674119Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-28T13:16:17.7778954Z ##[command]git config gc.auto 0
2020-01-28T13:16:17.7859303Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-28T13:16:17.7935483Z ##[command]git config --get-all http.proxy
2020-01-28T13:16:17.8085998Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/68512/merge:refs/remotes/pull/68512/merge
---
2020-01-28T13:24:58.1565412Z     Checking rustc_mir v0.0.0 (/checkout/src/librustc_mir)
2020-01-28T13:24:58.6649485Z error[E0614]: type `rustc::mir::Local` cannot be dereferenced
2020-01-28T13:24:58.6649867Z     --> src/librustc_mir_build/build/matches/mod.rs:1261:28
2020-01-28T13:24:58.6650151Z      |
2020-01-28T13:24:58.6651023Z 1261 |                     local: *matched_place_ref.local,
2020-01-28T13:24:58.6658020Z 
2020-01-28T13:24:59.4380471Z error: aborting due to previous error
2020-01-28T13:24:59.4382139Z 
2020-01-28T13:24:59.4386233Z For more information about this error, try `rustc --explain E0614`.
2020-01-28T13:24:59.4386233Z For more information about this error, try `rustc --explain E0614`.
2020-01-28T13:24:59.4442302Z error: could not compile `rustc_mir_build`.
2020-01-28T13:24:59.4442667Z warning: build failed, waiting for other jobs to finish...
2020-01-28T13:25:00.9442849Z error[E0614]: type `rustc::mir::Local` cannot be dereferenced
2020-01-28T13:25:00.9444077Z    --> src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs:702:28
2020-01-28T13:25:00.9444662Z     |
2020-01-28T13:25:00.9445334Z 702 |             Place { local: *root_place.local, projection: root_place_projection },
2020-01-28T13:25:00.9446497Z 
2020-01-28T13:25:00.9454943Z error[E0614]: type `rustc::mir::Local` cannot be dereferenced
2020-01-28T13:25:00.9455650Z    --> src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs:713:28
2020-01-28T13:25:00.9456194Z     |
2020-01-28T13:25:00.9456194Z     |
2020-01-28T13:25:00.9456837Z 713 |             Place { local: *root_place.local, projection: root_place_projection },
2020-01-28T13:25:00.9457899Z 
2020-01-28T13:25:09.8487900Z error: aborting due to 2 previous errors
2020-01-28T13:25:09.8488607Z 
2020-01-28T13:25:09.8489160Z For more information about this error, try `rustc --explain E0614`.
2020-01-28T13:25:09.8489160Z For more information about this error, try `rustc --explain E0614`.
2020-01-28T13:25:09.8703771Z error: could not compile `rustc_mir`.
2020-01-28T13:25:09.8704497Z 
2020-01-28T13:25:09.8704959Z To learn more, run the command again with --verbose.
2020-01-28T13:25:09.8741551Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "-Zconfig-profile" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--color" "always" "--features" " llvm" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
2020-01-28T13:25:09.8752773Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
2020-01-28T13:25:09.8753025Z Build completed unsuccessfully in 0:05:32
2020-01-28T13:25:09.8813839Z == clock drift check ==
2020-01-28T13:25:09.8823627Z   local time: Tue Jan 28 13:25:09 UTC 2020
2020-01-28T13:25:09.8823627Z   local time: Tue Jan 28 13:25:09 UTC 2020
2020-01-28T13:25:09.9394879Z   network time: Tue, 28 Jan 2020 13:25:09 GMT
2020-01-28T13:25:09.9399757Z == end clock drift check ==
2020-01-28T13:25:10.3082824Z 
2020-01-28T13:25:10.3178682Z ##[error]Bash exited with code '1'.
2020-01-28T13:25:10.3191089Z ##[section]Finishing: Run build
2020-01-28T13:25:10.3231371Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68512/merge to s
2020-01-28T13:25:10.3233164Z Task         : Get sources
2020-01-28T13:25:10.3233232Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-28T13:25:10.3233303Z Version      : 1.0.0
2020-01-28T13:25:10.3233350Z Author       : Microsoft
2020-01-28T13:25:10.3233350Z Author       : Microsoft
2020-01-28T13:25:10.3233417Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-01-28T13:25:10.3233474Z ==============================================================================
2020-01-28T13:25:10.7479641Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-01-28T13:25:10.7518870Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68512/merge to s
2020-01-28T13:25:10.7631691Z Cleaning up task key
2020-01-28T13:25:10.7632489Z Start cleaning up orphan processes.
2020-01-28T13:25:10.7739086Z Terminate orphan process: pid (3648) (python)
2020-01-28T13:25:10.7927865Z ##[section]Finishing: Finalize Job

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)

@oli-obk
Copy link
Contributor

oli-obk commented Jan 28, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Jan 28, 2020

📌 Commit 3021856 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 Jan 28, 2020
@bors
Copy link
Contributor

bors commented Jan 29, 2020

⌛ Testing commit 3021856 with merge 343432a...

bors added a commit that referenced this pull request Jan 29, 2020
@bors
Copy link
Contributor

bors commented Jan 29, 2020

☀️ Test successful - checks-azure
Approved by: oli-obk
Pushing 343432a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 29, 2020
@bors bors merged commit 3021856 into rust-lang:master Jan 29, 2020
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #68512!

Tested on commit 343432a.
Direct link to PR: #68512

💔 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).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Jan 29, 2020
Tested on commit rust-lang/rust@343432a.
Direct link to PR: <rust-lang/rust#68512>

💔 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).
JohnTitor added a commit to JohnTitor/rust-clippy that referenced this pull request Jan 29, 2020
bors added a commit to rust-lang/rust-clippy that referenced this pull request Jan 29, 2020
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. 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.

5 participants