Skip to content

Commit ad30cae

Browse files
Move default-field-values tests into a subdirectory
1 parent f1ec5d6 commit ad30cae

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

tests/ui/structs/default-field-values-failures.stderr renamed to tests/ui/structs/default-field-values/failures.stderr

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: the `#[default]` attribute may only be used on unit enum variants or variants where every field has a default value
2-
--> $DIR/default-field-values-failures.rs:47:5
2+
--> $DIR/failures.rs:47:5
33
|
44
LL | Variant {}
55
| ^^^^^^^
66
|
77
= help: consider a manual implementation of `Default`
88

99
error: generic parameters may not be used in const operations
10-
--> $DIR/default-field-values-failures.rs:22:23
10+
--> $DIR/failures.rs:22:23
1111
|
1212
LL | bat: i32 = <Qux<{ C }> as T>::K,
1313
| ^ cannot perform const operation using `C`
@@ -16,19 +16,19 @@ LL | bat: i32 = <Qux<{ C }> as T>::K,
1616
= help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
1717

1818
error: default fields are not supported in tuple structs
19-
--> $DIR/default-field-values-failures.rs:26:22
19+
--> $DIR/failures.rs:26:22
2020
|
2121
LL | pub struct Rak(i32 = 42);
2222
| ^^ default fields are only supported on structs
2323

2424
error: generic `Self` types are currently not permitted in anonymous constants
25-
--> $DIR/default-field-values-failures.rs:20:14
25+
--> $DIR/failures.rs:20:14
2626
|
2727
LL | bar: S = Self::S,
2828
| ^^^^
2929

3030
error[E0277]: the trait bound `S: Default` is not satisfied
31-
--> $DIR/default-field-values-failures.rs:14:5
31+
--> $DIR/failures.rs:14:5
3232
|
3333
LL | #[derive(Debug, Default)]
3434
| ------- in this derive macro expansion
@@ -44,43 +44,43 @@ LL | pub struct S;
4444
|
4545

4646
error: missing mandatory field `bar`
47-
--> $DIR/default-field-values-failures.rs:53:21
47+
--> $DIR/failures.rs:53:21
4848
|
4949
LL | let _ = Bar { .. };
5050
| ^
5151

5252
error[E0308]: mismatched types
53-
--> $DIR/default-field-values-failures.rs:57:17
53+
--> $DIR/failures.rs:57:17
5454
|
5555
LL | let _ = Rak(..);
5656
| --- ^^ expected `i32`, found `RangeFull`
5757
| |
5858
| arguments to this struct are incorrect
5959
|
6060
note: tuple struct defined here
61-
--> $DIR/default-field-values-failures.rs:26:12
61+
--> $DIR/failures.rs:26:12
6262
|
6363
LL | pub struct Rak(i32 = 42);
6464
| ^^^
6565
help: you might have meant to use `..` to skip providing a value for expected fields, but this is only supported on non-tuple struct literals; it is instead interpreted as a `std::ops::RangeFull` literal
66-
--> $DIR/default-field-values-failures.rs:57:17
66+
--> $DIR/failures.rs:57:17
6767
|
6868
LL | let _ = Rak(..);
6969
| ^^
7070

7171
error[E0061]: this struct takes 1 argument but 2 arguments were supplied
72-
--> $DIR/default-field-values-failures.rs:59:13
72+
--> $DIR/failures.rs:59:13
7373
|
7474
LL | let _ = Rak(0, ..);
7575
| ^^^ -- unexpected argument #2 of type `RangeFull`
7676
|
7777
help: you might have meant to use `..` to skip providing a value for expected fields, but this is only supported on non-tuple struct literals; it is instead interpreted as a `std::ops::RangeFull` literal
78-
--> $DIR/default-field-values-failures.rs:59:20
78+
--> $DIR/failures.rs:59:20
7979
|
8080
LL | let _ = Rak(0, ..);
8181
| ^^
8282
note: tuple struct defined here
83-
--> $DIR/default-field-values-failures.rs:26:12
83+
--> $DIR/failures.rs:26:12
8484
|
8585
LL | pub struct Rak(i32 = 42);
8686
| ^^^
@@ -91,18 +91,18 @@ LL + let _ = Rak(0);
9191
|
9292

9393
error[E0061]: this struct takes 1 argument but 2 arguments were supplied
94-
--> $DIR/default-field-values-failures.rs:61:13
94+
--> $DIR/failures.rs:61:13
9595
|
9696
LL | let _ = Rak(.., 0);
9797
| ^^^ -- unexpected argument #1 of type `RangeFull`
9898
|
9999
help: you might have meant to use `..` to skip providing a value for expected fields, but this is only supported on non-tuple struct literals; it is instead interpreted as a `std::ops::RangeFull` literal
100-
--> $DIR/default-field-values-failures.rs:61:17
100+
--> $DIR/failures.rs:61:17
101101
|
102102
LL | let _ = Rak(.., 0);
103103
| ^^
104104
note: tuple struct defined here
105-
--> $DIR/default-field-values-failures.rs:26:12
105+
--> $DIR/failures.rs:26:12
106106
|
107107
LL | pub struct Rak(i32 = 42);
108108
| ^^^

tests/ui/structs/default-field-values-invalid-const.stderr renamed to tests/ui/structs/default-field-values/invalid-const.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0080]: evaluation of constant value failed
2-
--> $DIR/default-field-values-invalid-const.rs:5:19
2+
--> $DIR/invalid-const.rs:5:19
33
|
44
LL | pub bax: u8 = panic!("asdf"),
5-
| ^^^^^^^^^^^^^^ the evaluated program panicked at 'asdf', $DIR/default-field-values-invalid-const.rs:5:19
5+
| ^^^^^^^^^^^^^^ the evaluated program panicked at 'asdf', $DIR/invalid-const.rs:5:19
66
|
77
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
error[E0080]: evaluation of `Baz::<C>::bat::{constant#0}` failed
10-
--> $DIR/default-field-values-invalid-const.rs:11:19
10+
--> $DIR/invalid-const.rs:11:19
1111
|
1212
LL | pub bat: u8 = 130 + 130,
1313
| ^^^^^^^^^ attempt to compute `130_u8 + 130_u8`, which would overflow

0 commit comments

Comments
 (0)