]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/parser/default.stderr
Merge commit '40dd3e2b7089b5e96714e064b731f6dbf17c61a9' into sync_cg_clif-2021-05-27
[rust.git] / src / test / ui / parser / default.stderr
index 489613b1e096598aa3fc85324f39df2e87647a22..5b763ae72f5eee88fdf9ead93d1fbce7981eaf9e 100644 (file)
@@ -1,25 +1,30 @@
-error: expected one of `async`, `const`, `extern`, `fn`, `pub`, `unsafe`, or `use`, found keyword `pub`
-  --> $DIR/default.rs:24:13
+error: `default` is not followed by an item
+  --> $DIR/default.rs:23:5
+   |
+LL |     default pub fn foo<T: Default>() -> T { T::default() }
+   |     ^^^^^^^ the `default` qualifier
+   |
+   = note: only `fn`, `const`, `type`, or `impl` items may be prefixed by `default`
+
+error: non-item in item list
+  --> $DIR/default.rs:23:13
    |
 LL | impl Foo for u32 {
-   |                  - while parsing this item list starting here
+   |                  - item list starts here
 LL |     default pub fn foo<T: Default>() -> T { T::default() }
-   |             ^^^
-   |             |
-   |             expected one of 7 possible tokens
-   |             help: visibility `pub` must come before `default pub`: `pub default pub`
-LL |
+   |             ^^^ non-item starts here
+...
 LL | }
-   | - the item list ends here
+   | - item list ends here
 
 error[E0449]: unnecessary visibility qualifier
-  --> $DIR/default.rs:18:5
+  --> $DIR/default.rs:17:5
    |
 LL |     pub default fn foo<T: Default>() -> T {
    |     ^^^ `pub` not permitted here because it's implied
 
 warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
-  --> $DIR/default.rs:4:12
+  --> $DIR/default.rs:3:12
    |
 LL | #![feature(specialization)]
    |            ^^^^^^^^^^^^^^
@@ -29,7 +34,7 @@ LL | #![feature(specialization)]
    = help: consider using `min_specialization` instead, which is more stable and complete
 
 error[E0046]: not all trait items implemented, missing: `foo`
-  --> $DIR/default.rs:23:1
+  --> $DIR/default.rs:22:1
    |
 LL |     fn foo<T: Default>() -> T;
    |     -------------------------- `foo` from trait
@@ -37,7 +42,7 @@ LL |     fn foo<T: Default>() -> T;
 LL | impl Foo for u32 {
    | ^^^^^^^^^^^^^^^^ missing `foo` in implementation
 
-error: aborting due to 3 previous errors; 1 warning emitted
+error: aborting due to 4 previous errors; 1 warning emitted
 
 Some errors have detailed explanations: E0046, E0449.
 For more information about an error, try `rustc --explain E0046`.