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

Deny clashing extern declarations by default. #75192

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc_lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {

declare_lint! {
pub CLASHING_EXTERN_DECLARATIONS,
Warn,
Deny,
"detects when an extern fn has been declared with the same name but different types"
}

Expand Down
38 changes: 0 additions & 38 deletions src/test/ui/abi/auxiliary/foreign_lib.rs

This file was deleted.

3 changes: 3 additions & 0 deletions src/test/ui/abi/foreign/auxiliary/foreign_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ pub mod rustrt3 {
// importing the same symbol under different types.
// See https://github.com/rust-lang/rust/issues/32740.
extern {
// NOTE: Allow clashing decl here as we want this test case to catch ICE or LLVM assert
// failures if the lint has been allowed.
#[allow(clashing_extern_declarations)]
pub fn rust_get_test_int() -> *const u8;
}
}
Expand Down