Skip to content

Commit c4ba60a

Browse files
committed
update tests
1 parent 18fa778 commit c4ba60a

File tree

449 files changed

+658
-950
lines changed

Some content is hidden

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

449 files changed

+658
-950
lines changed

src/test/rustdoc-ui/error-in-impl-trait/const-generics.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// check-pass
22
// edition:2018
3-
#![feature(min_const_generics)]
43
trait ValidTrait {}
54

65
/// This has docs

src/test/rustdoc/async-fn.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// ignore-tidy-linelength
22
// edition:2018
3-
#![feature(min_const_generics)]
4-
53
// @has async_fn/fn.foo.html '//pre[@class="rust fn"]' 'pub async fn foo() -> Option<Foo>'
64
pub async fn foo() -> Option<Foo> {
75
None

src/test/rustdoc/const-generics/auxiliary/extern_crate.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// edition:2018
2-
#![feature(min_const_generics)]
3-
42
pub fn extern_fn<const N: usize>() -> impl Iterator<Item = [u8; N]> {
53
[[0; N]; N].iter().copied()
64
}

src/test/rustdoc/const-generics/const-generics-docs.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// edition:2018
22
// aux-build: extern_crate.rs
3-
#![feature(min_const_generics)]
43
#![crate_name = "foo"]
54

65
extern crate extern_crate;

src/test/rustdoc/const-generics/type-alias.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// ignore-tidy-linelength
2-
#![feature(min_const_generics)]
32
#![crate_name = "foo"]
43

54
// @has foo/type.CellIndex.html '//pre[@class="rust typedef"]' 'type CellIndex<const D: usize> = [i64; D];'

src/test/ui/array-slice-vec/match_arr_unknown_len.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ LL | #![feature(const_generics)]
66
|
77
= note: `#[warn(incomplete_features)]` on by default
88
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
9-
= help: consider using `min_const_generics` instead, which is more stable and complete
109

1110
error[E0308]: mismatched types
1211
--> $DIR/match_arr_unknown_len.rs:6:9

src/test/ui/associated-consts/associated-const-type-parameter-arrays.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ impl Foo for Def {
1414

1515
pub fn test<A: Foo, B: Foo>() {
1616
let _array: [u32; <A as Foo>::Y];
17-
//~^ ERROR the trait bound `A: Foo` is not satisfied [E0277]
17+
//~^ ERROR generic parameters may not be used
1818
}
1919

20-
fn main() {
21-
}
20+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
error[E0277]: the trait bound `A: Foo` is not satisfied
2-
--> $DIR/associated-const-type-parameter-arrays.rs:16:23
1+
error: generic parameters may not be used in const operations
2+
--> $DIR/associated-const-type-parameter-arrays.rs:16:24
33
|
4-
LL | const Y: usize;
5-
| --------------- required by `Foo::Y`
6-
...
74
LL | let _array: [u32; <A as Foo>::Y];
8-
| ^^^^^^^^^^^^^ the trait `Foo` is not implemented for `A`
5+
| ^ cannot perform const operation using `A`
96
|
10-
help: consider further restricting this bound
11-
|
12-
LL | pub fn test<A: Foo + Foo, B: Foo>() {
13-
| ^^^^^
7+
= note: type parameters may not be used in const expressions
8+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
149

1510
error: aborting due to previous error
1611

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

src/test/ui/associated-item/associated-item-duplicate-bounds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ trait Adapter {
55
struct Foo<A: Adapter> {
66
adapter: A,
77
links: [u32; A::LINKS], // Shouldn't suggest bounds already there.
8-
//~^ ERROR: no associated item named `LINKS` found
8+
//~^ ERROR generic parameters may not be used in const operations
99
}
1010

1111
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error[E0599]: no associated item named `LINKS` found for type parameter `A` in the current scope
2-
--> $DIR/associated-item-duplicate-bounds.rs:7:21
1+
error: generic parameters may not be used in const operations
2+
--> $DIR/associated-item-duplicate-bounds.rs:7:18
33
|
44
LL | links: [u32; A::LINKS], // Shouldn't suggest bounds already there.
5-
| ^^^^^ associated item not found in `A`
5+
| ^^^^^^^^ cannot perform const operation using `A`
66
|
7-
= help: items from traits can only be used if the type parameter is bounded by the trait
7+
= note: type parameters may not be used in const expressions
8+
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
89

910
error: aborting due to previous error
1011

11-
For more information about this error, try `rustc --explain E0599`.

src/test/ui/async-await/issues/issue-78654.full.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0573]: expected type, found built-in attribute `feature`
2-
--> $DIR/issue-78654.rs:10:15
2+
--> $DIR/issue-78654.rs:9:15
33
|
44
LL | impl<const H: feature> Foo {
55
| ^^^^^^^ not a type
66

77
error[E0207]: the const parameter `H` is not constrained by the impl trait, self type, or predicates
8-
--> $DIR/issue-78654.rs:10:12
8+
--> $DIR/issue-78654.rs:9:12
99
|
1010
LL | impl<const H: feature> Foo {
1111
| ^ unconstrained const parameter

src/test/ui/async-await/issues/issue-78654.min.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0573]: expected type, found built-in attribute `feature`
2-
--> $DIR/issue-78654.rs:10:15
2+
--> $DIR/issue-78654.rs:9:15
33
|
44
LL | impl<const H: feature> Foo {
55
| ^^^^^^^ not a type
66

77
error[E0207]: the const parameter `H` is not constrained by the impl trait, self type, or predicates
8-
--> $DIR/issue-78654.rs:10:12
8+
--> $DIR/issue-78654.rs:9:12
99
|
1010
LL | impl<const H: feature> Foo {
1111
| ^ unconstrained const parameter

src/test/ui/async-await/issues/issue-78654.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#![cfg_attr(full, feature(const_generics))]
55
#![cfg_attr(full, allow(incomplete_features))]
6-
#![cfg_attr(min, feature(min_const_generics))]
76

87
struct Foo;
98

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0158]: const parameters cannot be referenced in patterns
2+
--> $DIR/const-param.rs:8:9
3+
|
4+
LL | N => {}
5+
| ^
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0158`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0158]: const parameters cannot be referenced in patterns
2+
--> $DIR/const-param.rs:8:9
3+
|
4+
LL | N => {}
5+
| ^
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0158`.

src/test/ui/binding/const-param.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Identifier pattern referring to a const generic parameter is an error (issue #68853).
2-
3-
#![feature(const_generics)] //~ WARN the feature `const_generics` is incomplete
2+
// revisions: full min
3+
#![cfg_attr(full, feature(const_generics))]
4+
#![cfg_attr(full, allow(incomplete_features))]
45

56
fn check<const N: usize>() {
67
match 1 {

src/test/ui/binding/const-param.stderr

-19
This file was deleted.

src/test/ui/const-generics/apit-with-const-param.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#![cfg_attr(full, feature(const_generics))]
55
#![cfg_attr(full, allow(incomplete_features))]
6-
#![cfg_attr(min, feature(min_const_generics))]
76

87
trait Trait {}
98

src/test/ui/const-generics/argument_order.full.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: lifetime parameters must be declared prior to const parameters
2-
--> $DIR/argument_order.rs:12:32
2+
--> $DIR/argument_order.rs:11:32
33
|
44
LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
55
| -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, const N: usize, T, const M: usize, U>`
66

77
error[E0747]: lifetime provided when a type was expected
8-
--> $DIR/argument_order.rs:20:23
8+
--> $DIR/argument_order.rs:19:23
99
|
1010
LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
1111
| ^^^^^^^

src/test/ui/const-generics/argument_order.min.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error: type parameters must be declared prior to const parameters
2-
--> $DIR/argument_order.rs:6:28
2+
--> $DIR/argument_order.rs:5:28
33
|
44
LL | struct Bad<const N: usize, T> {
55
| -----------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const N: usize>`
66

77
error: lifetime parameters must be declared prior to const parameters
8-
--> $DIR/argument_order.rs:12:32
8+
--> $DIR/argument_order.rs:11:32
99
|
1010
LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
1111
| -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T, U, const N: usize, const M: usize>`
1212

1313
error: type parameters must be declared prior to const parameters
14-
--> $DIR/argument_order.rs:12:36
14+
--> $DIR/argument_order.rs:11:36
1515
|
1616
LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
1717
| ---------------------^----------------------^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T, U, const N: usize, const M: usize>`
1818

1919
error[E0747]: lifetime provided when a type was expected
20-
--> $DIR/argument_order.rs:20:23
20+
--> $DIR/argument_order.rs:19:23
2121
|
2222
LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
2323
| ^^^^^^^

src/test/ui/const-generics/argument_order.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// revisions: full min
22
#![cfg_attr(full, feature(const_generics))]
33
#![cfg_attr(full, allow(incomplete_features))]
4-
#![cfg_attr(min, feature(min_const_generics))]
54

65
struct Bad<const N: usize, T> {
76
//[min]~^ ERROR type parameters must be declared prior to const parameters

src/test/ui/const-generics/array-size-in-generic-struct-param.full.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: constant expression depends on a generic parameter
2-
--> $DIR/array-size-in-generic-struct-param.rs:9:38
2+
--> $DIR/array-size-in-generic-struct-param.rs:8:38
33
|
44
LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
55
| ^^^^^^^^^^^^
66
|
77
= note: this may fail depending on what value the parameter takes
88

99
error: constant expression depends on a generic parameter
10-
--> $DIR/array-size-in-generic-struct-param.rs:20:10
10+
--> $DIR/array-size-in-generic-struct-param.rs:19:10
1111
|
1212
LL | arr: [u8; CFG.arr_size],
1313
| ^^^^^^^^^^^^^^^^^^

src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: generic parameters may not be used in const operations
2-
--> $DIR/array-size-in-generic-struct-param.rs:9:48
2+
--> $DIR/array-size-in-generic-struct-param.rs:8:48
33
|
44
LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
55
| ^ cannot perform const operation using `N`
@@ -8,7 +8,7 @@ LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
88
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
99

1010
error: generic parameters may not be used in const operations
11-
--> $DIR/array-size-in-generic-struct-param.rs:20:15
11+
--> $DIR/array-size-in-generic-struct-param.rs:19:15
1212
|
1313
LL | arr: [u8; CFG.arr_size],
1414
| ^^^ cannot perform const operation using `CFG`
@@ -17,7 +17,7 @@ LL | arr: [u8; CFG.arr_size],
1717
= help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
1818

1919
error: `Config` is forbidden as the type of a const generic parameter
20-
--> $DIR/array-size-in-generic-struct-param.rs:18:21
20+
--> $DIR/array-size-in-generic-struct-param.rs:17:21
2121
|
2222
LL | struct B<const CFG: Config> {
2323
| ^^^^^^

src/test/ui/const-generics/array-size-in-generic-struct-param.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#![cfg_attr(full, feature(const_generics))]
55
#![cfg_attr(full, allow(incomplete_features))]
6-
#![cfg_attr(min, feature(min_const_generics))]
76

87
#[allow(dead_code)]
98
struct ArithArrayLen<const N: usize>([u32; 0 + N]);

src/test/ui/const-generics/array-wrapper-struct-ctor.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// revisions: full min
33
#![cfg_attr(full, feature(const_generics))]
44
#![cfg_attr(full, allow(incomplete_features))]
5-
#![cfg_attr(min, feature(min_const_generics))]
65

76
#![allow(dead_code)]
87

src/test/ui/const-generics/associated-type-bound-fail.full.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the trait bound `u16: Bar<N>` is not satisfied
2-
--> $DIR/associated-type-bound-fail.rs:14:5
2+
--> $DIR/associated-type-bound-fail.rs:13:5
33
|
44
LL | type Assoc: Bar<N>;
55
| ------ required by this bound in `Foo::Assoc`

src/test/ui/const-generics/associated-type-bound-fail.min.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the trait bound `u16: Bar<N>` is not satisfied
2-
--> $DIR/associated-type-bound-fail.rs:14:5
2+
--> $DIR/associated-type-bound-fail.rs:13:5
33
|
44
LL | type Assoc: Bar<N>;
55
| ------ required by this bound in `Foo::Assoc`

src/test/ui/const-generics/associated-type-bound-fail.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// revisions: full min
22
#![cfg_attr(full, allow(incomplete_features))]
33
#![cfg_attr(full, feature(const_generics))]
4-
#![cfg_attr(min, feature(min_const_generics))]
54

65
trait Bar<const N: usize> {}
76

src/test/ui/const-generics/associated-type-bound.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// revisions: full min
33
#![cfg_attr(full, allow(incomplete_features))]
44
#![cfg_attr(full, feature(const_generics))]
5-
#![cfg_attr(min, feature(min_const_generics))]
65

76
trait Bar<const N: usize> {}
87

src/test/ui/const-generics/auxiliary/const_generic_lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![cfg_attr(full, feature(const_generics))]
22
#![cfg_attr(full, allow(incomplete_features))]
3-
#![cfg_attr(min, feature(min_const_generics))]
43

54
pub struct Struct<const N: usize>(pub [u8; N]);
65

src/test/ui/const-generics/auxiliary/crayte.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// edition:2018
22
#![cfg_attr(full, feature(const_generics))]
33
#![cfg_attr(full, allow(incomplete_features))]
4-
#![cfg_attr(min, feature(min_const_generics))]
54

65
pub trait Foo<const N: usize> {}
76
struct Local;

src/test/ui/const-generics/auxiliary/impl-const.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![cfg_attr(full, feature(const_generics))]
22
#![cfg_attr(full, allow(incomplete_features))]
3-
#![cfg_attr(min, feature(min_const_generics))]
43

54
pub struct Num<const N: usize>;
65

src/test/ui/const-generics/broken-mir-1.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#![cfg_attr(full, feature(const_generics))]
55
#![cfg_attr(full, allow(incomplete_features))]
6-
#![cfg_attr(min, feature(min_const_generics))]
76

87
pub trait Foo {
98
fn foo(&self);

src/test/ui/const-generics/broken-mir-2.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#![cfg_attr(full, feature(const_generics))]
55
#![cfg_attr(full, allow(incomplete_features))]
6-
#![cfg_attr(min, feature(min_const_generics))]
76

87
use std::fmt::Debug;
98

src/test/ui/const-generics/cannot-infer-type-for-const-param.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// revisions: full min
33
#![cfg_attr(full, feature(const_generics))]
44
#![cfg_attr(full, allow(incomplete_features))]
5-
#![cfg_attr(min, feature(min_const_generics))]
65

76
// This test confirms that the types can be inferred correctly for this example with const
87
// generics. Previously this would ICE, and more recently error.

0 commit comments

Comments
 (0)