Skip to content
Permalink
Browse files

fix ICE with delay-span-bug

  • Loading branch information...
nikomatsakis committed Jul 2, 2019
1 parent 0c2c241 commit f7e00a55bba51de1d58f829b562f9aff05d543f3
@@ -656,10 +656,13 @@ pub fn unexpected_hidden_region_diagnostic(
// error reporting, which in turn should have prevented us
// from getting trying to infer the hidden type
// completely.
span_bug!(
tcx.sess.delay_span_bug(
span,
"hidden type captures unexpected lifetime `{:?}` but no region inference failure",
hidden_region,
&format!(
"hidden type captures unexpected lifetime `{:?}` \
but no region inference failure",
hidden_region,
),
);
}
}
@@ -0,0 +1,15 @@
error: lifetime may not live long enough
--> $DIR/ret-impl-trait-one.rs:12:80
|
LL | async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> {
| ________________________________--__--__________________________________________^
| | | |
| | | lifetime `'b` defined here
| | lifetime `'a` defined here
LL | |
LL | | (a, b)
LL | | }
| |_^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`

error: aborting due to previous error

@@ -0,0 +1,9 @@
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
--> $DIR/ordinary-bounds-unrelated.rs:18:74
|
LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e>
| ^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0700`.
@@ -0,0 +1,9 @@
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
--> $DIR/ordinary-bounds-unsuited.rs:20:62
|
LL | fn upper_bounds<'a, 'b>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'a, 'b>
| ^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0700`.

0 comments on commit f7e00a5

Please sign in to comment.
You can’t perform that action at this time.