Skip to content

Commit 0f21e45

Browse files
committedFeb 1, 2024
Update never_type feature gate ui test
1 parent 2c0030f commit 0f21e45

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed
 

‎tests/ui/feature-gates/feature-gate-never_type.rs

+9
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,14 @@ impl Foo for Meeshka {
1313
type Wub = !; //~ ERROR type is experimental
1414
}
1515

16+
fn look_ma_no_feature_gate<F: FnOnce() -> !>() {} //~ ERROR type is experimental
17+
fn tadam(f: &dyn Fn() -> !) {} //~ ERROR type is experimental
18+
fn panic() -> ! {
19+
panic!();
20+
}
21+
fn toudoum() -> impl Fn() -> ! { //~ ERROR type is experimental
22+
panic
23+
}
24+
1625
fn main() {
1726
}

‎tests/ui/feature-gates/feature-gate-never_type.stderr

+31-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,36 @@ LL | type Wub = !;
4848
= help: add `#![feature(never_type)]` to the crate attributes to enable
4949
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
5050

51-
error: aborting due to 5 previous errors
51+
error[E0658]: the `!` type is experimental
52+
--> $DIR/feature-gate-never_type.rs:16:43
53+
|
54+
LL | fn look_ma_no_feature_gate<F: FnOnce() -> !>() {}
55+
| ^
56+
|
57+
= note: see issue #35121 <https://github.com/rust-lang/rust/issues/35121> for more information
58+
= help: add `#![feature(never_type)]` to the crate attributes to enable
59+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
60+
61+
error[E0658]: the `!` type is experimental
62+
--> $DIR/feature-gate-never_type.rs:17:26
63+
|
64+
LL | fn tadam(f: &dyn Fn() -> !) {}
65+
| ^
66+
|
67+
= note: see issue #35121 <https://github.com/rust-lang/rust/issues/35121> for more information
68+
= help: add `#![feature(never_type)]` to the crate attributes to enable
69+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
70+
71+
error[E0658]: the `!` type is experimental
72+
--> $DIR/feature-gate-never_type.rs:21:30
73+
|
74+
LL | fn toudoum() -> impl Fn() -> ! {
75+
| ^
76+
|
77+
= note: see issue #35121 <https://github.com/rust-lang/rust/issues/35121> for more information
78+
= help: add `#![feature(never_type)]` to the crate attributes to enable
79+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
80+
81+
error: aborting due to 8 previous errors
5282

5383
For more information about this error, try `rustc --explain E0658`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// build-pass
2+
3+
trait X<const N: i32> {}
4+
5+
fn hello<T: X<{ fn hello() -> ! { loop {} } 1 }>>() {}
6+
7+
fn main() {}

0 commit comments

Comments
 (0)
Please sign in to comment.