2020-02-23 11:54:00 +00:00
|
|
|
error: `default` is not followed by an item
|
2020-06-16 08:06:35 +00:00
|
|
|
--> $DIR/default.rs:23:5
|
2018-10-20 20:36:17 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | default pub fn foo<T: Default>() -> T { T::default() }
|
2020-02-23 03:49:26 +00:00
|
|
|
| ^^^^^^^ the `default` qualifier
|
|
|
|
|
|
|
|
|
= note: only `fn`, `const`, `type`, or `impl` items may be prefixed by `default`
|
2020-02-22 07:16:39 +00:00
|
|
|
|
|
|
|
error: non-item in item list
|
2020-06-16 08:06:35 +00:00
|
|
|
--> $DIR/default.rs:23:13
|
2020-02-22 07:16:39 +00:00
|
|
|
|
|
|
|
|
LL | impl Foo for u32 {
|
|
|
|
| - item list starts here
|
|
|
|
LL | default pub fn foo<T: Default>() -> T { T::default() }
|
|
|
|
| ^^^ non-item starts here
|
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - item list ends here
|
2018-10-20 20:36:17 +00:00
|
|
|
|
2023-04-04 03:28:55 +00:00
|
|
|
error[E0449]: visibility qualifiers are not permitted here
|
2020-06-16 08:06:35 +00:00
|
|
|
--> $DIR/default.rs:17:5
|
2019-01-06 15:33:05 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | pub default fn foo<T: Default>() -> T {
|
2023-04-04 03:28:55 +00:00
|
|
|
| ^^^
|
|
|
|
|
|
|
|
|
= note: trait items always share the visibility of their trait
|
2019-01-06 15:33:05 +00:00
|
|
|
|
2020-06-16 08:06:35 +00:00
|
|
|
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
|
|
|
|
--> $DIR/default.rs:3:12
|
|
|
|
|
|
|
|
|
LL | #![feature(specialization)]
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
|
2020-10-13 23:35:32 +00:00
|
|
|
= help: consider using `min_specialization` instead, which is more stable and complete
|
2022-09-18 15:55:36 +00:00
|
|
|
= note: `#[warn(incomplete_features)]` on by default
|
2020-06-16 08:06:35 +00:00
|
|
|
|
2019-01-06 15:33:05 +00:00
|
|
|
error[E0046]: not all trait items implemented, missing: `foo`
|
2020-06-16 08:06:35 +00:00
|
|
|
--> $DIR/default.rs:22:1
|
2019-01-06 15:33:05 +00:00
|
|
|
|
|
|
|
|
LL | fn foo<T: Default>() -> T;
|
|
|
|
| -------------------------- `foo` from trait
|
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | impl Foo for u32 {
|
2019-01-06 15:33:05 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^ missing `foo` in implementation
|
|
|
|
|
2020-06-16 08:06:35 +00:00
|
|
|
error: aborting due to 4 previous errors; 1 warning emitted
|
2018-10-20 20:36:17 +00:00
|
|
|
|
2019-04-17 17:26:38 +00:00
|
|
|
Some errors have detailed explanations: E0046, E0449.
|
2019-01-06 15:33:05 +00:00
|
|
|
For more information about an error, try `rustc --explain E0046`.
|