Skip to content

Commit

Permalink
Add revisions to const generic UI tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hameerabbasi committed Sep 10, 2020
1 parent 36903d7 commit bec8e5f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/test/ui/const-generics/auxiliary/const_generic_lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#![feature(const_generics)]
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]

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

Expand Down
4 changes: 3 additions & 1 deletion src/test/ui/const-generics/auxiliary/impl-const.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#![feature(const_generics)]
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(min, feature(min_const_generics))]

pub struct Num<const N: usize>;

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

error[E0308]: mismatched types
--> $DIR/const-argument-cross-crate-mismatch.rs:8:65
--> $DIR/const-argument-cross-crate-mismatch.rs:9:65
|
LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]);
| ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error[E0308]: mismatched types
--> $DIR/const-argument-cross-crate-mismatch.rs:7:67
|
LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8]));
| ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements

error[E0308]: mismatched types
--> $DIR/const-argument-cross-crate-mismatch.rs:9:65
|
LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]);
| ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// aux-build:const_generic_lib.rs
// revisions: full min

extern crate const_generic_lib;

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/const-generics/const-argument-cross-crate.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// revisions: full min
// aux-build:const_generic_lib.rs

extern crate const_generic_lib;
Expand Down

0 comments on commit bec8e5f

Please sign in to comment.