diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-02-11 07:17:16 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-02-11 07:17:16 +0000 |
| commit | 2d8b8f359312210e34b251906179484ffc7287c6 (patch) | |
| tree | d6ae4df9b5928aa69d505162652e4d397dfe181e /src | |
| parent | 7a71b7a99e6744097c1882a785f88e1aac3acfa0 (diff) | |
| download | rust-2d8b8f359312210e34b251906179484ffc7287c6.tar.gz rust-2d8b8f359312210e34b251906179484ffc7287c6.zip | |
Revert "Auto merge of #92306 - Aaron1011:opaque-type-op, r=oli-obk"
This reverts commit 1f0a96862ac9d4c6ca3e4bb500c8b9eac4d83049, reversing changes made to bf242bb1199e25ca2274df5c4114e0c9436b74e9.
Diffstat (limited to 'src')
4 files changed, 11 insertions, 62 deletions
diff --git a/src/test/ui/impl-trait/issues/issue-88236-2.nll.stderr b/src/test/ui/impl-trait/issues/issue-88236-2.nll.stderr index 9cf8ff76c87..86323add779 100644 --- a/src/test/ui/impl-trait/issues/issue-88236-2.nll.stderr +++ b/src/test/ui/impl-trait/issues/issue-88236-2.nll.stderr @@ -1,20 +1,14 @@ -error: implementation of `Hrtb` is not general enough +error: higher-ranked subtype error --> $DIR/issue-88236-2.rs:17:5 | LL | &() - | ^^^ implementation of `Hrtb` is not general enough - | - = note: `Hrtb<'0>` would have to be implemented for the type `&()`, for any lifetime `'0`... - = note: ...but `Hrtb<'1>` is actually implemented for the type `&'1 ()`, for some specific lifetime `'1` + | ^^^ -error: implementation of `Hrtb` is not general enough +error: higher-ranked subtype error --> $DIR/issue-88236-2.rs:17:5 | LL | &() - | ^^^ implementation of `Hrtb` is not general enough - | - = note: `Hrtb<'0>` would have to be implemented for the type `&()`, for any lifetime `'0`... - = note: ...but `Hrtb<'1>` is actually implemented for the type `&'1 ()`, for some specific lifetime `'1` + | ^^^ error: lifetime may not live long enough --> $DIR/issue-88236-2.rs:20:5 @@ -29,23 +23,17 @@ help: to allow this `impl Trait` to capture borrowed data with lifetime `'b`, ad LL | fn make_bad_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> + 'b { | ++++ -error: implementation of `Hrtb` is not general enough +error: higher-ranked subtype error --> $DIR/issue-88236-2.rs:20:5 | LL | x - | ^ implementation of `Hrtb` is not general enough - | - = note: `Hrtb<'0>` would have to be implemented for the type `&()`, for any lifetime `'0`... - = note: ...but `Hrtb<'1>` is actually implemented for the type `&'1 ()`, for some specific lifetime `'1` + | ^ -error: implementation of `Hrtb` is not general enough +error: higher-ranked subtype error --> $DIR/issue-88236-2.rs:20:5 | LL | x - | ^ implementation of `Hrtb` is not general enough - | - = note: `Hrtb<'0>` would have to be implemented for the type `&()`, for any lifetime `'0`... - = note: ...but `Hrtb<'1>` is actually implemented for the type `&'1 ()`, for some specific lifetime `'1` + | ^ error: aborting due to 5 previous errors diff --git a/src/test/ui/nll/relate_tys/opaque-hrtb.rs b/src/test/ui/nll/relate_tys/opaque-hrtb.rs deleted file mode 100644 index 0fbe6a63c0b..00000000000 --- a/src/test/ui/nll/relate_tys/opaque-hrtb.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![feature(nll)] - -trait MyTrait<T> {} - -struct Foo; -impl<T> MyTrait<T> for Foo {} - -fn bar<Input>() -> impl MyTrait<Input> { - Foo -} - -fn foo() -> impl for<'a> MyTrait<&'a str> { - bar() //~ ERROR implementation of `MyTrait` is not general enough -} - -fn main() {} diff --git a/src/test/ui/nll/relate_tys/opaque-hrtb.stderr b/src/test/ui/nll/relate_tys/opaque-hrtb.stderr deleted file mode 100644 index 4c8b66f21ab..00000000000 --- a/src/test/ui/nll/relate_tys/opaque-hrtb.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: implementation of `MyTrait` is not general enough - --> $DIR/opaque-hrtb.rs:13:5 - | -LL | bar() - | ^^^^^ implementation of `MyTrait` is not general enough - | - = note: `impl MyTrait<&'2 str>` must implement `MyTrait<&'1 str>`, for any lifetime `'1`... - = note: ...but it actually implements `MyTrait<&'2 str>`, for some specific lifetime `'2` - -error: aborting due to previous error - diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr index 91daa65d656..1538274d45c 100644 --- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr @@ -1,26 +1,14 @@ -error[E0308]: mismatched types - --> $DIR/issue-57611-trait-alias.rs:20:9 - | -LL | |x| x - | ^^^^^ one type is more general than the other - | - = note: expected type `for<'r> Fn<(&'r X,)>` - found type `Fn<(&X,)>` -note: this closure does not fulfill the lifetime requirements +error: higher-ranked subtype error --> $DIR/issue-57611-trait-alias.rs:20:9 | LL | |x| x | ^^^^^ -error: implementation of `FnOnce` is not general enough +error: higher-ranked subtype error --> $DIR/issue-57611-trait-alias.rs:20:9 | LL | |x| x - | ^^^^^ implementation of `FnOnce` is not general enough - | - = note: closure with signature `fn(&'2 X) -> &X` must implement `FnOnce<(&'1 X,)>`, for any lifetime `'1`... - = note: ...but it actually implements `FnOnce<(&'2 X,)>`, for some specific lifetime `'2` + | ^^^^^ error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0308`. |
