-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
ICE in 2018 edition: 'cannot access a scoped thread local variable without calling set
first'
#53469
Comments
The error message is the same as #53448 (but not requiring 2018 edition, only enable Minimum reproducable: fn foo(f: Box<dyn FnOnce()>) {
f()
}
fn main() {} So this is a known problem that we cannot call a |
I think this is due to |
If move the closure inside the fn main() {
let f: Box<dyn FnOnce()> = Box::new(||{});
f()
} the following error occurs:
|
This doesn't cause an ICE for me. https://play.rust-lang.org/?gist=9f0b8f5ce57015a0d70b0e3bfd208811&version=nightly&mode=debug&edition=2015 |
@alexreg the ICE is with the 2018 edition |
This also happens with stage1 builds of the compiler when using it to compile crates that use custom derives. Two different copies of But I usually use stage2 builds (which don't have two different versions of |
The ICE now shows up correctly:
|
Don't reduce E0161 to a warning in NLL migrate mode This error has been on stable for a while, and allowing such code cause the compile to later ICE (since we can't codegen it). Errors `box UNSIZED EXPR` with unsized locals because it's not compatible with the current evaluation order (create the box before evaluating the expressions). cc #53469 (fixes the ICE in this case) cc @qnighy
Now a normal compile error. Closing. |
Playground link: https://play.rust-lang.org/?gist=f6c908320455219974ef86bf45be9abd&version=nightly&mode=debug&edition=2018
The text was updated successfully, but these errors were encountered: