-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Orion Gonzalez
committed
Oct 2, 2024
1 parent
44722bd
commit faf1c5f
Showing
8 changed files
with
107 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mod m { | ||
pub let answer = 42; | ||
//~^ ERROR visibility `pub` is not followed by an item | ||
//~| ERROR expected item, found keyword `let` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
error: visibility `pub` is not followed by an item | ||
--> $DIR/pub-let-outside-fn.rs:2:5 | ||
| | ||
LL | pub let answer = 42; | ||
| ^^^ the visibility | ||
| | ||
= help: you likely meant to define an item, e.g., `pub fn foo() {}` | ||
|
||
error: expected item, found keyword `let` | ||
--> $DIR/pub-let-outside-fn.rs:2:9 | ||
| | ||
LL | pub let answer = 42; | ||
| ^^^------------- | ||
| | | ||
| unexpected `let` binding outside of a function | ||
| | ||
= help: consider using `const` or `static` instead of `let` for global variables, or put it inside of a function: fn foo() { let answer = 42; } | ||
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html> | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters