mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-23 21:23:20 +00:00
Add a test showing how impl_trait_in_bindings
is a breaking change
This commit is contained in:
parent
1f7df1956a
commit
3abdb08351
17
src/test/ui/mir/issue-75053.full_tait.stderr
Normal file
17
src/test/ui/mir/issue-75053.full_tait.stderr
Normal file
@ -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
|
||||
|
24
src/test/ui/mir/issue-75053.in_bindings.stderr
Normal file
24
src/test/ui/mir/issue-75053.in_bindings.stderr
Normal file
@ -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`.
|
8
src/test/ui/mir/issue-75053.min_tait.stderr
Normal file
8
src/test/ui/mir/issue-75053.min_tait.stderr
Normal file
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user