Skip to content

Commit bec8e5f

Browse files
committed
Add revisions to const generic UI tests.
1 parent 36903d7 commit bec8e5f

6 files changed

+25
-4
lines changed

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

+3-1
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
pub struct Struct<const N: usize>(pub [u8; N]);
46

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

+3-1
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
pub struct Num<const N: usize>;
46

src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr src/test/ui/const-generics/const-argument-cross-crate-mismatch.full.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0308]: mismatched types
2-
--> $DIR/const-argument-cross-crate-mismatch.rs:6:67
2+
--> $DIR/const-argument-cross-crate-mismatch.rs:7:67
33
|
44
LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8]));
55
| ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements
66

77
error[E0308]: mismatched types
8-
--> $DIR/const-argument-cross-crate-mismatch.rs:8:65
8+
--> $DIR/const-argument-cross-crate-mismatch.rs:9:65
99
|
1010
LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]);
1111
| ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/const-argument-cross-crate-mismatch.rs:7:67
3+
|
4+
LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8]));
5+
| ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements
6+
7+
error[E0308]: mismatched types
8+
--> $DIR/const-argument-cross-crate-mismatch.rs:9:65
9+
|
10+
LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]);
11+
| ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements
12+
13+
error: aborting due to 2 previous errors
14+
15+
For more information about this error, try `rustc --explain E0308`.

src/test/ui/const-generics/const-argument-cross-crate-mismatch.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// aux-build:const_generic_lib.rs
2+
// revisions: full min
23

34
extern crate const_generic_lib;
45

src/test/ui/const-generics/const-argument-cross-crate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// run-pass
2+
// revisions: full min
23
// aux-build:const_generic_lib.rs
34

45
extern crate const_generic_lib;

0 commit comments

Comments
 (0)