Skip to content

Commit 5d7e7c2

Browse files
committed
Add revisions to const generic issue UI tests.
1 parent 0855263 commit 5d7e7c2

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

+467
-149
lines changed

src/test/ui/const-generics/issues/auxiliary/const_generic_issues_lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#![feature(const_generics)]
1+
#![cfg_attr(full, feature(const_generics))]
2+
#![cfg_attr(full, allow(incomplete_features))]
3+
#![cfg_attr(min, feature(min_const_generics))]
24

35
// All of these three items must be in `lib2` to reproduce the error
46

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: constant expression depends on a generic parameter
2+
--> $DIR/issue-61935.rs:10:14
3+
|
4+
LL | Self:FooImpl<{N==0}>
5+
| ^^^^^^^^^^^^^^^
6+
|
7+
= note: this may fail depending on what value the parameter takes
8+
9+
error: aborting due to previous error
10+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: generic parameters must not be used inside of non trivial constant values
2+
--> $DIR/issue-61935.rs:10:23
3+
|
4+
LL | Self:FooImpl<{N==0}>
5+
| ^ non-trivial anonymous constants must not depend on the parameter `N`
6+
|
7+
= help: it is currently only allowed to use either `N` or `{ N }` as generic constants
8+
9+
error: aborting due to previous error
10+

src/test/ui/const-generics/issues/issue-61935.rs

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

46
trait Foo {}
57

68
impl<const N: usize> Foo for [(); N]
79
where
810
Self:FooImpl<{N==0}>
9-
//~^ERROR constant expression depends on a generic parameter
11+
//[full]~^ERROR constant expression depends on a generic parameter
12+
//[min]~^^ERROR generic parameters must not be used inside of non trivial constant values
1013
{}
1114

1215
trait FooImpl<const IS_ZERO: bool>{}

src/test/ui/const-generics/issues/issue-61935.stderr

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
warning: unused variable: `foo`
2+
--> $DIR/issue-62187-encountered-polymorphic-const.rs:17:9
3+
|
4+
LL | let foo = <[u8; 2]>::BIT_LEN;
5+
| ^^^ help: if this is intentional, prefix it with an underscore: `_foo`
6+
|
7+
= note: `#[warn(unused_variables)]` on by default
8+
9+
warning: 1 warning emitted
10+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
warning: unused variable: `foo`
2+
--> $DIR/issue-62187-encountered-polymorphic-const.rs:17:9
3+
|
4+
LL | let foo = <[u8; 2]>::BIT_LEN;
5+
| ^^^ help: if this is intentional, prefix it with an underscore: `_foo`
6+
|
7+
= note: `#[warn(unused_variables)]` on by default
8+
9+
warning: 1 warning emitted
10+

src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// run-pass
22

3-
#![feature(const_generics)]
4-
//~^ WARN the feature `const_generics` is incomplete
3+
// revisions: full min
4+
#![cfg_attr(full, feature(const_generics))]
5+
#![cfg_attr(full, allow(incomplete_features))]
6+
#![cfg_attr(min, feature(min_const_generics))]
57

68
pub trait BitLen: Sized {
79
const BIT_LEN: usize;

src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.stderr

Lines changed: 0 additions & 19 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: constant expression depends on a generic parameter
2-
--> $DIR/issue-62220.rs:10:27
2+
--> $DIR/issue-62220.rs:13:27
33
|
44
LL | pub fn trunc(self) -> (TruncatedVector<T, { N }>, T) {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)