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.
This commit is contained in:
parent
cf577f34c4
commit
4d1c16c09c
8 changed files with 11 additions and 54 deletions
|
@ -974,6 +974,3 @@ lint_use_let_underscore_ignore_suggestion = use `let _ = ...` to ignore the expr
|
||||||
|
|
||||||
lint_variant_size_differences =
|
lint_variant_size_differences =
|
||||||
enum variant is more than three times larger ({$largest} bytes) than the next largest
|
enum variant is more than three times larger ({$largest} bytes) than the next largest
|
||||||
|
|
||||||
lint_wasm_c_abi =
|
|
||||||
older versions of the `wasm-bindgen` crate will be incompatible with future versions of Rust; please update to `wasm-bindgen` v0.2.88
|
|
||||||
|
|
|
@ -430,7 +430,6 @@ pub(super) fn decorate_lint(
|
||||||
BuiltinLintDiag::UnusedCrateDependency { extern_crate, local_crate } => {
|
BuiltinLintDiag::UnusedCrateDependency { extern_crate, local_crate } => {
|
||||||
lints::UnusedCrateDependency { extern_crate, local_crate }.decorate_lint(diag)
|
lints::UnusedCrateDependency { extern_crate, local_crate }.decorate_lint(diag)
|
||||||
}
|
}
|
||||||
BuiltinLintDiag::WasmCAbi => lints::WasmCAbi.decorate_lint(diag),
|
|
||||||
BuiltinLintDiag::IllFormedAttributeInput { suggestions } => {
|
BuiltinLintDiag::IllFormedAttributeInput { suggestions } => {
|
||||||
lints::IllFormedAttributeInput {
|
lints::IllFormedAttributeInput {
|
||||||
num_suggestions: suggestions.len(),
|
num_suggestions: suggestions.len(),
|
||||||
|
|
|
@ -2561,10 +2561,6 @@ pub(crate) struct UnusedCrateDependency {
|
||||||
pub local_crate: Symbol,
|
pub local_crate: Symbol,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(LintDiagnostic)]
|
|
||||||
#[diag(lint_wasm_c_abi)]
|
|
||||||
pub(crate) struct WasmCAbi;
|
|
||||||
|
|
||||||
#[derive(LintDiagnostic)]
|
#[derive(LintDiagnostic)]
|
||||||
#[diag(lint_ill_formed_attribute_input)]
|
#[diag(lint_ill_formed_attribute_input)]
|
||||||
pub(crate) struct IllFormedAttributeInput {
|
pub(crate) struct IllFormedAttributeInput {
|
||||||
|
|
|
@ -143,7 +143,6 @@ declare_lint_pass! {
|
||||||
UNUSED_VARIABLES,
|
UNUSED_VARIABLES,
|
||||||
USELESS_DEPRECATED,
|
USELESS_DEPRECATED,
|
||||||
WARNINGS,
|
WARNINGS,
|
||||||
WASM_C_ABI,
|
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -4647,44 +4646,6 @@ declare_lint! {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
declare_lint! {
|
|
||||||
/// The `wasm_c_abi` lint detects crate dependencies that are incompatible
|
|
||||||
/// with future versions of Rust that will emit spec-compliant C ABI.
|
|
||||||
///
|
|
||||||
/// ### Example
|
|
||||||
///
|
|
||||||
/// ```rust,ignore (needs extern crate)
|
|
||||||
/// #![deny(wasm_c_abi)]
|
|
||||||
/// ```
|
|
||||||
///
|
|
||||||
/// This will produce:
|
|
||||||
///
|
|
||||||
/// ```text
|
|
||||||
/// error: the following packages contain code that will be rejected by a future version of Rust: wasm-bindgen v0.2.87
|
|
||||||
/// |
|
|
||||||
/// note: the lint level is defined here
|
|
||||||
/// --> src/lib.rs:1:9
|
|
||||||
/// |
|
|
||||||
/// 1 | #![deny(wasm_c_abi)]
|
|
||||||
/// | ^^^^^^^^^^
|
|
||||||
/// ```
|
|
||||||
///
|
|
||||||
/// ### Explanation
|
|
||||||
///
|
|
||||||
/// Rust has historically emitted non-spec-compliant C ABI. This has caused
|
|
||||||
/// incompatibilities between other compilers and Wasm targets. In a future
|
|
||||||
/// version of Rust this will be fixed and therefore dependencies relying
|
|
||||||
/// on the non-spec-compliant C ABI will stop functioning.
|
|
||||||
pub WASM_C_ABI,
|
|
||||||
Deny,
|
|
||||||
"detects dependencies that are incompatible with the Wasm C ABI",
|
|
||||||
@future_incompatible = FutureIncompatibleInfo {
|
|
||||||
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
|
|
||||||
reference: "issue #71871 <https://github.com/rust-lang/rust/issues/71871>",
|
|
||||||
};
|
|
||||||
crate_level_only
|
|
||||||
}
|
|
||||||
|
|
||||||
declare_lint! {
|
declare_lint! {
|
||||||
/// The `uncovered_param_in_projection` lint detects a violation of one of Rust's orphan rules for
|
/// The `uncovered_param_in_projection` lint detects a violation of one of Rust's orphan rules for
|
||||||
/// foreign trait implementations that concerns the use of type parameters inside trait associated
|
/// foreign trait implementations that concerns the use of type parameters inside trait associated
|
||||||
|
|
|
@ -783,7 +783,6 @@ pub enum BuiltinLintDiag {
|
||||||
extern_crate: Symbol,
|
extern_crate: Symbol,
|
||||||
local_crate: Symbol,
|
local_crate: Symbol,
|
||||||
},
|
},
|
||||||
WasmCAbi,
|
|
||||||
IllFormedAttributeInput {
|
IllFormedAttributeInput {
|
||||||
suggestions: Vec<String>,
|
suggestions: Vec<String>,
|
||||||
},
|
},
|
||||||
|
|
|
@ -290,6 +290,9 @@ metadata_unsupported_abi =
|
||||||
metadata_unsupported_abi_i686 =
|
metadata_unsupported_abi_i686 =
|
||||||
ABI not supported by `#[link(kind = "raw-dylib")]` on i686
|
ABI not supported by `#[link(kind = "raw-dylib")]` on i686
|
||||||
|
|
||||||
|
metadata_wasm_c_abi =
|
||||||
|
older versions of the `wasm-bindgen` crate are incompatible with current versions of Rust; please update to `wasm-bindgen` v0.2.88
|
||||||
|
|
||||||
metadata_wasm_import_form =
|
metadata_wasm_import_form =
|
||||||
wasm import module must be of the form `wasm_import_module = "string"`
|
wasm import module must be of the form `wasm_import_module = "string"`
|
||||||
|
|
||||||
|
|
|
@ -1076,12 +1076,7 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
|
||||||
// Make a point span rather than covering the whole file
|
// Make a point span rather than covering the whole file
|
||||||
let span = krate.spans.inner_span.shrink_to_lo();
|
let span = krate.spans.inner_span.shrink_to_lo();
|
||||||
|
|
||||||
self.sess.psess.buffer_lint(
|
self.sess.dcx().emit_err(errors::WasmCAbi { span });
|
||||||
lint::builtin::WASM_C_ABI,
|
|
||||||
span,
|
|
||||||
ast::CRATE_NODE_ID,
|
|
||||||
BuiltinLintDiag::WasmCAbi,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -732,3 +732,10 @@ pub struct ImportNameTypeRaw {
|
||||||
#[primary_span]
|
#[primary_span]
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Diagnostic)]
|
||||||
|
#[diag(metadata_wasm_c_abi)]
|
||||||
|
pub(crate) struct WasmCAbi {
|
||||||
|
#[primary_span]
|
||||||
|
pub span: Span,
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue