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

user annotations in patterns #54757

Merged
merged 6 commits into from
Oct 9, 2018

Conversation

nikomatsakis
Copy link
Contributor

Fixes #54573

r? @pnkfelix

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 2, 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.
[00:23:42]    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
[00:23:46]    Compiling rustc_errors v0.0.0 (/checkout/src/librustc_errors)
[00:25:16]    Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
[00:25:25]    Compiling syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
[00:27:09] error: internal compiler error: librustc_mir/borrow_check/nll/universal_regions.rs:754: cannot convert `ReScope(Remainder { block: ItemLocalId(1359), first_statement_index: 0})` to a region vid
[00:27:09] thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:599:9
[00:27:09] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:27:10] error: aborting due to previous error
[00:27:10] 
[00:27:10] 
[00:27:10] 
[00:27:10] note: the compiler unexpectedly panicked. this is a bug.
[00:27:10] 
[00:27:10] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[00:27:10] 
[00:27:10] note: rustc 1.31.0-dev running on x86_64-unknown-linux-gnu
[00:27:10] 
[00:27:10] note: compiler flags: -Z force-unstable-if-unmarked -C prefer-dynamic -C opt-level=2 -C prefer-dynamic -C debug-assertions=y -C link-args=-Wl,-rpath,$ORIGIN/../lib --crate-type dylib
[00:27:10] note: some of the compiler flags provided by cargo are hidden
[00:27:10] 
[00:27:10] error: Could not compile `rustc`.
[00:27:10] 
[00:27:10] 
[00:27:10] To learn more, run the command again with --verbose.
[00:27:10] 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" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:27:10] expected success, got: exit code: 101
[00:27:10] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1112:9
[00:27:10] travis_fold:end:stage1-rustc

[00:27:10] travis_time:end:stage1-rustc:start=1538501328026176391,finish=1538501597202990906,duration=269176814515

---
travis_time:end:2bef507a:start=1538501597933763060,finish=1538501597938549283,duration=4786223
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1b4dd171
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true

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)

@nikomatsakis
Copy link
Contributor Author

oh dear, I didn't see that ICE locally for some reason. Probably --keep-stage 1 =)

@memoryruins memoryruins added the A-NLL Area: Non-lexical lifetimes (NLL) label Oct 6, 2018
@pnkfelix
Copy link
Member

pnkfelix commented Oct 8, 2018

@nikomatsakis do you think you're going to have time to address this soon? Or do you want me to attempt to fix the ICE as part of my review?

@pnkfelix
Copy link
Member

pnkfelix commented Oct 8, 2018

(also, I am going to retag this as waiting-on-author so @nikomatsakis knows he needs to respond to my Q and/or fix the ICE...)

@pnkfelix pnkfelix 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 Oct 8, 2018
@nikomatsakis
Copy link
Contributor Author

OK, I spent all day debugging this ICE (and more of Friday than I care to admit), but I finally found it. In fact, @pnkfelix, the problem is not specific to this PR, and may well be affecting you in other PRs.

@nikomatsakis
Copy link
Contributor Author

If I am correct — and I'm 99% sure — I'll push a fix soon. The debugging was seriously hampered by my seeming inability to reproduce the ICE outside of a x.py build run. Now that I know the problem, maybe I can come up with a more local reproduction ...

@nikomatsakis
Copy link
Contributor Author

For those of you following along, the bug was in this code from the region renumberer:

fn visit_ascribe_user_ty(
&mut self,
_place: &mut Place<'tcx>,
_variance: &mut ty::Variance,
_c_ty: &mut CanonicalTy<'tcx>,
_location: Location,
) {
// User-assert-ty statements represent types that the user added explicitly.
// We don't want to erase the regions from these types: rather, we want to
// add them as constraints at type-check time.
debug!("visit_user_assert_ty: skipping renumber");
}

In particular, we still need to be visiting the Place, which may have embedded regions. I'm not sure I've so far failed to reproduce this though.

@nikomatsakis nikomatsakis force-pushed the nll-issue-54573-user-annot branch from 4d361a6 to 5e477e5 Compare October 8, 2018 23:20
@nikomatsakis nikomatsakis force-pushed the nll-issue-54573-user-annot branch from 5e477e5 to ccba716 Compare October 8, 2018 23:21
@nikomatsakis
Copy link
Contributor Author

Pushed what I hope to be a fix (travis will tell =) — I was not able to make a smaller example that reproduced the problem though.

@pnkfelix
Copy link
Member

pnkfelix commented Oct 9, 2018

@bors r+ p=1

bumping priority slightly because I believe this ICE is impeding ongoing work in others' development branches

@bors
Copy link
Contributor

bors commented Oct 9, 2018

📌 Commit ccba716 has been approved by pnkfelix

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 9, 2018
@bors
Copy link
Contributor

bors commented Oct 9, 2018

⌛ Testing commit ccba716 with merge e1643a8...

bors added a commit that referenced this pull request Oct 9, 2018
@bors
Copy link
Contributor

bors commented Oct 9, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: pnkfelix
Pushing e1643a8 to master...

@bors bors merged commit ccba716 into rust-lang:master Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-NLL Area: Non-lexical lifetimes (NLL) 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