mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
Add a test showing how impl_trait_in_bindings is a breaking change
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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`.
|
||||
@@ -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 @@ fn my_index(self) -> Self::O {
|
||||
}
|
||||
}
|
||||
|
||||
#[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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user