Change:
I'm seeing an internal compiler error on the following input (found by ): The error happens on nightly but not on beta or stable.
Report from : searched nightlies: from nightly-2020-03-09 to nightly-2020-03-30 regressed nightly: nightly-2020-03-16 searched commits: from to regressed commit:
looks like the probable culprit. cc
Will fix.
Was already looking at this hehe, I have a fix for you in

Discussion:
let is_syntactic_ambiguity = !has_sub && bm == BindingMode::ByValue(Mutability::Not); match res { <del> Res::Def(DefKind::Ctor(_, CtorKind::Const), _) | Res::Def(DefKind::Const, _) | Res::Def(DefKind::ConstParam, _) if is_syntactic_ambiguity => { </del> <ins> Res::SelfCtor(_) // See #70549. | Res::Def( DefKind::Ctor(_, CtorKind::Const) | DefKind::Const | DefKind::ConstParam, _, ) if is_syntactic_ambiguity => { </ins> // Disambiguate in favor of a unit struct/variant or constant pattern. if let Some(binding) = binding { self.r.record_use(ident, ValueNS, binding, false); } Some(res) } <del> Res::Def(DefKind::Ctor(..), _) | Res::Def(DefKind::Const, _) | Res::Def(DefKind::Static, _) => { </del> <ins> Res::Def(DefKind::Ctor(..) | DefKind::Const | DefKind::Static, _) => { </ins> // This is unambiguously a fresh binding, either syntactically // (e.g., `IDENT @ PAT` or `ref IDENT`) or because `IDENT` resolves // to something unusable as a pattern (e.g., constructor function),

_ => span_bug!( ident.span, "unexpected resolution for an identifier in pattern: {:?}", <del> res </del> <ins> res, </ins> ), } }

#![feature(bool_to_option)] #![feature(crate_visibility_modifier)] #![feature(nll)] <ins> #![feature(or_patterns)] </ins> #![recursion_limit = "256"] pub use rustc_hir::def::{Namespace, PerNS};

<ins> struct S {} impl S { fn foo(&mur Self) {} //~^ ERROR expected identifier, found keyword `Self` //~| ERROR expected one of `:`, `@` //~| ERROR the `Self` constructor can only be used with fn bar(&'static mur Self) {} //~^ ERROR unexpected lifetime //~| ERROR expected identifier, found keyword `Self` //~| ERROR expected one of `:`, `@` //~| ERROR the `Self` constructor can only be used with fn baz(&mur Self @ _) {} //~^ ERROR expected one of `:`, `@` } fn main() {} </ins>

<ins> error: expected identifier, found keyword `Self` --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:4:17 | LL |     fn foo(&mur Self) {} |                 ^^^^ expected identifier, found keyword error: expected one of `:`, `@`, or `|`, found keyword `Self` --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:4:17 | LL |     fn foo(&mur Self) {} |            -----^^^^ |            |    | |            |    expected one of `:`, `@`, or `|` |            help: declare the type after the parameter binding: `<identifier>: <type>` error: unexpected lifetime `'static` in pattern --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:13 | LL |     fn bar(&'static mur Self) {} |             ^^^^^^^ help: remove the lifetime error: expected identifier, found keyword `Self` --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:25 | LL |     fn bar(&'static mur Self) {} |                         ^^^^ expected identifier, found keyword error: expected one of `:`, `@`, or `|`, found keyword `Self` --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:25 | LL |     fn bar(&'static mur Self) {} |            -------------^^^^ |            |            | |            |            expected one of `:`, `@`, or `|` |            help: declare the type after the parameter binding: `<identifier>: <type>` error: expected one of `:`, `@`, or `|`, found keyword `Self` --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:14:17 | LL |     fn baz(&mur Self @ _) {} |                 ^^^^ expected one of `:`, `@`, or `|` error: the `Self` constructor can only be used with tuple or unit structs --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:4:17 | LL |     fn foo(&mur Self) {} |                 ^^^^ help: use curly brackets: `Self { /* fields */ }` error: the `Self` constructor can only be used with tuple or unit structs --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:25 | LL |     fn bar(&'static mur Self) {} |                         ^^^^ help: use curly brackets: `Self { /* fields */ }` error: aborting due to 8 previous errors </ins>