]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/default.stderr
Detect pub fn attr wrong order like `async pub`
[rust.git] / src / test / ui / parser / default.stderr
1 error: expected one of `async`, `const`, `extern`, `fn`, `pub`, `unsafe`, or `use`, found keyword `pub`
2   --> $DIR/default.rs:24:13
3    |
4 LL | impl Foo for u32 {
5    |                  - while parsing this item list starting here
6 LL |     default pub fn foo<T: Default>() -> T { T::default() }
7    |             ^^^
8    |             |
9    |             expected one of 7 possible tokens
10    |             help: visibility `pub` must come before `default pub`: `pub default pub`
11 LL |
12 LL | }
13    | - the item list ends here
14
15 error[E0449]: unnecessary visibility qualifier
16   --> $DIR/default.rs:18:5
17    |
18 LL |     pub default fn foo<T: Default>() -> T {
19    |     ^^^ `pub` not permitted here because it's implied
20
21 warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
22   --> $DIR/default.rs:4:12
23    |
24 LL | #![feature(specialization)]
25    |            ^^^^^^^^^^^^^^
26    |
27    = note: `#[warn(incomplete_features)]` on by default
28    = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
29    = help: consider using `min_specialization` instead, which is more stable and complete
30
31 error[E0046]: not all trait items implemented, missing: `foo`
32   --> $DIR/default.rs:23:1
33    |
34 LL |     fn foo<T: Default>() -> T;
35    |     -------------------------- `foo` from trait
36 ...
37 LL | impl Foo for u32 {
38    | ^^^^^^^^^^^^^^^^ missing `foo` in implementation
39
40 error: aborting due to 3 previous errors; 1 warning emitted
41
42 Some errors have detailed explanations: E0046, E0449.
43 For more information about an error, try `rustc --explain E0046`.