-
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
ICE: static generator (Broken MIR: generator contains type [...] in MIR, but typeck only knows about for) #49592
Comments
Oh, it's not related to the fact that it's a procedural macro.. PaulGrandperrin/futures-await@3cb0834#diff-7cea22f34a23b3125ac94b700b8afa92R30 #[macro_export]
macro_rules! async_block {
($e:expr) => {
::futures::__rt::gen(unsafe {
static move || {
if false {
yield ::futures::Async::NotReady
}
{
$e
}
}
}
)
}
} |
I guess @Zoxc |
Ok, so I've been wrestling with this issue quite a bit to reduce it down. First, it's absolutely not related to macros. https://play.rust-lang.org/?gist=9f9e2687b234c1d8b4667ae148000249&version=nightly I will continue to try to reduce it down tomorrow and post an update. |
This might be the same bug as #49232. |
@PaulGrandperrin Your reduced case compiles on nightly now. |
The bug is indeed fixed, thanks!!! |
Hi,
I was trying to do a "quick and dirty" port of future-await 0.1 to use
immovable generators
everywhere, using the new API from the recent nightlies (#49194).It's really simple, you just have to enclose calls to
resume()
with unsafe blocks and add thestatic
keyword to all generator declarations.It worked well for the places where the macro code was in declarative style but when trying to add the
static
keyword to generator declared in procedure style macros, I get an ICE.You can find the offending code in question here: PaulGrandperrin/futures-await@227bcc3#diff-aae145273a44b5b7d67eba92bc61af08R343
To reproduce, clone the branch
rustc-bug
of https://github.com/PaulGrandperrin/futures-await.gitand use it in a project using
async_block!
.Here is the crash
The text was updated successfully, but these errors were encountered: