-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing error message with unsafe functions in extern blocks #27361
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
Comments
unsafe
, found unsafe
That code sample probably didn't require linking to a playpen, I've made the description and title more useful. |
birkenfeld
added a commit
to birkenfeld/rust
that referenced
this issue
May 2, 2016
The changed line makes it look like `unsafe` is allowed, but the first statement of `parse_item_foreign_fn` is: `self.expect_keyword(keywords::Fn)?;` So we get the strange "expected one of `fn`, `pub`, `static`, or `unsafe`, found `unsafe`". Fixes: rust-lang#27361
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
May 5, 2016
parser: do not try to continue with `unsafe` on foreign fns The changed line makes it look like `unsafe` is allowed, but the first statement of `parse_item_foreign_fn` is: ``` self.expect_keyword(keywords::Fn)?; ``` So we get the strange "expected one of `fn`, `pub`, `static`, or `unsafe`, found `unsafe`". Fixes: rust-lang#27361
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
May 5, 2016
parser: do not try to continue with `unsafe` on foreign fns The changed line makes it look like `unsafe` is allowed, but the first statement of `parse_item_foreign_fn` is: ``` self.expect_keyword(keywords::Fn)?; ``` So we get the strange "expected one of `fn`, `pub`, `static`, or `unsafe`, found `unsafe`". Fixes: rust-lang#27361
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
May 5, 2016
parser: do not try to continue with `unsafe` on foreign fns The changed line makes it look like `unsafe` is allowed, but the first statement of `parse_item_foreign_fn` is: ``` self.expect_keyword(keywords::Fn)?; ``` So we get the strange "expected one of `fn`, `pub`, `static`, or `unsafe`, found `unsafe`". Fixes: rust-lang#27361
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
May 6, 2016
parser: do not try to continue with `unsafe` on foreign fns The changed line makes it look like `unsafe` is allowed, but the first statement of `parse_item_foreign_fn` is: ``` self.expect_keyword(keywords::Fn)?; ``` So we get the strange "expected one of `fn`, `pub`, `static`, or `unsafe`, found `unsafe`". Fixes: rust-lang#27361
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
May 7, 2016
parser: do not try to continue with `unsafe` on foreign fns The changed line makes it look like `unsafe` is allowed, but the first statement of `parse_item_foreign_fn` is: ``` self.expect_keyword(keywords::Fn)?; ``` So we get the strange "expected one of `fn`, `pub`, `static`, or `unsafe`, found `unsafe`". Fixes: rust-lang#27361
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
May 7, 2016
parser: do not try to continue with `unsafe` on foreign fns The changed line makes it look like `unsafe` is allowed, but the first statement of `parse_item_foreign_fn` is: ``` self.expect_keyword(keywords::Fn)?; ``` So we get the strange "expected one of `fn`, `pub`, `static`, or `unsafe`, found `unsafe`". Fixes: rust-lang#27361
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
May 7, 2016
parser: do not try to continue with `unsafe` on foreign fns The changed line makes it look like `unsafe` is allowed, but the first statement of `parse_item_foreign_fn` is: ``` self.expect_keyword(keywords::Fn)?; ``` So we get the strange "expected one of `fn`, `pub`, `static`, or `unsafe`, found `unsafe`". Fixes: rust-lang#27361
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code produces "error: expected one of
fn
,pub
,static
, orunsafe
, foundunsafe
":The text was updated successfully, but these errors were encountered: