-
Couldn't load subscription status.
- Fork 13.9k
Try to fix 48116 and 48192 #48209
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
Try to fix 48116 and 48192 #48209
Conversation
1. When the invalid condition is hit, write out the relevant variables too 2. In compile-fail/parse-fail tests, check for ICE first, so the invalid error patterns won't mask our ICE output.
|
@bors: r+ p=100 |
|
📌 Commit 553f82d has been approved by |
|
@bors: r+ |
|
📌 Commit 71269a5 has been approved by |
|
💔 Test failed - status-travis |
Removed the `assume()` which we assumed is the cause of misoptimization in issue rust-lang#48116.
This reverts commit 64a8730.
71269a5 to
e0da990
Compare
|
@bors r=alexcrichton |
|
📌 Commit e0da990 has been approved by |
Try to fix 48116 and 48192 The bug #48116 happens because of a misoptimization of the `import_path_to_string` function, where a `names` slice is empty but the `!names.is_empty()` branch is executed. https://github.com/rust-lang/rust/blob/4d2d3fc5dadf894a8ad709a5860a549f2c0b1032/src/librustc_resolve/resolve_imports.rs#L1015-L1042 Yesterday, @eddyb had locally reproduced the bug, and [came across the `position` function](https://mozilla.logbot.info/rust-infra/20180214#c14296834) where the `assume()` call is found to be suspicious. We have *not* concluded that this `assume()` causes #48116, but given [the reputation of `assume()`](#45501 (comment)), this seems higher relevant. Here we try to see if commenting it out can fix the errors. Later @alexcrichton has bisected and found a potential bug [in the LLVM side](#48116 (comment)). We are currently testing if reverting that LLVM commit is enough to stop the bug. If true, this PR can be reverted (keep the `assume()`) and we could backport the LLVM patch instead. (This PR also includes an earlier commit from #48127 for help debugging ICE happening in compile-fail/parse-fail tests.) The PR also reverts #48059, which seems to cause #48192. r? @alexcrichton cc @eddyb, @arthurprs (#47333)
|
💔 Test failed - status-appveyor |
|
(Manually merged since everything else passed) |
The bug #48116 happens because of a misoptimization of the
import_path_to_stringfunction, where anamesslice is empty but the!names.is_empty()branch is executed.rust/src/librustc_resolve/resolve_imports.rs
Lines 1015 to 1042 in 4d2d3fc
Yesterday, @eddyb had locally reproduced the bug, and came across the
positionfunction where theassume()call is found to be suspicious. We have not concluded that thisassume()causes #48116, but given the reputation ofassume(), this seems higher relevant. Here we try to see if commenting it out can fix the errors.Later @alexcrichton has bisected and found a potential bug in the LLVM side. We are currently testing if reverting that LLVM commit is enough to stop the bug. If true, this PR can be reverted (keep the
assume()) and we could backport the LLVM patch instead.(This PR also includes an earlier commit from #48127 for help debugging ICE happening in compile-fail/parse-fail tests.)
The PR also reverts #48059, which seems to cause #48192.
r? @alexcrichton
cc @eddyb, @arthurprs (#47333)