Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 4 pull requests #134360

Closed
wants to merge 11 commits into from
Closed
Prev Previous commit
Next Next commit
Move default-field-values tests into a subdirectory
  • Loading branch information
compiler-errors committed Dec 14, 2024
commit ad30caebdd992f04d21351a54e91fa30a69ff0a6
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: the `#[default]` attribute may only be used on unit enum variants or variants where every field has a default value
--> $DIR/default-field-values-failures.rs:47:5
--> $DIR/failures.rs:47:5
|
LL | Variant {}
| ^^^^^^^
|
= help: consider a manual implementation of `Default`

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

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

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

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

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

error[E0308]: mismatched types
--> $DIR/default-field-values-failures.rs:57:17
--> $DIR/failures.rs:57:17
|
LL | let _ = Rak(..);
| --- ^^ expected `i32`, found `RangeFull`
| |
| arguments to this struct are incorrect
|
note: tuple struct defined here
--> $DIR/default-field-values-failures.rs:26:12
--> $DIR/failures.rs:26:12
|
LL | pub struct Rak(i32 = 42);
| ^^^
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
--> $DIR/default-field-values-failures.rs:57:17
--> $DIR/failures.rs:57:17
|
LL | let _ = Rak(..);
| ^^

error[E0061]: this struct takes 1 argument but 2 arguments were supplied
--> $DIR/default-field-values-failures.rs:59:13
--> $DIR/failures.rs:59:13
|
LL | let _ = Rak(0, ..);
| ^^^ -- unexpected argument #2 of type `RangeFull`
|
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
--> $DIR/default-field-values-failures.rs:59:20
--> $DIR/failures.rs:59:20
|
LL | let _ = Rak(0, ..);
| ^^
note: tuple struct defined here
--> $DIR/default-field-values-failures.rs:26:12
--> $DIR/failures.rs:26:12
|
LL | pub struct Rak(i32 = 42);
| ^^^
@@ -91,18 +91,18 @@ LL + let _ = Rak(0);
|

error[E0061]: this struct takes 1 argument but 2 arguments were supplied
--> $DIR/default-field-values-failures.rs:61:13
--> $DIR/failures.rs:61:13
|
LL | let _ = Rak(.., 0);
| ^^^ -- unexpected argument #1 of type `RangeFull`
|
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
--> $DIR/default-field-values-failures.rs:61:17
--> $DIR/failures.rs:61:17
|
LL | let _ = Rak(.., 0);
| ^^
note: tuple struct defined here
--> $DIR/default-field-values-failures.rs:26:12
--> $DIR/failures.rs:26:12
|
LL | pub struct Rak(i32 = 42);
| ^^^
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0080]: evaluation of constant value failed
--> $DIR/default-field-values-invalid-const.rs:5:19
--> $DIR/invalid-const.rs:5:19
|
LL | pub bax: u8 = panic!("asdf"),
| ^^^^^^^^^^^^^^ the evaluated program panicked at 'asdf', $DIR/default-field-values-invalid-const.rs:5:19
| ^^^^^^^^^^^^^^ the evaluated program panicked at 'asdf', $DIR/invalid-const.rs:5:19
|
= 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)

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