Skip to content

Commit 6295aba

Browse files
Update tests
1 parent 4aab6ca commit 6295aba

11 files changed

+18
-85
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: `?const` on trait bounds is not yet implemented
2-
--> $DIR/feature-gate.rs:11:29
1+
error: fatal error triggered by #[rustc_error]
2+
--> $DIR/feature-gate.rs:16:1
33
|
4-
LL | const fn get_assoc_const<S: ?const T>() -> i32 { <S as T>::CONST }
5-
| ^^^^^^^^
4+
LL | fn main() {}
5+
| ^^^^^^^^^^^^
66

77
error: aborting due to previous error
88

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33

44
#![cfg_attr(gated, feature(const_trait_bound_opt_out))]
55
#![allow(incomplete_features)]
6+
#![feature(rustc_attrs)]
67

78
trait T {
89
const CONST: i32;
910
}
1011

1112
const fn get_assoc_const<S: ?const T>() -> i32 { <S as T>::CONST }
1213
//[stock]~^ ERROR `?const` on trait bounds is experimental
13-
//[stock,gated]~^^ ERROR `?const` on trait bounds is not yet implemented
1414

15+
#[rustc_error]
1516
fn main() {}
17+
//[gated]~^ ERROR fatal error triggered by #[rustc_error]
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
error[E0658]: `?const` on trait bounds is experimental
2-
--> $DIR/feature-gate.rs:11:29
2+
--> $DIR/feature-gate.rs:12:29
33
|
44
LL | const fn get_assoc_const<S: ?const T>() -> i32 { <S as T>::CONST }
55
| ^^^^^^
66
|
77
= note: for more information, see https://github.com/rust-lang/rust/issues/67794
88
= help: add `#![feature(const_trait_bound_opt_out)]` to the crate attributes to enable
99

10-
error: `?const` on trait bounds is not yet implemented
11-
--> $DIR/feature-gate.rs:11:29
12-
|
13-
LL | const fn get_assoc_const<S: ?const T>() -> i32 { <S as T>::CONST }
14-
| ^^^^^^^^
15-
16-
error: aborting due to 2 previous errors
10+
error: aborting due to previous error
1711

1812
For more information about this error, try `rustc --explain E0658`.

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-impl-trait.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,14 @@ impl T for S {}
88

99
fn rpit() -> impl ?const T { S }
1010
//~^ ERROR `?const` is not permitted in `impl Trait`
11-
//~| ERROR `?const` on trait bounds is not yet implemented
1211

1312
fn apit(_: impl ?const T) {}
1413
//~^ ERROR `?const` is not permitted in `impl Trait`
15-
//~| ERROR `?const` on trait bounds is not yet implemented
1614

1715
fn rpit_assoc_bound() -> impl IntoIterator<Item: ?const T> { Some(S) }
1816
//~^ ERROR `?const` is not permitted in `impl Trait`
19-
//~| ERROR `?const` on trait bounds is not yet implemented
2017

2118
fn apit_assoc_bound(_: impl IntoIterator<Item: ?const T>) {}
2219
//~^ ERROR `?const` is not permitted in `impl Trait`
23-
//~| ERROR `?const` on trait bounds is not yet implemented
2420

2521
fn main() {}

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-impl-trait.stderr

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,22 @@ LL | fn rpit() -> impl ?const T { S }
55
| ^^^^^^^^
66

77
error: `?const` is not permitted in `impl Trait`
8-
--> $DIR/in-impl-trait.rs:13:17
8+
--> $DIR/in-impl-trait.rs:12:17
99
|
1010
LL | fn apit(_: impl ?const T) {}
1111
| ^^^^^^^^
1212

1313
error: `?const` is not permitted in `impl Trait`
14-
--> $DIR/in-impl-trait.rs:17:50
14+
--> $DIR/in-impl-trait.rs:15:50
1515
|
1616
LL | fn rpit_assoc_bound() -> impl IntoIterator<Item: ?const T> { Some(S) }
1717
| ^^^^^^^^
1818

1919
error: `?const` is not permitted in `impl Trait`
20-
--> $DIR/in-impl-trait.rs:21:48
20+
--> $DIR/in-impl-trait.rs:18:48
2121
|
2222
LL | fn apit_assoc_bound(_: impl IntoIterator<Item: ?const T>) {}
2323
| ^^^^^^^^
2424

25-
error: `?const` on trait bounds is not yet implemented
26-
--> $DIR/in-impl-trait.rs:9:19
27-
|
28-
LL | fn rpit() -> impl ?const T { S }
29-
| ^^^^^^^^
30-
31-
error: `?const` on trait bounds is not yet implemented
32-
--> $DIR/in-impl-trait.rs:13:17
33-
|
34-
LL | fn apit(_: impl ?const T) {}
35-
| ^^^^^^^^
36-
37-
error: `?const` on trait bounds is not yet implemented
38-
--> $DIR/in-impl-trait.rs:17:50
39-
|
40-
LL | fn rpit_assoc_bound() -> impl IntoIterator<Item: ?const T> { Some(S) }
41-
| ^^^^^^^^
42-
43-
error: `?const` on trait bounds is not yet implemented
44-
--> $DIR/in-impl-trait.rs:21:48
45-
|
46-
LL | fn apit_assoc_bound(_: impl IntoIterator<Item: ?const T>) {}
47-
| ^^^^^^^^
48-
49-
error: aborting due to 8 previous errors
25+
error: aborting due to 4 previous errors
5026

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-bounds.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
trait Super {}
55
trait T: ?const Super {}
66
//~^ ERROR `?const` is not permitted in supertraits
7-
//~| ERROR `?const` on trait bounds is not yet implemented
87

98
fn main() {}

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-bounds.stderr

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,5 @@ error: `?const` is not permitted in supertraits
44
LL | trait T: ?const Super {}
55
| ^^^^^^^^^^^^
66

7-
error: `?const` on trait bounds is not yet implemented
8-
--> $DIR/in-trait-bounds.rs:5:10
9-
|
10-
LL | trait T: ?const Super {}
11-
| ^^^^^^^^^^^^
12-
13-
error: aborting due to 2 previous errors
7+
error: aborting due to previous error
148

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-object.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ impl T for S {}
99
// An inherent impl for the trait object `?const T`.
1010
impl ?const T {}
1111
//~^ ERROR `?const` is not permitted in trait objects
12-
//~| ERROR `?const` on trait bounds is not yet implemented
1312

1413
fn trait_object() -> &'static dyn ?const T { &S }
1514
//~^ ERROR `?const` is not permitted in trait objects
16-
//~| ERROR `?const` on trait bounds is not yet implemented
1715

1816
fn trait_object_in_apit(_: impl IntoIterator<Item = Box<dyn ?const T>>) {}
1917
//~^ ERROR `?const` is not permitted in trait objects
20-
//~| ERROR `?const` on trait bounds is not yet implemented
2118

2219
fn main() {}

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-object.stderr

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,16 @@ LL | impl ?const T {}
55
| ^^^^^^^^
66

77
error: `?const` is not permitted in trait objects
8-
--> $DIR/in-trait-object.rs:14:35
8+
--> $DIR/in-trait-object.rs:13:35
99
|
1010
LL | fn trait_object() -> &'static dyn ?const T { &S }
1111
| ^^^^^^^^
1212

1313
error: `?const` is not permitted in trait objects
14-
--> $DIR/in-trait-object.rs:18:61
14+
--> $DIR/in-trait-object.rs:16:61
1515
|
1616
LL | fn trait_object_in_apit(_: impl IntoIterator<Item = Box<dyn ?const T>>) {}
1717
| ^^^^^^^^
1818

19-
error: `?const` on trait bounds is not yet implemented
20-
--> $DIR/in-trait-object.rs:10:6
21-
|
22-
LL | impl ?const T {}
23-
| ^^^^^^^^
24-
25-
error: `?const` on trait bounds is not yet implemented
26-
--> $DIR/in-trait-object.rs:14:35
27-
|
28-
LL | fn trait_object() -> &'static dyn ?const T { &S }
29-
| ^^^^^^^^
30-
31-
error: `?const` on trait bounds is not yet implemented
32-
--> $DIR/in-trait-object.rs:18:61
33-
|
34-
LL | fn trait_object_in_apit(_: impl IntoIterator<Item = Box<dyn ?const T>>) {}
35-
| ^^^^^^^^
36-
37-
error: aborting due to 6 previous errors
19+
error: aborting due to 3 previous errors
3820

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/with-maybe-sized.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33

44
struct S<T: ?const ?Sized>(std::marker::PhantomData<T>);
55
//~^ ERROR `?const` and `?` are mutually exclusive
6-
//~| ERROR `?const` on trait bounds is not yet implemented
76

87
fn main() {}

src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/with-maybe-sized.stderr

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,5 @@ error: `?const` and `?` are mutually exclusive
44
LL | struct S<T: ?const ?Sized>(std::marker::PhantomData<T>);
55
| ^^^^^^^^^^^^^
66

7-
error: `?const` on trait bounds is not yet implemented
8-
--> $DIR/with-maybe-sized.rs:4:13
9-
|
10-
LL | struct S<T: ?const ?Sized>(std::marker::PhantomData<T>);
11-
| ^^^^^^^^^^^^^
12-
13-
error: aborting due to 2 previous errors
7+
error: aborting due to previous error
148

0 commit comments

Comments
 (0)