-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Compiler assertion failed: tcx.migrate_borrowck() when failing to move #[thread_local] static vars. #54797
Comments
assigning to self. will investigate. |
If you turn on the 2018 edition, the ICE goes away (because that makes the |
((interestingly, our fallback to the AST-borrowck here signals no error on the code in question, so the migrate mode downgrades the error to a warning. will investigate...)) Update: in case people care, the error that is downgraded to a warning here is the following: warning[E0507]: cannot move out of static item
--> src/lib.rs:11:16
|
11 | f(&TL_COMMAND_BUFFER_WRITER.unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of static item
|
= warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
It represents potential unsoundness in your code.
This warning will become a hard error in the future. |
Curiouser and curiouser: the failing assertion is preceded by an interesting comment: rust/src/librustc_mir/transform/elaborate_drops.rs Lines 42 to 53 in 5ea8eb5
|
discussed at NLL triage meeting. Not an RC2 blocker. Putting on the Release milestone. |
hey @estebank, why is this tagged as a stable-to-nightly regression? This can't be on stable, since its using a |
@pnkfelix you're absolutely right. Missed that. Removing. |
Aha! I was flummoxed by my failures to reproduce the problem locally... turns out you have to pass |
Okay, so now I know how to reproduce the problem. I guess the "right" thing would be to report the errors nicely from |
(Another option might be to plug in a fix to AST-borrowck...) Update: this is what I went ahead with, see PR #55150 |
This is actually a dupe of #47215. We just hit it a bit differently here because instead of unwrapping the result, I started asserting that we must be in borrowck=migrate for this to occur. (Which I now know is not the case.) |
closing as duplicate of #47215. (And assigning the latter to myself.) |
…-from-moving-out-of-thread-local-under-ast-borrowck, r=nikomatsakis Do not allow moving out of thread local under ast borrowck AST borrowck failed to prevent moving out of a thread-local static. This was broken. And it also (sometimes?) caused an ICE during drop elaboration. Fix rust-lang#47215 Fix rust-lang#54797
…-from-moving-out-of-thread-local-under-ast-borrowck, r=nikomatsakis Do not allow moving out of thread local under ast borrowck AST borrowck failed to prevent moving out of a thread-local static. This was broken. And it also (sometimes?) caused an ICE during drop elaboration. Fix rust-lang#47215 Fix rust-lang#54797
Hello! I have a compiler assertion on rustc 1.31.0-nightly (2bd5993 2018-10-02) when combining
#[thread_local]
and bad code that tries to move from the thread local global. This also occurred on an earlier nightly I tried upgrading from (months old? I didn't think to save that compiler version, sorry!)(Playground)
Compiler output with the code as posted and
RUST_BACKTRACE=1
:Reasonable/expected errors when the line marked
[1]
is commented out and line marked[2]
is uncommented:Meta
rustc --version --verbose
:rustc 1.31.0-nightly (2bd5993 2018-10-02)
binary: rustc
commit-hash: 2bd5993
commit-date: 2018-10-02
host: x86_64-pc-windows-msvc
release: 1.31.0-nightly
LLVM version: 8.0
The text was updated successfully, but these errors were encountered: