Skip to content

Commit daff015

Browse files
committed
Migrate tests to use -Znext-solver
1 parent 34ae56d commit daff015

File tree

115 files changed

+503
-428
lines changed

Some content is hidden

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

115 files changed

+503
-428
lines changed

tests/crashes/119924-6.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@ known-bug: #119924
2+
//@ compile-flags: -Znext-solver
23
#![feature(const_trait_impl, effects)]
34

45
struct S;

tests/rustdoc/inline_cross/auxiliary/const-effect-param.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
//@ compile-flags: -Znext-solver
12
#![feature(effects, const_trait_impl)]
3+
#![allow(incomplete_features)]
24

35
#[const_trait]
46
pub trait Resource {}

tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ known-bug: #110395
2-
2+
//@ compile-flags: -Znext-solver
33
#![feature(generic_const_exprs, adt_const_params, const_trait_impl, effects)]
44
#![allow(incomplete_features)]
55

tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ LL + #[derive(ConstParamTy)]
1919
LL | struct Foo(u8);
2020
|
2121

22+
error[E0284]: type annotations needed: cannot normalize `foo<N>::{constant#0}`
23+
--> $DIR/unify-op-with-fn-call.rs:20:25
24+
|
25+
LL | fn foo<const N: Foo>(a: Evaluatable<{ N + N }>) {
26+
| ^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo<N>::{constant#0}`
27+
2228
error[E0741]: `Foo` must implement `ConstParamTy` to be used as the type of a const generic parameter
2329
--> $DIR/unify-op-with-fn-call.rs:20:17
2430
|
@@ -43,17 +49,25 @@ LL + #[derive(ConstParamTy)]
4349
LL | struct Foo(u8);
4450
|
4551

46-
error: unconstrained generic constant
47-
--> $DIR/unify-op-with-fn-call.rs:30:12
52+
error[E0284]: type annotations needed: cannot normalize `foo2<N>::{constant#0}`
53+
--> $DIR/unify-op-with-fn-call.rs:29:28
4854
|
49-
LL | bar2::<{ std::ops::Add::add(N, N) }>();
50-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55+
LL | fn foo2<const N: usize>(a: Evaluatable2<{ N + N }>) {
56+
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo2<N>::{constant#0}`
57+
58+
error[E0284]: type annotations needed: cannot normalize `foo<N>::{constant#0}`
59+
--> $DIR/unify-op-with-fn-call.rs:21:11
5160
|
52-
help: try adding a `where` bound
61+
LL | bar::<{ std::ops::Add::add(N, N) }>();
62+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo<N>::{constant#0}`
63+
64+
error[E0284]: type annotations needed: cannot normalize `foo2<N>::{constant#0}`
65+
--> $DIR/unify-op-with-fn-call.rs:30:12
5366
|
54-
LL | fn foo2<const N: usize>(a: Evaluatable2<{ N + N }>) where [(); { std::ops::Add::add(N, N) }]: {
55-
| +++++++++++++++++++++++++++++++++++++++++
67+
LL | bar2::<{ std::ops::Add::add(N, N) }>();
68+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo2<N>::{constant#0}`
5669

57-
error: aborting due to 5 previous errors
70+
error: aborting due to 8 previous errors
5871

59-
For more information about this error, try `rustc --explain E0741`.
72+
Some errors have detailed explanations: E0284, E0741.
73+
For more information about an error, try `rustc --explain E0284`.

tests/ui/const-generics/issues/issue-88119.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//@ check-pass
2-
1+
//@ known-bug: #110395
2+
//@ compile-flags: -Znext-solver
33
#![allow(incomplete_features)]
44
#![feature(const_trait_impl, effects, generic_const_exprs)]
55

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
error[E0284]: type annotations needed: cannot satisfy `the constant `name_len::<T>()` can be evaluated`
2+
--> $DIR/issue-88119.rs:21:5
3+
|
4+
LL | [(); name_len::<T>()]:,
5+
| ^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `name_len::<T>()` can be evaluated`
6+
|
7+
note: required by a bound in `<&T as ConstName>`
8+
--> $DIR/issue-88119.rs:21:10
9+
|
10+
LL | [(); name_len::<T>()]:,
11+
| ^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>`
12+
13+
error[E0284]: type annotations needed: cannot satisfy `the constant `name_len::<T>()` can be evaluated`
14+
--> $DIR/issue-88119.rs:28:5
15+
|
16+
LL | [(); name_len::<T>()]:,
17+
| ^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `name_len::<T>()` can be evaluated`
18+
|
19+
note: required by a bound in `<&mut T as ConstName>`
20+
--> $DIR/issue-88119.rs:28:10
21+
|
22+
LL | [(); name_len::<T>()]:,
23+
| ^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>`
24+
25+
error: aborting due to 2 previous errors
26+
27+
For more information about this error, try `rustc --explain E0284`.

tests/ui/consts/auxiliary/closure-in-foreign-crate.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
//@ compile-flags: -Znext-solver
12
#![crate_type = "lib"]
2-
#![feature(const_closures, const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete
3+
#![feature(const_closures, const_trait_impl, effects)]
4+
#![allow(incomplete_features)]
35

46
pub const fn test() {
57
let cl = const || {};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -Zmir-opt-level=0
1+
//@ compile-flags: -Zmir-opt-level=0 -Znext-solver
22
//@ known-bug: #110395
33
// FIXME(effects) run-pass
44

tests/ui/consts/const-try.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
error: using `#![feature(effects)]` without enabling next trait solver globally
2+
|
3+
= note: the next trait solver must be enabled globally for the effects feature to work correctly
4+
= help: use `-Znext-solver` to enable
5+
16
error: const `impl` for trait `FromResidual` which is not marked with `#[const_trait]`
27
--> $DIR/const-try.rs:16:12
38
|
@@ -16,5 +21,5 @@ LL | impl const Try for TryMe {
1621
= note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
1722
= note: adding a non-const method body in the future would be a breaking change
1823

19-
error: aborting due to 2 previous errors
24+
error: aborting due to 3 previous errors
2025

tests/ui/consts/const_cmp_type_id.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
//@ known-bug: #110395
2-
#![feature(const_type_id)]
3-
#![feature(const_trait_impl, effects)]
1+
//@ check-pass
2+
//@ compile-flags: -Znext-solver
3+
#![feature(const_type_id, const_trait_impl, effects)]
4+
#![allow(incomplete_features)]
45

56
use std::any::TypeId;
67

7-
const fn main() {
8-
assert!(TypeId::of::<u8>() == TypeId::of::<u8>());
9-
assert!(TypeId::of::<()>() != TypeId::of::<u8>());
10-
const _A: bool = TypeId::of::<u8>() < TypeId::of::<u16>();
11-
// can't assert `_A` because it is not deterministic
8+
fn main() {
9+
const {
10+
// FIXME(effects) this isn't supposed to pass (right now) but it did.
11+
// revisit binops typeck please.
12+
assert!(TypeId::of::<u8>() == TypeId::of::<u8>());
13+
assert!(TypeId::of::<()>() != TypeId::of::<u8>());
14+
let _a = TypeId::of::<u8>() < TypeId::of::<u16>();
15+
// can't assert `_a` because it is not deterministic
16+
}
1217
}

0 commit comments

Comments
 (0)