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

#[pin_project] panics with internal error: entered unreachable code when used inside a MBE with vis #312

Closed
WaffleLapkin opened this issue Jan 15, 2021 · 2 comments · Fixed by rust-lang/rust#81472
Labels
C-upstream-bug Category: This is a bug of compiler or dependencies (the fix may require action in the upstream) requires-nightly This issue requires a nightly compiler in some way

Comments

@WaffleLapkin
Copy link

On latest nightly (1.51.0-nightly (2021-01-14 e38fb306b7f5e65cca34)) started panicing with internal error: entered unreachable code message.

MRE:

#[macro_use]
macro_rules! req_future {
    ($v:vis) => {
        #[pin_project::pin_project]
        $v struct Send
        {
            #[pin]
            inner: ()
        }
    };
}

req_future! { pub }

(play)

@Aaron1011
Copy link
Collaborator

This should be fixed by rust-lang/rust#81029

@taiki-e taiki-e added the C-upstream-bug Category: This is a bug of compiler or dependencies (the fix may require action in the upstream) label Jan 16, 2021
Aaron1011 added a commit to Aaron1011/rust that referenced this issue Jan 24, 2021
If we start capturing on the first token of a frame,
we can legally pop the frame (e.g. we can capture something like
'{ my_tokens } other_tokens'. As a result, we need to snapshot the frame
at the top of the current stack, rather than just using an empty stack.

Fixes taiki-e/pin-project#312
Aaron1011 added a commit to Aaron1011/rust that referenced this issue Jan 28, 2021
Reverts PR rust-lang#80830
Fixes taiki-e/pin-project#312

We can have an arbitrary number of `None`-delimited group frames pushed
on the stack due to proc-macro invocations, which can legally be exited.
Attempting to account for this would add a lot of complexity for a tiny
performance gain, so let's just use the original strategy.
@taiki-e
Copy link
Owner

taiki-e commented Feb 1, 2021

Fixed in nightly-2021-02-01. Thanks @Aaron1011 for the fix!

@taiki-e taiki-e closed this as completed Feb 1, 2021
@taiki-e taiki-e added the requires-nightly This issue requires a nightly compiler in some way label Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-upstream-bug Category: This is a bug of compiler or dependencies (the fix may require action in the upstream) requires-nightly This issue requires a nightly compiler in some way
Projects
None yet
3 participants