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

+1
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

+2
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

+1-1
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

+23-9
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

+2-2
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

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

+3-1
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

+1-1
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

+6-1
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

+13-8
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
}

tests/ui/consts/const_cmp_type_id.stderr

-25
This file was deleted.

tests/ui/consts/constifconst-call-in-const-position.stderr

+6-1
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[E0308]: mismatched types
27
--> $DIR/constifconst-call-in-const-position.rs:17:38
38
|
@@ -16,6 +21,6 @@ LL | [0; T::a()]
1621
= note: expected constant `false`
1722
found constant `host`
1823

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

2126
For more information about this error, try `rustc --explain E0308`.

tests/ui/consts/rustc-impl-const-stability.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
//@ compile-flags: -Znext-solver
12
//@ known-bug: #110395
23

34
#![crate_type = "lib"]
4-
#![feature(staged_api)]
5-
#![feature(const_trait_impl, effects)]
5+
#![feature(staged_api, const_trait_impl, effects)]
6+
#![allow(incomplete_features)]
67
#![stable(feature = "foo", since = "1.0.0")]
78

89
#[stable(feature = "potato", since = "1.27.0")]
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/rustc-impl-const-stability.rs:5:30
3-
|
4-
LL | #![feature(const_trait_impl, effects)]
5-
| ^^^^^^^
6-
|
7-
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8-
= note: `#[warn(incomplete_features)]` on by default
9-
101
error: const `impl` for trait `Default` which is not marked with `#[const_trait]`
11-
--> $DIR/rustc-impl-const-stability.rs:15:12
2+
--> $DIR/rustc-impl-const-stability.rs:16:12
123
|
134
LL | impl const Default for Data {
145
| ^^^^^^^
156
|
167
= note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
178
= note: adding a non-const method body in the future would be a breaking change
189

19-
error: aborting due to 1 previous error; 1 warning emitted
10+
error: aborting due to 1 previous error
2011

tests/ui/generic-const-items/const-trait-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ check-pass
2-
2+
//@ compile-flags: -Znext-solver
33
// Test that we can call methods from const trait impls inside of generic const items.
44

55
#![feature(generic_const_items, const_trait_impl, effects)]

tests/ui/parser/impls-nested-within-fns-semantic-1.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// Regression test for part of issue #119924.
22
//@ check-pass
3+
//@ compile-flags: -Znext-solver
34

4-
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete
5+
#![allow(incomplete_features)]
6+
#![feature(const_trait_impl, effects)]
57

68
#[const_trait]
79
trait Trait {

tests/ui/parser/impls-nested-within-fns-semantic-1.stderr

-11
This file was deleted.

tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.stderr

+6-1
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[E0277]: the trait bound `Trait::{synthetic#0}: Compat` is not satisfied
27
--> $DIR/assoc-type-const-bound-usage-0.rs:13:5
38
|
@@ -28,6 +33,6 @@ LL | #[const_trait]
2833
LL | fn func() -> i32;
2934
| ---- required by a bound in this associated function
3035

31-
error: aborting due to 2 previous errors
36+
error: aborting due to 3 previous errors
3237

3338
For more information about this error, try `rustc --explain E0277`.

tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-1.stderr

+6-1
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[E0277]: the trait bound `Trait::{synthetic#0}: Compat` is not satisfied
27
--> $DIR/assoc-type-const-bound-usage-1.rs:15:44
38
|
@@ -28,6 +33,6 @@ LL | #[const_trait]
2833
LL | fn func() -> i32;
2934
| ---- required by a bound in this associated function
3035

31-
error: aborting due to 2 previous errors
36+
error: aborting due to 3 previous errors
3237

3338
For more information about this error, try `rustc --explain E0277`.

tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.stderr

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ LL | #![feature(const_trait_impl, effects)]
77
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
88
= note: `#[warn(incomplete_features)]` on by default
99

10+
error: using `#![feature(effects)]` without enabling next trait solver globally
11+
|
12+
= note: the next trait solver must be enabled globally for the effects feature to work correctly
13+
= help: use `-Znext-solver` to enable
14+
1015
error[E0277]: the trait bound `Add::{synthetic#0}: Compat` is not satisfied
1116
--> $DIR/assoc-type.rs:41:15
1217
|
@@ -18,6 +23,6 @@ help: consider further restricting the associated type
1823
LL | trait Baz where Add::{synthetic#0}: Compat {
1924
| ++++++++++++++++++++++++++++++++
2025

21-
error: aborting due to 1 previous error; 1 warning emitted
26+
error: aborting due to 2 previous errors; 1 warning emitted
2227

2328
For more information about this error, try `rustc --explain E0277`.

tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ compile-flags: -Znext-solver
12
#![allow(incomplete_features)]
23
#![feature(const_trait_impl, effects)]
34

tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/staged-api.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete
1+
//@ compile-flags: -Znext-solver
2+
#![allow(incomplete_features)]
3+
#![feature(const_trait_impl, effects)]
24
#![feature(staged_api)]
35
#![stable(feature = "rust1", since = "1.0.0")]
46

tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ LL | #![feature(const_trait_impl, effects)]
77
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
88
= note: `#[warn(incomplete_features)]` on by default
99

10+
error: using `#![feature(effects)]` without enabling next trait solver globally
11+
|
12+
= note: the next trait solver must be enabled globally for the effects feature to work correctly
13+
= help: use `-Znext-solver` to enable
14+
1015
error[E0277]: the trait bound `Runtime: ~const Compat` is not satisfied
1116
--> $DIR/call-const-trait-method-fail.rs:25:5
1217
|
@@ -23,6 +28,6 @@ LL | pub trait Plus {
2328
LL | fn plus(self, rhs: Self) -> Self;
2429
| ---- required by a bound in this associated function
2530

26-
error: aborting due to 1 previous error; 1 warning emitted
31+
error: aborting due to 2 previous errors; 1 warning emitted
2732

2833
For more information about this error, try `rustc --explain E0277`.

tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ LL | #![feature(const_trait_impl, effects)]
77
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
88
= note: `#[warn(incomplete_features)]` on by default
99

10+
error: using `#![feature(effects)]` without enabling next trait solver globally
11+
|
12+
= note: the next trait solver must be enabled globally for the effects feature to work correctly
13+
= help: use `-Znext-solver` to enable
14+
1015
error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]`
1116
--> $DIR/call-generic-method-chain.rs:10:12
1217
|
@@ -28,5 +33,5 @@ error: `~const` can only be applied to `#[const_trait]` traits
2833
LL | const fn equals_self_wrapper<T: ~const PartialEq>(t: &T) -> bool {
2934
| ^^^^^^^^^
3035

31-
error: aborting due to 3 previous errors; 1 warning emitted
36+
error: aborting due to 4 previous errors; 1 warning emitted
3237

tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ LL | #![feature(const_trait_impl, effects)]
77
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
88
= note: `#[warn(incomplete_features)]` on by default
99

10+
error: using `#![feature(effects)]` without enabling next trait solver globally
11+
|
12+
= note: the next trait solver must be enabled globally for the effects feature to work correctly
13+
= help: use `-Znext-solver` to enable
14+
1015
error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]`
1116
--> $DIR/call-generic-method-dup-bound.rs:8:12
1217
|
@@ -28,5 +33,5 @@ error: `~const` can only be applied to `#[const_trait]` traits
2833
LL | const fn equals_self2<T: A + ~const PartialEq>(t: &T) -> bool {
2934
| ^^^^^^^^^
3035

31-
error: aborting due to 3 previous errors; 1 warning emitted
36+
error: aborting due to 4 previous errors; 1 warning emitted
3237

0 commit comments

Comments
 (0)