diff options
| author | bors <bors@rust-lang.org> | 2019-05-11 03:56:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-05-11 03:56:11 +0000 |
| commit | 7519eaca9a2565cd60e645b2dfda61f205bd25df (patch) | |
| tree | 3088cf51fc50203b05f4fd77780e4c09b8fa4cf7 | |
| parent | acc7e652f874bd7d6cb008d35663d9a0e250d8a7 (diff) | |
| parent | adc18eb7cfd0315a5bdba54ecc0d926176c4cd80 (diff) | |
| download | rust-7519eaca9a2565cd60e645b2dfda61f205bd25df.tar.gz rust-7519eaca9a2565cd60e645b2dfda61f205bd25df.zip | |
Auto merge of #60721 - estebank:ice-ice-baby, r=varkor
Avoid ICE by using delay_span_bug Fix #59406, fix #53498.
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-53498.rs | 17 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-53498.stderr | 9 |
3 files changed, 29 insertions, 2 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 2b519731eee..a32745f27e1 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -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) { Ok(ok) => self.register_infer_ok_obligations(ok), Err(_) => { - span_bug!(span, + self.tcx.sess.delay_span_bug(span, &format!( "instantiate_value_path: (UFCS) {:?} was a subtype of {:?} but now is not?", self_ty, - impl_ty); + impl_ty, + )); } } } diff --git a/src/test/ui/issues/issue-53498.rs b/src/test/ui/issues/issue-53498.rs new file mode 100644 index 00000000000..c87d4236492 --- /dev/null +++ b/src/test/ui/issues/issue-53498.rs @@ -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 +} diff --git a/src/test/ui/issues/issue-53498.stderr b/src/test/ui/issues/issue-53498.stderr new file mode 100644 index 00000000000..3fd48233dae --- /dev/null +++ b/src/test/ui/issues/issue-53498.stderr @@ -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`. |
