rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.86k stars 12.77k forks source link

Re-delay a resolve `bug` related to `Self`-ctor in patterns #133286

Closed jieyouxu closed 2 days ago

jieyouxu commented 4 days ago

For the code pattern reported in https://github.com/rust-lang/rust/issues/133272,

impl Foo {
   fn fun() {
        let S { ref Self } = todo!();
   }
}

https://github.com/rust-lang/rust/pull/121208 converted this to a span_bug from a span_delayed_bug because this specific self-ctor code pattern lacked test coverage. It turns out this can be hit but we just lacked test coverage, so change it back to a span_delayed_bug and add a targeted test case.

Follow-up to #121208, cc @nnethercote (very good exercise to expose our test coverage gaps). Fixes #133272.

rustbot commented 4 days ago

r? @estebank

rustbot has assigned @estebank. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

compiler-errors commented 4 days ago

@bors r+ rollup

bors commented 4 days ago

:pushpin: Commit 5d30436d244d207406ec8e4a2fbeb510555cba20 has been approved by compiler-errors

It is now in the queue for this repository.