2020-02-23 04:49:26 +01:00
|
|
|
error: `default` not followed by an item
|
2020-02-22 08:16:39 +01:00
|
|
|
--> $DIR/default.rs:22:5
|
2018-10-20 23:36:17 +03:00
|
|
|
|
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | default pub fn foo<T: Default>() -> T { T::default() }
|
2020-02-23 04:49:26 +01:00
|
|
|
| ^^^^^^^ the `default` qualifier
|
|
|
|
|
|
|
|
|
= note: only `fn`, `const`, `type`, or `impl` items may be prefixed by `default`
|
2020-02-22 08:16:39 +01:00
|
|
|
|
|
|
|
error: non-item in item list
|
|
|
|
--> $DIR/default.rs:22:13
|
|
|
|
|
|
|
|
|
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 23:36:17 +03:00
|
|
|
|
2019-01-06 18:33:05 +03:00
|
|
|
error[E0449]: unnecessary visibility qualifier
|
|
|
|
--> $DIR/default.rs:16:5
|
|
|
|
|
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | pub default fn foo<T: Default>() -> T {
|
2019-01-06 18:33:05 +03:00
|
|
|
| ^^^ `pub` not permitted here because it's implied
|
|
|
|
|
|
|
|
error[E0046]: not all trait items implemented, missing: `foo`
|
|
|
|
--> $DIR/default.rs:21:1
|
|
|
|
|
|
|
|
|
LL | fn foo<T: Default>() -> T;
|
|
|
|
| -------------------------- `foo` from trait
|
|
|
|
...
|
2019-03-09 15:03:44 +03:00
|
|
|
LL | impl Foo for u32 {
|
2019-01-06 18:33:05 +03:00
|
|
|
| ^^^^^^^^^^^^^^^^ missing `foo` in implementation
|
|
|
|
|
2020-02-22 08:16:39 +01:00
|
|
|
error: aborting due to 4 previous errors
|
2018-10-20 23:36:17 +03:00
|
|
|
|
2019-04-17 13:26:38 -04:00
|
|
|
Some errors have detailed explanations: E0046, E0449.
|
2019-01-06 18:33:05 +03:00
|
|
|
For more information about an error, try `rustc --explain E0046`.
|