Auto merge of #78645 - JulianKnodt:i78622, r=estebank

Add delay_span_bug to no longer ICE

Fixes #78622

r? `@matthewjasper`
This commit is contained in:
bors 2020-11-02 02:18:36 +00:00
commit d8ef0d7757
3 changed files with 23 additions and 1 deletions

View File

@ -79,7 +79,13 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<
let _tables = tcx.typeck(body_owner);
&*path
}
_ => span_bug!(DUMMY_SP, "unexpected const parent path {:?}", parent_node),
_ => {
tcx.sess.delay_span_bug(
tcx.def_span(def_id),
&format!("unexpected const parent path {:?}", parent_node),
);
return None;
}
};
// We've encountered an `AnonConst` in some path, so we need to

View File

@ -0,0 +1,7 @@
#![crate_type = "lib"]
struct S;
fn f() {
S::A::<f> {}
//~^ ERROR ambiguous associated type
}

View File

@ -0,0 +1,9 @@
error[E0223]: ambiguous associated type
--> $DIR/issue-78622.rs:5:5
|
LL | S::A::<f> {}
| ^^^^^^^^^ help: use fully-qualified syntax: `<S as Trait>::A`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0223`.