Add delay_span_bug to no longer ICE

This commit is contained in:
kadmin 2020-11-01 22:31:19 +00:00
parent b202532608
commit ab946dd3e7
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`.