diff options
| author | Oli Scherer <github35764891676564198441@oli-obk.de> | 2021-03-12 10:54:12 +0000 |
|---|---|---|
| committer | Oli Scherer <github35764891676564198441@oli-obk.de> | 2021-03-15 17:33:20 +0000 |
| commit | 3abdb08351d7c944e1dfab72a06fe5074b2bc227 (patch) | |
| tree | f6fca931a77bb091bc8bf02a1296b5e9c15efd5d /src/test/ui/mir | |
| parent | 1f7df1956a8c78652aedee67172d7d52f395d785 (diff) | |
| download | rust-3abdb08351d7c944e1dfab72a06fe5074b2bc227.tar.gz rust-3abdb08351d7c944e1dfab72a06fe5074b2bc227.zip | |
Add a test showing how `impl_trait_in_bindings` is a breaking change
Diffstat (limited to 'src/test/ui/mir')
| -rw-r--r-- | src/test/ui/mir/issue-75053.full_tait.stderr | 17 | ||||
| -rw-r--r-- | src/test/ui/mir/issue-75053.in_bindings.stderr | 24 | ||||
| -rw-r--r-- | src/test/ui/mir/issue-75053.min_tait.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/mir/issue-75053.rs | 11 |
4 files changed, 58 insertions, 2 deletions
diff --git a/src/test/ui/mir/issue-75053.full_tait.stderr b/src/test/ui/mir/issue-75053.full_tait.stderr new file mode 100644 index 00000000000..0737c666f85 --- /dev/null +++ b/src/test/ui/mir/issue-75053.full_tait.stderr @@ -0,0 +1,17 @@ +warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/issue-75053.rs:5:32 + | +LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information + +error: fatal error triggered by #[rustc_error] + --> $DIR/issue-75053.rs:51:1 + | +LL | fn main() { + | ^^^^^^^^^ + +error: aborting due to previous error; 1 warning emitted + diff --git a/src/test/ui/mir/issue-75053.in_bindings.stderr b/src/test/ui/mir/issue-75053.in_bindings.stderr new file mode 100644 index 00000000000..1c473d99139 --- /dev/null +++ b/src/test/ui/mir/issue-75053.in_bindings.stderr @@ -0,0 +1,24 @@ +warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/issue-75053.rs:7:34 + | +LL | #![cfg_attr(in_bindings, feature(impl_trait_in_bindings))] + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + = note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information + +error[E0282]: type annotations needed + --> $DIR/issue-75053.rs:53:38 + | +LL | type O; + | ------- `<Self as MyIndex<T>>::O` defined here +... +LL | let _pos: Phantom1<DummyT<()>> = Scope::new().my_index(); + | ^^^^^^^^^^------------- + | | + | this method call resolves to `<Self as MyIndex<T>>::O` + | cannot infer type for type parameter `T` + +error: aborting due to previous error; 1 warning emitted + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/mir/issue-75053.min_tait.stderr b/src/test/ui/mir/issue-75053.min_tait.stderr new file mode 100644 index 00000000000..180a4094ff2 --- /dev/null +++ b/src/test/ui/mir/issue-75053.min_tait.stderr @@ -0,0 +1,8 @@ +error: fatal error triggered by #[rustc_error] + --> $DIR/issue-75053.rs:51:1 + | +LL | fn main() { + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/mir/issue-75053.rs b/src/test/ui/mir/issue-75053.rs index d3d1002cd62..80c0c796100 100644 --- a/src/test/ui/mir/issue-75053.rs +++ b/src/test/ui/mir/issue-75053.rs @@ -1,7 +1,11 @@ // compile-flags: -Z mir-opt-level=3 -// build-pass -#![feature(min_type_alias_impl_trait)] +// revisions: min_tait full_tait in_bindings +#![feature(min_type_alias_impl_trait, rustc_attrs)] +#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +//[full_tait]~^ WARN incomplete +#![cfg_attr(in_bindings, feature(impl_trait_in_bindings))] +//[in_bindings]~^ WARN incomplete use std::marker::PhantomData; @@ -43,6 +47,9 @@ impl<T: MyFrom<Phantom2<DummyT<U>>>, U> MyIndex<Phantom1<T>> for Scope<U> { } } +#[rustc_error] fn main() { + //[min_tait,full_tait]~^ ERROR rustc_error let _pos: Phantom1<DummyT<()>> = Scope::new().my_index(); + //[in_bindings]~^ ERROR type annotations needed } |
