Skip to content

Commit ed4c2d1

Browse files
committed
Add a test showing how impl_trait_in_bindings is a breaking change
1 parent 375e243 commit ed4c2d1

File tree

4 files changed

+58
-2
lines changed

4 files changed

+58
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/issue-75053.rs:5:32
3+
|
4+
LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
5+
| ^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: `#[warn(incomplete_features)]` on by default
8+
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
9+
10+
error: fatal error triggered by #[rustc_error]
11+
--> $DIR/issue-75053.rs:51:1
12+
|
13+
LL | fn main() {
14+
| ^^^^^^^^^
15+
16+
error: aborting due to previous error; 1 warning emitted
17+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/issue-75053.rs:7:34
3+
|
4+
LL | #![cfg_attr(in_bindings, feature(impl_trait_in_bindings))]
5+
| ^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: `#[warn(incomplete_features)]` on by default
8+
= note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
9+
10+
error[E0282]: type annotations needed
11+
--> $DIR/issue-75053.rs:53:38
12+
|
13+
LL | type O;
14+
| ------- `<Self as MyIndex<T>>::O` defined here
15+
...
16+
LL | let _pos: Phantom1<DummyT<()>> = Scope::new().my_index();
17+
| ^^^^^^^^^^-------------
18+
| |
19+
| this method call resolves to `<Self as MyIndex<T>>::O`
20+
| cannot infer type for type parameter `T`
21+
22+
error: aborting due to previous error; 1 warning emitted
23+
24+
For more information about this error, try `rustc --explain E0282`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: fatal error triggered by #[rustc_error]
2+
--> $DIR/issue-75053.rs:51:1
3+
|
4+
LL | fn main() {
5+
| ^^^^^^^^^
6+
7+
error: aborting due to previous error
8+

src/test/ui/mir/issue-75053.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
// compile-flags: -Z mir-opt-level=3
2-
// build-pass
32

4-
#![feature(type_alias_impl_trait)]
3+
// revisions: min_tait full_tait in_bindings
4+
#![feature(min_type_alias_impl_trait, rustc_attrs)]
5+
#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
6+
//[full_tait]~^ WARN incomplete
7+
#![cfg_attr(in_bindings, feature(impl_trait_in_bindings))]
8+
//[in_bindings]~^ WARN incomplete
59

610
use std::marker::PhantomData;
711

@@ -43,6 +47,9 @@ impl<T: MyFrom<Phantom2<DummyT<U>>>, U> MyIndex<Phantom1<T>> for Scope<U> {
4347
}
4448
}
4549

50+
#[rustc_error]
4651
fn main() {
52+
//[min_tait,full_tait]~^ ERROR rustc_error
4753
let _pos: Phantom1<DummyT<()>> = Scope::new().my_index();
54+
//[in_bindings]~^ ERROR type annotations needed
4855
}

0 commit comments

Comments
 (0)