mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-27 02:53:43 +00:00
109 lines
3.4 KiB
Plaintext
109 lines
3.4 KiB
Plaintext
error: the `#[default]` attribute may only be used on unit enum variants or variants where every field has a default value
|
|
--> $DIR/failures.rs:47:5
|
|
|
|
|
LL | Variant {}
|
|
| ^^^^^^^
|
|
|
|
|
= help: consider a manual implementation of `Default`
|
|
|
|
error: default fields are not supported in tuple structs
|
|
--> $DIR/failures.rs:26:22
|
|
|
|
|
LL | pub struct Rak(i32 = 42);
|
|
| ^^ default fields are only supported on structs
|
|
|
|
error[E0277]: the trait bound `S: Default` is not satisfied
|
|
--> $DIR/failures.rs:14:5
|
|
|
|
|
LL | #[derive(Debug, Default)]
|
|
| ------- in this derive macro expansion
|
|
LL | pub struct Bar {
|
|
LL | pub bar: S,
|
|
| ^^^^^^^^^^ the trait `Default` is not implemented for `S`
|
|
|
|
|
help: consider annotating `S` with `#[derive(Default)]`
|
|
|
|
|
LL + #[derive(Default)]
|
|
LL | pub struct S;
|
|
|
|
|
|
|
error: missing field `bar` in initializer
|
|
--> $DIR/failures.rs:53:19
|
|
|
|
|
LL | let _ = Bar { .. };
|
|
| ^ fields that do not have a defaulted value must be provided explicitly
|
|
|
|
error: missing field `bar` in initializer
|
|
--> $DIR/failures.rs:54:27
|
|
|
|
|
LL | let _ = Bar { baz: 0, .. };
|
|
| ^ fields that do not have a defaulted value must be provided explicitly
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/failures.rs:58:17
|
|
|
|
|
LL | let _ = Rak(..);
|
|
| --- ^^ expected `i32`, found `RangeFull`
|
|
| |
|
|
| arguments to this struct are incorrect
|
|
|
|
|
note: tuple struct defined here
|
|
--> $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/failures.rs:58:17
|
|
|
|
|
LL | let _ = Rak(..);
|
|
| ^^
|
|
|
|
error[E0061]: this struct takes 1 argument but 2 arguments were supplied
|
|
--> $DIR/failures.rs:60: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/failures.rs:60:20
|
|
|
|
|
LL | let _ = Rak(0, ..);
|
|
| ^^
|
|
note: tuple struct defined here
|
|
--> $DIR/failures.rs:26:12
|
|
|
|
|
LL | pub struct Rak(i32 = 42);
|
|
| ^^^
|
|
help: remove the extra argument
|
|
|
|
|
LL - let _ = Rak(0, ..);
|
|
LL + let _ = Rak(0);
|
|
|
|
|
|
|
error[E0061]: this struct takes 1 argument but 2 arguments were supplied
|
|
--> $DIR/failures.rs:62: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/failures.rs:62:17
|
|
|
|
|
LL | let _ = Rak(.., 0);
|
|
| ^^
|
|
note: tuple struct defined here
|
|
--> $DIR/failures.rs:26:12
|
|
|
|
|
LL | pub struct Rak(i32 = 42);
|
|
| ^^^
|
|
help: remove the extra argument
|
|
|
|
|
LL - let _ = Rak(.., 0);
|
|
LL + let _ = Rak(0);
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
|
|
|
Some errors have detailed explanations: E0061, E0277, E0308.
|
|
For more information about an error, try `rustc --explain E0061`.
|