mirror of
https://github.com/servo/servo
synced 2026-05-03 12:52:25 +02:00
script_bindings Start wrapping unsafe code in unsafe {} (#38545)
This is useful to better isolate `unsafe` code. Once all unsafe calls are wrapped we can enable the Rust warning. This also explicitly disables the warning for generated code, which is a much more difficult task. After this change there are 211 warnings left in `script_bindings`. Testing: This should not change behavior and is thus covered by existing tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
@@ -53,11 +53,22 @@ from configuration import (
|
||||
)
|
||||
|
||||
AUTOGENERATED_WARNING_COMMENT = "/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n\n"
|
||||
ALLOWED_WARNING_LIST = ['non_camel_case_types', 'non_upper_case_globals', 'unused_imports',
|
||||
'unused_variables', 'unused_assignments', 'unused_mut',
|
||||
'clippy::approx_constant', 'clippy::enum_variant_names', 'clippy::let_unit_value',
|
||||
'clippy::needless_return', 'clippy::too_many_arguments', 'clippy::unnecessary_cast',
|
||||
'clippy::upper_case_acronyms']
|
||||
ALLOWED_WARNING_LIST = [
|
||||
'non_camel_case_types',
|
||||
'non_upper_case_globals',
|
||||
'unsafe_op_in_unsafe_fn',
|
||||
'unused_imports',
|
||||
'unused_variables',
|
||||
'unused_assignments',
|
||||
'unused_mut',
|
||||
'clippy::approx_constant',
|
||||
'clippy::enum_variant_names',
|
||||
'clippy::let_unit_value',
|
||||
'clippy::needless_return',
|
||||
'clippy::too_many_arguments',
|
||||
'clippy::unnecessary_cast',
|
||||
'clippy::upper_case_acronyms'
|
||||
]
|
||||
ALLOWED_WARNINGS = f"#![allow({','.join(ALLOWED_WARNING_LIST)})]\n\n"
|
||||
|
||||
FINALIZE_HOOK_NAME = '_finalize'
|
||||
|
||||
Reference in New Issue
Block a user