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

MIR-borrowck: gather and signal any move errors #45016

Merged

Conversation

pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented Oct 4, 2017

When building up the MoveData structure for a given MIR, also accumulate any erroneous actions, and then report all of those errors when the construction is complete.

This PR adds a host of move-related error constructor methods to trait BorrowckErrors. I think I got the notes right; but we should plan to audit all of the notes before turning MIR-borrowck on by default.

Fix #44830

…d mir-borrowck.

(Had to modify signature of `report_cannot_move_out_of` slightly to
satisfy requirements of newly added `fn cannot_move_out_of` method.)
…ort them.

Currently is using DUMMY_SP as the associated span; a follow-up commit
will pass in appropriate spans when constructing the errors.
…ctor.

Implicitly threaded `Location` through MoveData construction via a
`Gatherer` struct (so that we could look up the span corresponding to
the location when we need to signal an error).
This commit tests *just* the subset of the tests that were previously
ICE'ing and where now AST- and MIR-borrowck both match in terms of the
errors they report.

In other words: there remain *other* tests that previously ICE'd, and
now no longer ICE, but their remains a divergence between the errors
reported by AST-borrowck and by MIR-borrowck.
@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 4, 2017

📌 Commit 86ca5cf has been approved by nikomatsakis

@pnkfelix pnkfelix added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 4, 2017
@bors
Copy link
Contributor

bors commented Oct 8, 2017

⌛ Testing commit 86ca5cf with merge e35c706f3c7c5cc2154d0ec56fe2863ff99205f4...

@bors
Copy link
Contributor

bors commented Oct 8, 2017

💔 Test failed - status-travis

@kennytm
Copy link
Member

kennytm commented Oct 8, 2017

@bors retry #43402 (i686-gnu-nopt)

[01:38:51] ---- [run-make] run-make/issue-26092 stdout ----
[01:38:51] 	
[01:38:51] error: make failed
[01:38:51] status: exit code: 2
[01:38:51] command: "make"
[01:38:51] stdout:
[01:38:51] ------------------------------------------
[01:38:51] make[1]: Entering directory '/checkout/src/test/run-make/issue-26092'
[01:38:51] thread 'main' panicked at 'Some tests failed', /checkout/src/tools/compiletest/src/main.rs:323:21
[01:38:51] LD_LIBRARY_PATH="/checkout/obj/build/i686-unknown-linux-gnu/test/run-make/issue-26092.stage2-i686-unknown-linux-gnu:/checkout/obj/build/i686-unknown-linux-gnu/stage2/lib:/checkout/obj/build/i686-unknown-linux-gnu/stage0-tools/i686-unknown-linux-gnu/release/deps:/checkout/obj/build/i686-unknown-linux-gnu/stage0-sysroot/lib/rustlib/i686-unknown-linux-gnu/lib:" '/checkout/obj/build/i686-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/i686-unknown-linux-gnu/test/run-make/issue-26092.stage2-i686-unknown-linux-gnu -L /checkout/obj/build/i686-unknown-linux-gnu/test/run-make/issue-26092.stage2-i686-unknown-linux-gnu  -o "" blank.rs 2>&1 | \
[01:38:51] 		grep -i 'No such file or directory'
[01:38:51] Makefile:4: recipe for target 'all' failed
[01:38:51] make[1]: Leaving directory '/checkout/src/test/run-make/issue-26092'
[01:38:51] 
[01:38:51] ------------------------------------------
[01:38:51] stderr:
[01:38:51] ------------------------------------------
[01:38:51] make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
[01:38:51] make[1]: *** [all] Error 1
[01:38:51] 
[01:38:51] ------------------------------------------
[01:38:51] 
[01:38:51] thread '[run-make] run-make/issue-26092' panicked at 'explicit panic', /checkout/src/tools/compiletest/src/runtest.rs:2433:8
[01:38:51] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:38:51] 
[01:38:51] 
[01:38:51] failures:
[01:38:51]     [run-make] run-make/issue-26092
[01:38:51] 
[01:38:51] test result: �[31mFAILED�(B�[m. 160 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

@bors
Copy link
Contributor

bors commented Oct 8, 2017

⌛ Testing commit 86ca5cf with merge 650b1b1...

bors added a commit that referenced this pull request Oct 8, 2017
…rrors, r=nikomatsakis

MIR-borrowck: gather and signal any move errors

When building up the `MoveData` structure for a given MIR, also accumulate any erroneous actions, and then report all of those errors when the construction is complete.

This PR adds a host of move-related error constructor methods to `trait BorrowckErrors`. I think I got the notes right; but we should plan to audit all of the notes before turning MIR-borrowck on by default.

Fix #44830
@bors
Copy link
Contributor

bors commented Oct 8, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 650b1b1 to master...

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.

5 participants