]> git.proxmox.com Git - rustc.git/blame - src/test/ui/parser/issue-87217-keyword-order/wrong-async.rs
New upstream version 1.57.0+dfsg1
[rustc.git] / src / test / ui / parser / issue-87217-keyword-order / wrong-async.rs
CommitLineData
94222f64
XL
1// edition:2018
2
3// There is an order to respect for keywords before a function:
4// `<visibility>, const, async, unsafe, extern, "<ABI>"`
5//
6// This test ensures the compiler is helpful about them being misplaced.
7// Visibilities are tested elsewhere.
8
9unsafe async fn test() {}
10//~^ ERROR expected one of `extern` or `fn`, found keyword `async`
11//~| NOTE expected one of `extern` or `fn`
12//~| HELP `async` must come before `unsafe`
13//~| SUGGESTION async unsafe
14//~| NOTE keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`