fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.1 KiB38 linesraw
1error: `default` is not followed by an item
2  --> $DIR/default.rs:22:5
3   |
4LL |     default pub fn foo<T: Default>() -> T { T::default() }
5   |     ^^^^^^^ the `default` qualifier
6   |
7   = note: only `fn`, `const`, `type`, or `impl` items may be prefixed by `default`
8
9error: non-item in item list
10  --> $DIR/default.rs:22:13
11   |
12LL | impl Foo for u32 {
13   |                  - item list starts here
14LL |     default pub fn foo<T: Default>() -> T { T::default() }
15   |             ^^^ non-item starts here
16...
17LL | }
18   | - item list ends here
19
20error[E0449]: unnecessary visibility qualifier
21  --> $DIR/default.rs:16:5
22   |
23LL |     pub default fn foo<T: Default>() -> T {
24   |     ^^^ `pub` not permitted here because it's implied
25
26error[E0046]: not all trait items implemented, missing: `foo`
27  --> $DIR/default.rs:21:1
28   |
29LL |     fn foo<T: Default>() -> T;
30   |     -------------------------- `foo` from trait
31...
32LL | impl Foo for u32 {
33   | ^^^^^^^^^^^^^^^^ missing `foo` in implementation
34
35error: aborting due to 4 previous errors
36
37Some errors have detailed explanations: E0046, E0449.
38For more information about an error, try `rustc --explain E0046`.