-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add test for issue 47446 - Implement the new lint lint_builtin_mixed_export_name_and_no_mangle - Add suggestion how to fix it
- Loading branch information
Showing
6 changed files
with
106 additions
and
0 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,7 @@ | ||
// issue: rust-lang/rust#47446 | ||
|
||
#[no_mangle] | ||
#[export_name = "foo"] | ||
pub fn bar() {} | ||
|
||
fn main() {} |
17 changes: 17 additions & 0 deletions
17
tests/ui/attributes/mixed_export_name_and_no_mangle.stderr
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,17 @@ | ||
warning: the attribute `export_name` may not be used in combination with `no_mangle` | ||
--> $DIR/E47446.rs:2:1 | ||
| | ||
LL | #[export_name = "foo"] | ||
| ^^^^^^^^^^^^^^^^^^^^^^ `export_name` takes precedence | ||
| | ||
= note: when `export_name` is used `no_mangle` is ignored | ||
note: the `no_mangle` attribute is ignored | ||
--> $DIR/E47446.rs:1:1 | ||
| | ||
LL | #[no_mangle] | ||
| ^^^^^^^^^^^^ | ||
= note: `#[warn(mixed_export_name_and_no_mangle)]` on by default | ||
help: remove the `no_mangle` attribute | ||
| | ||
LL - #[no_mangle] | ||
| |