diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-07-28 15:22:02 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-07-28 15:22:02 +0000 |
| commit | a85eb3d9df9f845b3ee166c8fa270efe20b4c82c (patch) | |
| tree | acc41199c423410398d79d2cb642509a48457050 /src | |
| parent | 05e678ccca974a8d0c26991083fb4cf8fff84e74 (diff) | |
| download | rust-a85eb3d9df9f845b3ee166c8fa270efe20b4c82c.tar.gz rust-a85eb3d9df9f845b3ee166c8fa270efe20b4c82c.zip | |
Revert "Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, r=oli-obk"
This reverts commit c703d11dccb4a895c7aead3b2fcd8cea8c483184, reversing changes made to 64eb9ab869bc3f9ef3645302fbf22e706eea16cf.
Diffstat (limited to 'src')
10 files changed, 47 insertions, 57 deletions
diff --git a/src/test/ui/impl-trait/issues/issue-86800.rs b/src/test/ui/impl-trait/issues/issue-86800.rs index 19edeaffc49..351243c6727 100644 --- a/src/test/ui/impl-trait/issues/issue-86800.rs +++ b/src/test/ui/impl-trait/issues/issue-86800.rs @@ -1,6 +1,14 @@ #![feature(type_alias_impl_trait)] // edition:2021 +// unset-rustc-env:RUST_BACKTRACE +// compile-flags:-Z treat-err-as-bug=1 +// error-pattern:stack backtrace: +// failure-status:101 +// normalize-stderr-test "note: .*" -> "" +// normalize-stderr-test "thread 'rustc' .*" -> "" +// normalize-stderr-test " +[0-9]+:.*\n" -> "" +// normalize-stderr-test " +at .*\n" -> "" use std::future::Future; @@ -23,7 +31,6 @@ struct Context { type TransactionResult<O> = Result<O, ()>; type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>>; -//~^ ERROR unconstrained opaque type fn execute_transaction_fut<'f, F, O>( f: F, diff --git a/src/test/ui/impl-trait/issues/issue-86800.stderr b/src/test/ui/impl-trait/issues/issue-86800.stderr index 787aecc5b84..135d06d44ad 100644 --- a/src/test/ui/impl-trait/issues/issue-86800.stderr +++ b/src/test/ui/impl-trait/issues/issue-86800.stderr @@ -1,10 +1,19 @@ -error: unconstrained opaque type - --> $DIR/issue-86800.rs:25:34 - | -LL | type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `TransactionFuture` must be used in combination with a concrete type within the same module -error: aborting due to previous error +stack backtrace: +error: internal compiler error: unexpected panic + + + + + + + + + +query stack during panic: +#0 [mir_borrowck] borrow-checking `execute_transaction_fut` +#1 [type_of] computing type of `TransactionFuture::{opaque#0}` +#2 [check_mod_item_types] checking item types in top-level module +#3 [analysis] running analysis passes on this crate +end of query stack diff --git a/src/test/ui/impl-trait/nested-return-type2-tait.rs b/src/test/ui/impl-trait/nested-return-type2-tait.rs index a2a49c5535d..42613d5ccd9 100644 --- a/src/test/ui/impl-trait/nested-return-type2-tait.rs +++ b/src/test/ui/impl-trait/nested-return-type2-tait.rs @@ -1,5 +1,7 @@ #![feature(type_alias_impl_trait)] +// check-pass + trait Duh {} impl Duh for i32 {} @@ -17,13 +19,13 @@ impl<R: Duh, F: FnMut() -> R> Trait for F { type Sendable = impl Send; -// The `Sendable` here is then later compared against the inference var -// created, causing the inference var to be set to `Sendable` instead of +// The `Sendable` here is converted to an inference var and then later compared +// against the inference var created, causing the inference var to be set to +// the hidden type of `Sendable` instead of // the hidden type. We already have obligations registered on the inference // var to make it uphold the `: Duh` bound on `Trait::Assoc`. The opaque -// type does not implement `Duh`, even if its hidden type does. So we error out. +// type does not implement `Duh`, but if its hidden type does. fn foo() -> impl Trait<Assoc = Sendable> { - //~^ ERROR `Sendable: Duh` is not satisfied || 42 } diff --git a/src/test/ui/impl-trait/nested-return-type2-tait.stderr b/src/test/ui/impl-trait/nested-return-type2-tait.stderr deleted file mode 100644 index 1079a86ce9e..00000000000 --- a/src/test/ui/impl-trait/nested-return-type2-tait.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0277]: the trait bound `Sendable: Duh` is not satisfied - --> $DIR/nested-return-type2-tait.rs:25:13 - | -LL | fn foo() -> impl Trait<Assoc = Sendable> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Duh` is not implemented for `Sendable` - | - = help: the trait `Duh` is implemented for `i32` -note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2-tait.rs:27:5: 27:7]` - --> $DIR/nested-return-type2-tait.rs:14:31 - | -LL | impl<R: Duh, F: FnMut() -> R> Trait for F { - | ^^^^^ ^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/impl-trait/nested-return-type2-tait2.rs b/src/test/ui/impl-trait/nested-return-type2-tait2.rs index fcc077ec18e..af8e0663054 100644 --- a/src/test/ui/impl-trait/nested-return-type2-tait2.rs +++ b/src/test/ui/impl-trait/nested-return-type2-tait2.rs @@ -24,8 +24,8 @@ type Traitable = impl Trait<Assoc = Sendable>; // var to make it uphold the `: Duh` bound on `Trait::Assoc`. The opaque // type does not implement `Duh`, even if its hidden type does. So we error out. fn foo() -> Traitable { - //~^ ERROR `Sendable: Duh` is not satisfied || 42 + //~^ ERROR `Sendable: Duh` is not satisfied } fn main() { diff --git a/src/test/ui/impl-trait/nested-return-type2-tait2.stderr b/src/test/ui/impl-trait/nested-return-type2-tait2.stderr index 847b9400085..fe1ae4fcb08 100644 --- a/src/test/ui/impl-trait/nested-return-type2-tait2.stderr +++ b/src/test/ui/impl-trait/nested-return-type2-tait2.stderr @@ -1,11 +1,11 @@ error[E0277]: the trait bound `Sendable: Duh` is not satisfied - --> $DIR/nested-return-type2-tait2.rs:26:13 + --> $DIR/nested-return-type2-tait2.rs:27:5 | -LL | fn foo() -> Traitable { - | ^^^^^^^^^ the trait `Duh` is not implemented for `Sendable` +LL | || 42 + | ^^^^^ the trait `Duh` is not implemented for `Sendable` | = help: the trait `Duh` is implemented for `i32` -note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2-tait2.rs:28:5: 28:7]` +note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2-tait2.rs:27:5: 27:7]` --> $DIR/nested-return-type2-tait2.rs:14:31 | LL | impl<R: Duh, F: FnMut() -> R> Trait for F { diff --git a/src/test/ui/impl-trait/nested-return-type2-tait3.rs b/src/test/ui/impl-trait/nested-return-type2-tait3.rs index 665c7a8cab9..74fd8a9dda0 100644 --- a/src/test/ui/impl-trait/nested-return-type2-tait3.rs +++ b/src/test/ui/impl-trait/nested-return-type2-tait3.rs @@ -23,8 +23,8 @@ type Traitable = impl Trait<Assoc = impl Send>; // var to make it uphold the `: Duh` bound on `Trait::Assoc`. The opaque // type does not implement `Duh`, even if its hidden type does. So we error out. fn foo() -> Traitable { - //~^ ERROR `impl Send: Duh` is not satisfied || 42 + //~^ ERROR `impl Send: Duh` is not satisfied } fn main() { diff --git a/src/test/ui/impl-trait/nested-return-type2-tait3.stderr b/src/test/ui/impl-trait/nested-return-type2-tait3.stderr index 7b7f06b8e13..c0695d627eb 100644 --- a/src/test/ui/impl-trait/nested-return-type2-tait3.stderr +++ b/src/test/ui/impl-trait/nested-return-type2-tait3.stderr @@ -1,11 +1,11 @@ error[E0277]: the trait bound `impl Send: Duh` is not satisfied - --> $DIR/nested-return-type2-tait3.rs:25:13 + --> $DIR/nested-return-type2-tait3.rs:26:5 | -LL | fn foo() -> Traitable { - | ^^^^^^^^^ the trait `Duh` is not implemented for `impl Send` +LL | || 42 + | ^^^^^ the trait `Duh` is not implemented for `impl Send` | = help: the trait `Duh` is implemented for `i32` -note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2-tait3.rs:27:5: 27:7]` +note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2-tait3.rs:26:5: 26:7]` --> $DIR/nested-return-type2-tait3.rs:14:31 | LL | impl<R: Duh, F: FnMut() -> R> Trait for F { diff --git a/src/test/ui/impl-trait/nested-return-type2.rs b/src/test/ui/impl-trait/nested-return-type2.rs index 279641a46c3..39928d543e1 100644 --- a/src/test/ui/impl-trait/nested-return-type2.rs +++ b/src/test/ui/impl-trait/nested-return-type2.rs @@ -1,3 +1,5 @@ +// check-pass + trait Duh {} impl Duh for i32 {} @@ -18,9 +20,11 @@ impl<R: Duh, F: FnMut() -> R> Trait for F { // the hidden type. We already have obligations registered on the inference // var to make it uphold the `: Duh` bound on `Trait::Assoc`. The opaque // type does not implement `Duh`, even if its hidden type does. +// Lazy TAIT would error out, but we inserted a hack to make it work again, +// keeping backwards compatibility. fn foo() -> impl Trait<Assoc = impl Send> { - //~^ ERROR `impl Send: Duh` is not satisfied || 42 } -fn main() {} +fn main() { +} diff --git a/src/test/ui/impl-trait/nested-return-type2.stderr b/src/test/ui/impl-trait/nested-return-type2.stderr deleted file mode 100644 index f28a084af89..00000000000 --- a/src/test/ui/impl-trait/nested-return-type2.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0277]: the trait bound `impl Send: Duh` is not satisfied - --> $DIR/nested-return-type2.rs:21:13 - | -LL | fn foo() -> impl Trait<Assoc = impl Send> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Duh` is not implemented for `impl Send` - | - = help: the trait `Duh` is implemented for `i32` -note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2.rs:23:5: 23:7]` - --> $DIR/nested-return-type2.rs:12:31 - | -LL | impl<R: Duh, F: FnMut() -> R> Trait for F { - | ^^^^^ ^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. |
