Skip to content
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

Recover from 'public' in 'pub' position #99653

Closed
lopopolo opened this issue Jul 23, 2022 · 2 comments
Closed

Recover from 'public' in 'pub' position #99653

lopopolo opened this issue Jul 23, 2022 · 2 comments
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lopopolo
Copy link
Contributor

lopopolo commented Jul 23, 2022

Given the following code:

public enum Range {
    Valid {
        begin: u32,
        len: u32,
    }
    Out,
}

public struct X(u32);

public fn foo() -> ! { loop {} }

public extern "C" fn foobar() -> i32 { 7 }

public trait Again {}

The current output is:

   Compiling playground v0.0.1 (/playground)
error: expected one of `!` or `::`, found keyword `enum`
 --> src/lib.rs:1:8
  |
1 | public enum Range {
  |        ^^^^ expected one of `!` or `::`

error: could not compile `playground` due to previous error

Ideally the output should look like:

Suggest replacing public with pub.

@lopopolo lopopolo added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 23, 2022
@gimbling-away
Copy link
Contributor

@rustbot claim

@lopopolo
Copy link
Contributor Author

lopopolo commented Aug 1, 2022

I think this was fixed in #99903.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants