Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 644c894

Browse files
committed
test min_const_generics using revisions
1 parent 37c29ad commit 644c894

24 files changed

+154
-52
lines changed

src/test/ui/const-generics/defaults/wrong-order.stderr renamed to src/test/ui/const-generics/defaults/wrong-order.full.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
error: type parameters with a default must be trailing
2-
--> $DIR/wrong-order.rs:3:10
2+
--> $DIR/wrong-order.rs:5:10
33
|
44
LL | struct A<T = u32, const N: usize> {
55
| ^
66
|
77
= note: using type defaults and const parameters in the same parameter list is currently not permitted
88

99
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
10-
--> $DIR/wrong-order.rs:1:12
10+
--> $DIR/wrong-order.rs:2:27
1111
|
12-
LL | #![feature(const_generics)]
13-
| ^^^^^^^^^^^^^^
12+
LL | #![cfg_attr(full, feature(const_generics))]
13+
| ^^^^^^^^^^^^^^
1414
|
1515
= note: `#[warn(incomplete_features)]` on by default
1616
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: type parameters with a default must be trailing
2+
--> $DIR/wrong-order.rs:5:10
3+
|
4+
LL | struct A<T = u32, const N: usize> {
5+
| ^
6+
|
7+
= note: using type defaults and const parameters in the same parameter list is currently not permitted
8+
9+
error: aborting due to previous error
10+

src/test/ui/const-generics/defaults/wrong-order.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#![feature(const_generics)] //~ WARN the feature `const_generics` is incomplete
1+
// revisions: full min
2+
#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
3+
#![cfg_attr(min, feature(min_const_generics))]
24

35
struct A<T = u32, const N: usize> {
46
//~^ ERROR type parameters with a default must be trailing

src/test/ui/const-generics/issues/issue-56445.stderr renamed to src/test/ui/const-generics/issues/issue-56445.full.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/issue-56445.rs:3:12
2+
--> $DIR/issue-56445.rs:3:27
33
|
4-
LL | #![feature(const_generics)]
5-
| ^^^^^^^^^^^^^^
4+
LL | #![cfg_attr(full, feature(const_generics))]
5+
| ^^^^^^^^^^^^^^
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
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error[E0771]: use of non-static lifetime `'a` in const generic
2+
--> $DIR/issue-56445.rs:9:26
3+
|
4+
LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
5+
| ^^
6+
|
7+
= note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052>
8+
9+
error: using `&'static str` as const generic parameters is forbidden
10+
--> $DIR/issue-56445.rs:9:25
11+
|
12+
LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
13+
| ^^^^^^^
14+
|
15+
= note: the only supported types are integers, `bool` and `char`
16+
= note: more complex types are supported with `#[feature(const_generics)]`
17+
18+
error: aborting due to 2 previous errors
19+
20+
For more information about this error, try `rustc --explain E0771`.
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// Regression test for https://github.com/rust-lang/rust/issues/56445#issuecomment-518402995.
2-
3-
#![feature(const_generics)]
4-
//~^ WARN: the feature `const_generics` is incomplete
2+
// revisions: full min
3+
#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
4+
#![cfg_attr(min, feature(min_const_generics))]
55
#![crate_type = "lib"]
66

77
use std::marker::PhantomData;
88

99
struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
1010
//~^ ERROR: use of non-static lifetime `'a` in const generic
11+
//[min]~| ERROR: using `&'static str` as const
1112

1213
impl Bug<'_, ""> {}

src/test/ui/const-generics/issues/issue-61336-1.stderr renamed to src/test/ui/const-generics/issues/issue-60818-struct-constructors.full.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/issue-61336-1.rs:1:12
2+
--> $DIR/issue-60818-struct-constructors.rs:3:27
33
|
4-
LL | #![feature(const_generics)]
5-
| ^^^^^^^^^^^^^^
4+
LL | #![cfg_attr(full, feature(const_generics))]
5+
| ^^^^^^^^^^^^^^
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

src/test/ui/const-generics/issues/issue-60818-struct-constructors.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// check-pass
2-
3-
#![feature(const_generics)]
4-
//~^ WARN the feature `const_generics` is incomplete
2+
// revisions: full min
3+
#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
4+
#![cfg_attr(min, feature(min_const_generics))]
55

66
struct Generic<const V: usize>;
77

src/test/ui/const-generics/issues/issue-60818-struct-constructors.stderr renamed to src/test/ui/const-generics/issues/issue-61336-1.full.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/issue-60818-struct-constructors.rs:3:12
2+
--> $DIR/issue-61336-1.rs:3:27
33
|
4-
LL | #![feature(const_generics)]
5-
| ^^^^^^^^^^^^^^
4+
LL | #![cfg_attr(full, feature(const_generics))]
5+
| ^^^^^^^^^^^^^^
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

src/test/ui/const-generics/issues/issue-61336-1.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#![feature(const_generics)]
2-
//~^ WARN the feature `const_generics` is incomplete
3-
41
// build-pass
2+
// revisions: full min
3+
#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
4+
#![cfg_attr(min, feature(min_const_generics))]
55

66
fn f<T: Copy, const N: usize>(x: T) -> [T; N] {
77
[x; N]

0 commit comments

Comments
 (0)