-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not allow safe usafe on static and fn items
- Loading branch information
1 parent
cb8a7ea
commit 8711347
Showing
5 changed files
with
47 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
safe fn foo() {} | ||
//~^ ERROR: items cannot be declared with `safe` safety qualifier | ||
|
||
safe static FOO: i32 = 1; | ||
//~^ ERROR: items cannot be declared with `safe` safety qualifier | ||
|
||
fn main() {} |
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,14 @@ | ||
error: items cannot be declared with `safe` safety qualifier | ||
--> $DIR/safe-outside-extern.rs:1:1 | ||
| | ||
LL | safe fn foo() {} | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: items cannot be declared with `safe` safety qualifier | ||
--> $DIR/safe-outside-extern.rs:4:1 | ||
| | ||
LL | safe static FOO: i32 = 1; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|