&format!("`{}` must come before `{}`", invalid_qual, current_qual),
format!("{} {}", invalid_qual, current_qual),
Applicability::MachineApplicable,
- ).note("keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`");
+ ).note("keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`");
}
}
Err(err)
&format!("`{misplaced_qual}` must come before `{current_qual}`"),
format!("{misplaced_qual} {current_qual}"),
Applicability::MachineApplicable,
- ).note("keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`");
+ ).note("keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`");
}
}
// Recover incorrect visibility order such as `async pub`
| | expected one of `extern`, `fn`, or `unsafe`
| help: `const` must come before `async`: `const async`
|
- = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+ = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
error: aborting due to previous error
LL | }
| - the item list ends here
|
- = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+ = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
error: expected one of `extern` or `fn`, found keyword `async`
--> $DIR/no-unsafe-async.rs:11:8
| | expected one of `extern` or `fn`
| help: `async` must come before `unsafe`: `async unsafe`
|
- = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+ = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
error: aborting due to 2 previous errors
--- /dev/null
+// edition:2018
+
+default pub const async unsafe extern fn err() {} //~ ERROR `default` is not followed by an item
+//~^ ERROR expected item, found keyword `pub`
+
+pub default const async unsafe extern fn ok() {}
--- /dev/null
+error: `default` is not followed by an item
+ --> $DIR/keyword-order.rs:3:1
+ |
+LL | default pub const async unsafe extern fn err() {}
+ | ^^^^^^^ the `default` qualifier
+ |
+ = note: only `fn`, `const`, `type`, or `impl` items may be prefixed by `default`
+
+error: expected item, found keyword `pub`
+ --> $DIR/keyword-order.rs:3:9
+ |
+LL | default pub const async unsafe extern fn err() {}
+ | ^^^ expected item
+
+error: aborting due to 2 previous errors
+
LL | }
| - the item list ends here
|
- = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+ = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
error: aborting due to previous error
//~| NOTE expected one of `extern` or `fn`
//~| HELP `const` must come before `async unsafe`
//~| SUGGESTION const async unsafe
-//~| NOTE keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+//~| NOTE keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
| | expected one of `extern` or `fn`
| help: `const` must come before `async unsafe`: `const async unsafe`
|
- = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+ = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
error: aborting due to previous error
//~| NOTE expected one of `extern` or `fn`
//~| HELP `async` must come before `unsafe`
//~| SUGGESTION async unsafe
-//~| NOTE keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+//~| NOTE keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
| | expected one of `extern` or `fn`
| help: `async` must come before `unsafe`: `async unsafe`
|
- = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+ = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
error: aborting due to previous error
//~| NOTE expected one of `extern` or `fn`
//~| HELP `const` must come before `unsafe`
//~| SUGGESTION const unsafe
-//~| NOTE keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+//~| NOTE keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
| | expected one of `extern` or `fn`
| help: `const` must come before `unsafe`: `const unsafe`
|
- = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+ = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
error: aborting due to previous error
//~| NOTE expected `fn`
//~| HELP `unsafe` must come before `extern`
//~| SUGGESTION unsafe extern
-//~| NOTE keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+//~| NOTE keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
| | expected `fn`
| help: `unsafe` must come before `extern`: `unsafe extern`
|
- = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+ = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
error: aborting due to previous error