Store Option<Region> as value for RegionVid

This commit is contained in:
Jack Huey 2021-05-14 21:48:32 -04:00
parent e8c284ff28
commit 61157b341e
14 changed files with 172 additions and 84 deletions

View file

@ -102,6 +102,8 @@ pub fn call_tuple_two() {
tuple_two::<Tuple>();
//~^ ERROR implementation of `TheTrait` is not general enough
//~| ERROR implementation of `TheTrait` is not general enough
//~| ERROR mismatched types
//~| ERROR mismatched types
}
pub fn call_tuple_three() {

View file

@ -46,6 +46,34 @@ LL | tuple_one::<Tuple>();
= note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
= note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
error[E0308]: mismatched types
--> $DIR/associated-types-eq-hr.rs:102:5
|
LL | tuple_two::<Tuple>();
| ^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
= note: expected reference `&'x isize`
found reference `&'y isize`
note: the lifetime requirement is introduced here
--> $DIR/associated-types-eq-hr.rs:66:53
|
LL | T: for<'x, 'y> TheTrait<(&'x isize, &'y isize), A = &'y isize>,
| ^^^^^^^^^^^^^
error[E0308]: mismatched types
--> $DIR/associated-types-eq-hr.rs:102:5
|
LL | tuple_two::<Tuple>();
| ^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
= note: expected reference `&'x isize`
found reference `&'y isize`
note: the lifetime requirement is introduced here
--> $DIR/associated-types-eq-hr.rs:66:53
|
LL | T: for<'x, 'y> TheTrait<(&'x isize, &'y isize), A = &'y isize>,
| ^^^^^^^^^^^^^
error: implementation of `TheTrait` is not general enough
--> $DIR/associated-types-eq-hr.rs:102:5
|
@ -65,7 +93,7 @@ LL | tuple_two::<Tuple>();
= note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
error: implementation of `TheTrait` is not general enough
--> $DIR/associated-types-eq-hr.rs:112:5
--> $DIR/associated-types-eq-hr.rs:114:5
|
LL | tuple_four::<Tuple>();
| ^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
@ -73,6 +101,7 @@ LL | tuple_four::<Tuple>();
= note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
= note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
error: aborting due to 7 previous errors
error: aborting due to 9 previous errors
For more information about this error, try `rustc --explain E0271`.
Some errors have detailed explanations: E0271, E0308.
For more information about an error, try `rustc --explain E0271`.

View file

@ -9,7 +9,7 @@ LL | let v = Unit2.m(
= help: consider constraining the associated type `<_ as Ty<'_>>::V` to `Unit4`
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
error[E0271]: type mismatch resolving `<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39] as FnOnce<((&u8,),)>>::Output == Unit3`
error[E0271]: type mismatch resolving `<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39] as FnOnce<((&'r u8,),)>>::Output == Unit3`
--> $DIR/issue-62203-hrtb-ice.rs:38:19
|
LL | let v = Unit2.m(

View file

@ -23,6 +23,10 @@ static SOME_STRUCT: &SomeStruct = &SomeStruct {
bar: &Bar { bools: &[true, true] },
f: &id,
//~^ ERROR implementation of `FnOnce` is not general enough
//~^^ mismatched types
//~^^^ mismatched types
//~^^^^ mismatched types
//~^^^^^ mismatched types
};
// very simple test for a 'static static with default lifetime

View file

@ -1,3 +1,39 @@
error[E0308]: mismatched types
--> $DIR/rfc1623.rs:24:8
|
LL | f: &id,
| ^^^ one type is more general than the other
|
= note: expected reference `&'a Foo<'b>`
found reference `&'a Foo<'b>`
error[E0308]: mismatched types
--> $DIR/rfc1623.rs:24:8
|
LL | f: &id,
| ^^^ one type is more general than the other
|
= note: expected reference `&'a Foo<'b>`
found reference `&'a Foo<'b>`
error[E0308]: mismatched types
--> $DIR/rfc1623.rs:24:8
|
LL | f: &id,
| ^^^ one type is more general than the other
|
= note: expected reference `&'a Foo<'b>`
found reference `&'a Foo<'b>`
error[E0308]: mismatched types
--> $DIR/rfc1623.rs:24:8
|
LL | f: &id,
| ^^^ one type is more general than the other
|
= note: expected reference `&'a Foo<'b>`
found reference `&'a Foo<'b>`
error: implementation of `FnOnce` is not general enough
--> $DIR/rfc1623.rs:24:8
|
@ -7,5 +43,6 @@ LL | f: &id,
= note: `fn(&'2 Foo<'_>) -> &'2 Foo<'_> {id::<&'2 Foo<'_>>}` must implement `FnOnce<(&'1 Foo<'b>,)>`, for any lifetime `'1`...
= note: ...but it actually implements `FnOnce<(&'2 Foo<'_>,)>`, for some specific lifetime `'2`
error: aborting due to previous error
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0308`.

View file

@ -26,6 +26,4 @@ fn main() {
// Should only be a few notes.
is_send::<X<C<'static>>>();
//~^ ERROR overflow evaluating
//~^^ 2 redundant
//~^^^ required because of
}

View file

@ -1,4 +1,4 @@
error[E0275]: overflow evaluating the requirement `Box<X<C<'_>>>: NotAuto`
error[E0275]: overflow evaluating the requirement `Box<X<C<'static>>>: NotAuto`
--> $DIR/lifetime.rs:27:5
|
LL | fn is_send<S: NotAuto>() {}
@ -7,13 +7,11 @@ LL | fn is_send<S: NotAuto>() {}
LL | is_send::<X<C<'static>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required because of the requirements on the impl of `NotAuto` for `X<C<'_>>`
note: required because of the requirements on the impl of `NotAuto` for `X<C<'static>>`
--> $DIR/lifetime.rs:19:12
|
LL | impl<T: Y> NotAuto for X<T> where T::P: NotAuto {}
| ^^^^^^^ ^^^^
= note: 2 redundant requirements hidden
= note: required because of the requirements on the impl of `NotAuto` for `X<C<'static>>`
error: aborting due to previous error

View file

@ -9,7 +9,7 @@ trait Bug {
impl Bug for &() {
type Item = impl Bug; //~ ERROR `impl Trait` in type aliases is unstable
//~^ ERROR the trait bound `(): Bug` is not satisfied
//~^^ ERROR could not find defining uses
//~^^ ERROR the trait bound
const FUN: fn() -> Self::Item = || ();
//~^ ERROR type alias impl trait is not permitted here

View file

@ -25,11 +25,14 @@ LL | type Item = impl Bug;
= help: the following implementations were found:
<&() as Bug>
error: could not find defining uses
error[E0277]: the trait bound `(): Bug` is not satisfied
--> $DIR/issue-60371.rs:10:17
|
LL | type Item = impl Bug;
| ^^^^^^^^
| ^^^^^^^^ the trait `Bug` is not implemented for `()`
|
= help: the following implementations were found:
<&() as Bug>
error: aborting due to 4 previous errors