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

[WIP] Make 2PB reservations conflict with shared borrows #56301

Closed

Conversation

matthewjasper
Copy link
Contributor

Putting this up for discussion.

r? @nikomatsakis

Creating a mutable reference asserts uniqueness in certain potential
memory models for Rust. Make this an error for now.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 27, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (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.
travis_time:end:18769107:start=1543361681520406826,finish=1543361682652815024,duration=1132408198
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:23:33]    Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
[00:23:42]    Compiling syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
[00:30:28]    Compiling rustc_mir v0.0.0 (/checkout/src/librustc_mir)
[00:30:28]    Compiling rustc_typeck v0.0.0 (/checkout/src/librustc_typeck)
[00:31:40] error[E0502]: cannot borrow `block_data.statements` as mutable because it is also borrowed as immutable
[00:31:40]    --> src/librustc_mir/transform/add_retag.rs:185:29
[00:31:40]     |
[00:31:40] 167 |                 match block_data.statements[i].kind {
[00:31:40] ...
[00:31:40] ...
[00:31:40] 185 |                             block_data.statements.insert(i, Statement {
[00:31:40] 186 |                                 source_info,
[00:31:40] 186 |                                 source_info,
[00:31:40] 187 |                                 kind: StatementKind::EscapeToRaw(src.clone()),
[00:31:40]     |                                                                  --- immutable borrow used here, in later iteration of loop
[00:31:40] 
[00:31:40] error[E0502]: cannot borrow `block_data.statements` as mutable because it is also borrowed as immutable
[00:31:40]    --> src/librustc_mir/transform/add_retag.rs:197:25
[00:31:40]     |
[00:31:40] 167 |                 match block_data.statements[i].kind {
[00:31:40] ...
[00:31:40] ...
[00:31:40] 197 |                         block_data.statements.insert(i+1, Statement {
[00:31:40] 198 |                             source_info,
[00:31:40] 198 |                             source_info,
[00:31:40] 199 |                             kind: StatementKind::Retag { fn_entry: false, place: place.clone() },
[00:31:40]     |                                                                                  ----- immutable borrow used here, in later iteration of loop
[00:31:48] error: aborting due to 2 previous errors
[00:31:48] 
[00:31:48] For more information about this error, try `rustc --explain E0502`.
[00:31:48] error: Could not compile `rustc_mir`.
[00:31:48] error: Could not compile `rustc_mir`.
[00:31:48] warning: build failed, waiting for other jobs to finish...
[00:32:46] error: build failed
[00:32:46] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:32:46] expected success, got: exit code: 101
[00:32:46] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:32:46] Build completed unsuccessfully in 0:29:23
[00:32:46] Makefile:28: recipe for target 'all' failed
[00:32:46] make: *** [all] Error 1
35580 ./.git/modules/src/libcompiler_builtins/modules/compiler-rt/objects
35572 ./.git/modules/src/libcompiler_builtins/modules/compiler-rt/objects/pack
34948 ./src/llvm/test/tools
33444 ./obj/build/x86_64-unknown-linux-gnu/stage0-std

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)

@pnkfelix
Copy link
Member

cc #56254

@pietroalbini
Copy link
Member

@bors try

@bors
Copy link
Contributor

bors commented Nov 28, 2018

⌛ Trying commit 3908328e3066dc1fd52f3e49a2a868ff30dbf32e with merge 096db501f6baee6fe429975a0e15765891c33e70...

@bors
Copy link
Contributor

bors commented Nov 28, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 28, 2018
@matthewjasper
Copy link
Contributor Author

We're not backporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants