Skip to content

Commit a6a83d3

Browse files
committed
bless tests
1 parent 02aaea1 commit a6a83d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1077
-185
lines changed

tests/crashes/120503.rs

-10
This file was deleted.

tests/crashes/121536.rs

-20
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
error: `~const` can only be applied to `#[const_trait]` traits
2+
--> $DIR/const-block-const-bound.rs:8:22
3+
|
4+
LL | const fn f<T: ~const Destruct>(x: T) {}
5+
| ^^^^^^^^
6+
17
error[E0493]: destructor of `T` cannot be evaluated at compile-time
28
--> $DIR/const-block-const-bound.rs:8:32
39
|
@@ -6,6 +12,6 @@ LL | const fn f<T: ~const Destruct>(x: T) {}
612
| |
713
| the destructor for this type cannot be evaluated in constant functions
814

9-
error: aborting due to 1 previous error
15+
error: aborting due to 2 previous errors
1016

1117
For more information about this error, try `rustc --explain E0493`.

tests/ui/consts/const-float-classify.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ compile-flags: -Zmir-opt-level=0
2-
//@ run-pass
2+
//@ known-bug: #110395
3+
// FIXME(effects) run-pass
34

45
#![feature(const_float_bits_conv)]
56
#![feature(const_float_classify)]
+214
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]`
2+
--> $DIR/const-float-classify.rs:12:12
3+
|
4+
LL | impl const PartialEq<NonDet> for bool {
5+
| ^^^^^^^^^^^^^^^^^
6+
|
7+
= note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
8+
= note: adding a non-const method body in the future would be a breaking change
9+
10+
error[E0207]: the const parameter `host` is not constrained by the impl trait, self type, or predicates
11+
--> $DIR/const-float-classify.rs:12:6
12+
|
13+
LL | impl const PartialEq<NonDet> for bool {
14+
| ^^^^^ unconstrained const parameter
15+
|
16+
= note: expressions using a const parameter must map each value to a distinct output value
17+
= note: proving the result of expressions other than the parameter are unique is not supported
18+
19+
error[E0284]: type annotations needed
20+
--> $DIR/const-float-classify.rs:21:35
21+
|
22+
LL | const _: () = assert!($a == $b);
23+
| ^^ cannot infer the value of the constant `_`
24+
...
25+
LL | / suite! {
26+
LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative]
27+
LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
28+
LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
29+
... |
30+
LL | | -1.0 / 0.0 => [ false, true, false, false, false, true]
31+
LL | | }
32+
| |_- in this macro invocation
33+
|
34+
note: required for `bool` to implement `PartialEq<NonDet>`
35+
--> $DIR/const-float-classify.rs:12:12
36+
|
37+
LL | impl const PartialEq<NonDet> for bool {
38+
| ----- ^^^^^^^^^^^^^^^^^ ^^^^
39+
| |
40+
| unsatisfied trait bound introduced here
41+
= note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info)
42+
43+
error[E0284]: type annotations needed
44+
--> $DIR/const-float-classify.rs:21:35
45+
|
46+
LL | const _: () = assert!($a == $b);
47+
| ^^ cannot infer the value of the constant `_`
48+
...
49+
LL | / suite! {
50+
LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative]
51+
LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
52+
LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
53+
... |
54+
LL | | -1.0 / 0.0 => [ false, true, false, false, false, true]
55+
LL | | }
56+
| |_- in this macro invocation
57+
|
58+
note: required for `bool` to implement `PartialEq<NonDet>`
59+
--> $DIR/const-float-classify.rs:12:12
60+
|
61+
LL | impl const PartialEq<NonDet> for bool {
62+
| ----- ^^^^^^^^^^^^^^^^^ ^^^^
63+
| |
64+
| unsatisfied trait bound introduced here
65+
= note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info)
66+
67+
error[E0284]: type annotations needed
68+
--> $DIR/const-float-classify.rs:21:35
69+
|
70+
LL | const _: () = assert!($a == $b);
71+
| ^^ cannot infer the value of the constant `_`
72+
...
73+
LL | / suite! {
74+
LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative]
75+
LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
76+
LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
77+
... |
78+
LL | | -1.0 / 0.0 => [ false, true, false, false, false, true]
79+
LL | | }
80+
| |_- in this macro invocation
81+
|
82+
note: required for `bool` to implement `PartialEq<NonDet>`
83+
--> $DIR/const-float-classify.rs:12:12
84+
|
85+
LL | impl const PartialEq<NonDet> for bool {
86+
| ----- ^^^^^^^^^^^^^^^^^ ^^^^
87+
| |
88+
| unsatisfied trait bound introduced here
89+
= note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info)
90+
91+
error[E0284]: type annotations needed
92+
--> $DIR/const-float-classify.rs:21:35
93+
|
94+
LL | const _: () = assert!($a == $b);
95+
| ^^ cannot infer the value of the constant `_`
96+
...
97+
LL | / suite! {
98+
LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative]
99+
LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
100+
LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
101+
... |
102+
LL | | -1.0 / 0.0 => [ false, true, false, false, false, true]
103+
LL | | }
104+
| |_- in this macro invocation
105+
|
106+
note: required for `bool` to implement `PartialEq<NonDet>`
107+
--> $DIR/const-float-classify.rs:12:12
108+
|
109+
LL | impl const PartialEq<NonDet> for bool {
110+
| ----- ^^^^^^^^^^^^^^^^^ ^^^^
111+
| |
112+
| unsatisfied trait bound introduced here
113+
= note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info)
114+
115+
error[E0284]: type annotations needed
116+
--> $DIR/const-float-classify.rs:21:35
117+
|
118+
LL | const _: () = assert!($a == $b);
119+
| ^^ cannot infer the value of the constant `_`
120+
...
121+
LL | / suite! {
122+
LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative]
123+
LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
124+
LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
125+
... |
126+
LL | | -1.0 / 0.0 => [ false, true, false, false, false, true]
127+
LL | | }
128+
| |_- in this macro invocation
129+
|
130+
note: required for `bool` to implement `PartialEq<NonDet>`
131+
--> $DIR/const-float-classify.rs:12:12
132+
|
133+
LL | impl const PartialEq<NonDet> for bool {
134+
| ----- ^^^^^^^^^^^^^^^^^ ^^^^
135+
| |
136+
| unsatisfied trait bound introduced here
137+
= note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info)
138+
139+
error[E0284]: type annotations needed
140+
--> $DIR/const-float-classify.rs:21:35
141+
|
142+
LL | const _: () = assert!($a == $b);
143+
| ^^ cannot infer the value of the constant `_`
144+
...
145+
LL | / suite! {
146+
LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative]
147+
LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
148+
LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
149+
... |
150+
LL | | -1.0 / 0.0 => [ false, true, false, false, false, true]
151+
LL | | }
152+
| |_- in this macro invocation
153+
|
154+
note: required for `bool` to implement `PartialEq<NonDet>`
155+
--> $DIR/const-float-classify.rs:12:12
156+
|
157+
LL | impl const PartialEq<NonDet> for bool {
158+
| ----- ^^^^^^^^^^^^^^^^^ ^^^^
159+
| |
160+
| unsatisfied trait bound introduced here
161+
= note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info)
162+
163+
error[E0284]: type annotations needed
164+
--> $DIR/const-float-classify.rs:21:35
165+
|
166+
LL | const _: () = assert!($a == $b);
167+
| ^^ cannot infer the value of the constant `_`
168+
...
169+
LL | / suite! {
170+
LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative]
171+
LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
172+
LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
173+
... |
174+
LL | | -1.0 / 0.0 => [ false, true, false, false, false, true]
175+
LL | | }
176+
| |_- in this macro invocation
177+
|
178+
note: required for `bool` to implement `PartialEq<NonDet>`
179+
--> $DIR/const-float-classify.rs:12:12
180+
|
181+
LL | impl const PartialEq<NonDet> for bool {
182+
| ----- ^^^^^^^^^^^^^^^^^ ^^^^
183+
| |
184+
| unsatisfied trait bound introduced here
185+
= note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info)
186+
187+
error[E0284]: type annotations needed
188+
--> $DIR/const-float-classify.rs:21:35
189+
|
190+
LL | const _: () = assert!($a == $b);
191+
| ^^ cannot infer the value of the constant `_`
192+
...
193+
LL | / suite! {
194+
LL | | [is_nan, is_infinite, is_finite, is_normal, is_sign_positive, is_sign_negative]
195+
LL | | -0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
196+
LL | | 0.0 / 0.0 => [ true, false, false, false, NonDet, NonDet]
197+
... |
198+
LL | | -1.0 / 0.0 => [ false, true, false, false, false, true]
199+
LL | | }
200+
| |_- in this macro invocation
201+
|
202+
note: required for `bool` to implement `PartialEq<NonDet>`
203+
--> $DIR/const-float-classify.rs:12:12
204+
|
205+
LL | impl const PartialEq<NonDet> for bool {
206+
| ----- ^^^^^^^^^^^^^^^^^ ^^^^
207+
| |
208+
| unsatisfied trait bound introduced here
209+
= note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info)
210+
211+
error: aborting due to 10 previous errors
212+
213+
Some errors have detailed explanations: E0207, E0284.
214+
For more information about an error, try `rustc --explain E0207`.

tests/ui/consts/const_cmp_type_id.stderr

+2-20
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,7 @@ error[E0080]: evaluation of constant value failed
1010
LL | const _A: bool = TypeId::of::<u8>() < TypeId::of::<u16>();
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `<TypeId as PartialOrd>::lt`
1212

13-
error[E0308]: mismatched types
14-
--> $DIR/const_cmp_type_id.rs:8:13
15-
|
16-
LL | assert!(TypeId::of::<u8>() == TypeId::of::<u8>());
17-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `host`, found `true`
18-
|
19-
= note: expected constant `host`
20-
found constant `true`
21-
22-
error[E0308]: mismatched types
23-
--> $DIR/const_cmp_type_id.rs:9:13
24-
|
25-
LL | assert!(TypeId::of::<()>() != TypeId::of::<u8>());
26-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `host`, found `true`
27-
|
28-
= note: expected constant `host`
29-
found constant `true`
30-
31-
error: aborting due to 4 previous errors
13+
error: aborting due to 2 previous errors
3214

33-
Some errors have detailed explanations: E0080, E0131, E0308.
15+
Some errors have detailed explanations: E0080, E0131.
3416
For more information about an error, try `rustc --explain E0080`.

tests/ui/consts/fn_trait_refs.stderr

+31-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,24 @@ error[E0635]: unknown feature `const_fn_trait_ref_impls`
44
LL | #![feature(const_fn_trait_ref_impls)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^
66

7+
error[E0635]: unknown feature `const_cmp`
8+
--> $DIR/fn_trait_refs.rs:8:12
9+
|
10+
LL | #![feature(const_cmp)]
11+
| ^^^^^^^^^
12+
713
error: `~const` can only be applied to `#[const_trait]` traits
814
--> $DIR/fn_trait_refs.rs:15:15
915
|
1016
LL | T: ~const Fn<()> + ~const Destruct,
1117
| ^^^^^^
1218

19+
error: `~const` can only be applied to `#[const_trait]` traits
20+
--> $DIR/fn_trait_refs.rs:15:31
21+
|
22+
LL | T: ~const Fn<()> + ~const Destruct,
23+
| ^^^^^^^^
24+
1325
error: `~const` can only be applied to `#[const_trait]` traits
1426
--> $DIR/fn_trait_refs.rs:15:15
1527
|
@@ -24,6 +36,12 @@ error: `~const` can only be applied to `#[const_trait]` traits
2436
LL | T: ~const FnMut<()> + ~const Destruct,
2537
| ^^^^^^^^^
2638

39+
error: `~const` can only be applied to `#[const_trait]` traits
40+
--> $DIR/fn_trait_refs.rs:22:34
41+
|
42+
LL | T: ~const FnMut<()> + ~const Destruct,
43+
| ^^^^^^^^
44+
2745
error: `~const` can only be applied to `#[const_trait]` traits
2846
--> $DIR/fn_trait_refs.rs:22:15
2947
|
@@ -52,6 +70,12 @@ error: `~const` can only be applied to `#[const_trait]` traits
5270
LL | T: ~const Fn<()> + ~const Destruct,
5371
| ^^^^^^
5472

73+
error: `~const` can only be applied to `#[const_trait]` traits
74+
--> $DIR/fn_trait_refs.rs:36:31
75+
|
76+
LL | T: ~const Fn<()> + ~const Destruct,
77+
| ^^^^^^^^
78+
5579
error: `~const` can only be applied to `#[const_trait]` traits
5680
--> $DIR/fn_trait_refs.rs:36:15
5781
|
@@ -66,6 +90,12 @@ error: `~const` can only be applied to `#[const_trait]` traits
6690
LL | T: ~const FnMut<()> + ~const Destruct,
6791
| ^^^^^^^^^
6892

93+
error: `~const` can only be applied to `#[const_trait]` traits
94+
--> $DIR/fn_trait_refs.rs:50:34
95+
|
96+
LL | T: ~const FnMut<()> + ~const Destruct,
97+
| ^^^^^^^^
98+
6999
error: `~const` can only be applied to `#[const_trait]` traits
70100
--> $DIR/fn_trait_refs.rs:50:15
71101
|
@@ -182,7 +212,7 @@ LL | const fn test_fn_mut<T>(mut f: T) -> (T::Output, T::Output)
182212
LL | }
183213
| - value is dropped here
184214

185-
error: aborting due to 20 previous errors
215+
error: aborting due to 25 previous errors
186216

187217
Some errors have detailed explanations: E0015, E0493, E0635.
188218
For more information about an error, try `rustc --explain E0015`.

tests/ui/impl-trait/normalize-tait-in-const.stderr

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ error: `~const` can only be applied to `#[const_trait]` traits
44
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
55
| ^^^^^^^^^^^^^^^^^
66

7+
error: `~const` can only be applied to `#[const_trait]` traits
8+
--> $DIR/normalize-tait-in-const.rs:27:69
9+
|
10+
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
11+
| ^^^^^^^^
12+
713
error[E0015]: cannot call non-const closure in constant functions
814
--> $DIR/normalize-tait-in-const.rs:28:5
915
|
@@ -29,7 +35,7 @@ LL | fun(filter_positive());
2935
LL | }
3036
| - value is dropped here
3137

32-
error: aborting due to 3 previous errors
38+
error: aborting due to 4 previous errors
3339

3440
Some errors have detailed explanations: E0015, E0493.
3541
For more information about an error, try `rustc --explain E0015`.

0 commit comments

Comments
 (0)