Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
51b51b51d7931da85280382a81c4dd80c73ca754
rust/tests/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.fixed

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
101 B
Rust
Raw Normal View History

Expect extern fn with no body when parsing Also add a test case for inserting a semicolon on extern fns. Without this fix, we got an error like this: error: expected one of `->`, `where`, or `{`, found `}` --> chk.rs:3:1 | 2 | fn foo() | --- - expected one of `->`, `where`, or `{` | | | while parsing this `fn` 3 | } | ^ unexpected token Since this is inside an extern block, you're required to write function prototypes with no body. This fixes a regression, and adds a test case for it.
2021-12-06 11:07:34 -07:00
//@ run-rustfix
#[allow(dead_code)]
extern "C" {
fn foo(); //~ERROR expected `;`
}
fn main() {}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 3020ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API