Auto merge of #60721 - estebank:ice-ice-baby, r=varkor
Avoid ICE by using delay_span_bug Fix #59406, fix #53498.
This commit is contained in:
commit
7519eaca9a
3 changed files with 29 additions and 2 deletions
|
@ -5474,10 +5474,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
||||||
match self.at(&self.misc(span), self.param_env).sup(impl_ty, self_ty) {
|
match self.at(&self.misc(span), self.param_env).sup(impl_ty, self_ty) {
|
||||||
Ok(ok) => self.register_infer_ok_obligations(ok),
|
Ok(ok) => self.register_infer_ok_obligations(ok),
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
span_bug!(span,
|
self.tcx.sess.delay_span_bug(span, &format!(
|
||||||
"instantiate_value_path: (UFCS) {:?} was a subtype of {:?} but now is not?",
|
"instantiate_value_path: (UFCS) {:?} was a subtype of {:?} but now is not?",
|
||||||
self_ty,
|
self_ty,
|
||||||
impl_ty);
|
impl_ty,
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
17
src/test/ui/issues/issue-53498.rs
Normal file
17
src/test/ui/issues/issue-53498.rs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
pub mod test {
|
||||||
|
pub struct A;
|
||||||
|
pub struct B;
|
||||||
|
pub struct Foo<T>(T);
|
||||||
|
|
||||||
|
impl Foo<A> {
|
||||||
|
fn foo() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Foo<B> {
|
||||||
|
fn foo() {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
test::Foo::<test::B>::foo(); //~ ERROR method `foo` is private
|
||||||
|
}
|
9
src/test/ui/issues/issue-53498.stderr
Normal file
9
src/test/ui/issues/issue-53498.stderr
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
error[E0624]: method `foo` is private
|
||||||
|
--> $DIR/issue-53498.rs:16:5
|
||||||
|
|
|
||||||
|
LL | test::Foo::<test::B>::foo();
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0624`.
|
Loading…
Add table
Add a link
Reference in a new issue