Skip to content

Commit bbe3690

Browse files
committed
Make the wasm_c_abi future compat warning a hard error
This is the next step in getting rid of the broken C abi for wasm32-unknown-unknown.
1 parent b5741a3 commit bbe3690

File tree

8 files changed

+11
-54
lines changed

8 files changed

+11
-54
lines changed

compiler/rustc_lint/messages.ftl

-3
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,3 @@ lint_use_let_underscore_ignore_suggestion = use `let _ = ...` to ignore the expr
972972
973973
lint_variant_size_differences =
974974
enum variant is more than three times larger ({$largest} bytes) than the next largest
975-
976-
lint_wasm_c_abi =
977-
older versions of the `wasm-bindgen` crate will be incompatible with future versions of Rust; please update to `wasm-bindgen` v0.2.88

compiler/rustc_lint/src/early/diagnostics.rs

-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ pub(super) fn decorate_lint(
430430
BuiltinLintDiag::UnusedCrateDependency { extern_crate, local_crate } => {
431431
lints::UnusedCrateDependency { extern_crate, local_crate }.decorate_lint(diag)
432432
}
433-
BuiltinLintDiag::WasmCAbi => lints::WasmCAbi.decorate_lint(diag),
434433
BuiltinLintDiag::IllFormedAttributeInput { suggestions } => {
435434
lints::IllFormedAttributeInput {
436435
num_suggestions: suggestions.len(),

compiler/rustc_lint/src/lints.rs

-4
Original file line numberDiff line numberDiff line change
@@ -2559,10 +2559,6 @@ pub(crate) struct UnusedCrateDependency {
25592559
pub local_crate: Symbol,
25602560
}
25612561

2562-
#[derive(LintDiagnostic)]
2563-
#[diag(lint_wasm_c_abi)]
2564-
pub(crate) struct WasmCAbi;
2565-
25662562
#[derive(LintDiagnostic)]
25672563
#[diag(lint_ill_formed_attribute_input)]
25682564
pub(crate) struct IllFormedAttributeInput {

compiler/rustc_lint_defs/src/builtin.rs

-39
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ declare_lint_pass! {
143143
UNUSED_VARIABLES,
144144
USELESS_DEPRECATED,
145145
WARNINGS,
146-
WASM_C_ABI,
147146
// tidy-alphabetical-end
148147
]
149148
}
@@ -4647,44 +4646,6 @@ declare_lint! {
46474646
};
46484647
}
46494648

4650-
declare_lint! {
4651-
/// The `wasm_c_abi` lint detects crate dependencies that are incompatible
4652-
/// with future versions of Rust that will emit spec-compliant C ABI.
4653-
///
4654-
/// ### Example
4655-
///
4656-
/// ```rust,ignore (needs extern crate)
4657-
/// #![deny(wasm_c_abi)]
4658-
/// ```
4659-
///
4660-
/// This will produce:
4661-
///
4662-
/// ```text
4663-
/// error: the following packages contain code that will be rejected by a future version of Rust: wasm-bindgen v0.2.87
4664-
/// |
4665-
/// note: the lint level is defined here
4666-
/// --> src/lib.rs:1:9
4667-
/// |
4668-
/// 1 | #![deny(wasm_c_abi)]
4669-
/// | ^^^^^^^^^^
4670-
/// ```
4671-
///
4672-
/// ### Explanation
4673-
///
4674-
/// Rust has historically emitted non-spec-compliant C ABI. This has caused
4675-
/// incompatibilities between other compilers and Wasm targets. In a future
4676-
/// version of Rust this will be fixed and therefore dependencies relying
4677-
/// on the non-spec-compliant C ABI will stop functioning.
4678-
pub WASM_C_ABI,
4679-
Deny,
4680-
"detects dependencies that are incompatible with the Wasm C ABI",
4681-
@future_incompatible = FutureIncompatibleInfo {
4682-
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
4683-
reference: "issue #71871 <https://github.com/rust-lang/rust/issues/71871>",
4684-
};
4685-
crate_level_only
4686-
}
4687-
46884649
declare_lint! {
46894650
/// The `uncovered_param_in_projection` lint detects a violation of one of Rust's orphan rules for
46904651
/// foreign trait implementations that concerns the use of type parameters inside trait associated

compiler/rustc_lint_defs/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,6 @@ pub enum BuiltinLintDiag {
783783
extern_crate: Symbol,
784784
local_crate: Symbol,
785785
},
786-
WasmCAbi,
787786
IllFormedAttributeInput {
788787
suggestions: Vec<String>,
789788
},

compiler/rustc_metadata/messages.ftl

+3
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ metadata_unsupported_abi =
290290
metadata_unsupported_abi_i686 =
291291
ABI not supported by `#[link(kind = "raw-dylib")]` on i686
292292
293+
metadata_wasm_c_abi =
294+
older versions of the `wasm-bindgen` crate are incompatible with current versions of Rust; please update to `wasm-bindgen` v0.2.88
295+
293296
metadata_wasm_import_form =
294297
wasm import module must be of the form `wasm_import_module = "string"`
295298

compiler/rustc_metadata/src/creader.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -1076,12 +1076,7 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
10761076
// Make a point span rather than covering the whole file
10771077
let span = krate.spans.inner_span.shrink_to_lo();
10781078

1079-
self.sess.psess.buffer_lint(
1080-
lint::builtin::WASM_C_ABI,
1081-
span,
1082-
ast::CRATE_NODE_ID,
1083-
BuiltinLintDiag::WasmCAbi,
1084-
);
1079+
self.sess.dcx().emit_err(errors::WasmCAbi { span });
10851080
}
10861081
}
10871082

compiler/rustc_metadata/src/errors.rs

+7
Original file line numberDiff line numberDiff line change
@@ -732,3 +732,10 @@ pub struct ImportNameTypeRaw {
732732
#[primary_span]
733733
pub span: Span,
734734
}
735+
736+
#[derive(Diagnostic)]
737+
#[diag(metadata_wasm_c_abi)]
738+
pub(crate) struct WasmCAbi {
739+
#[primary_span]
740+
pub span: Span,
741+
}

0 commit comments

Comments
 (0)