Skip to content

Commit 73cfa74

Browse files
committed
Deny a subset of warnings instead of all in the generated lib.rs
This change decreases the chance of Rust build failures when SVD files have strange formatting for types. The changelog has also been updated.
1 parent f7cb4c3 commit 73cfa74

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1515

1616
- Enum items now associated with values (C-style), enums annotated with `repr(fty)`
1717
- Bump `svd-parser` dependency (0.8.1)
18+
- Switched from denying all warnings to only a subset.
1819

1920
## [v0.16.1] - 2019-08-17
2021

src/generate/device.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,29 @@ pub fn render(
4545

4646
out.push(quote! {
4747
#![doc = #doc]
48+
// Deny a subset of warnings
49+
#![deny(const_err)]
50+
#![deny(dead_code)]
51+
#![deny(improper_ctypes)]
52+
#![deny(legacy_directory_ownership)]
4853
#![deny(missing_docs)]
49-
#![deny(warnings)]
54+
#![deny(no_mangle_generic_items)]
55+
#![deny(non_shorthand_field_patterns)]
56+
#![deny(overflowing_literals)]
57+
#![deny(path_statements)]
58+
#![deny(patterns_in_fns_without_body)]
59+
#![deny(plugin_as_library)]
60+
#![deny(private_in_public)]
61+
#![deny(safe_extern_statics)]
62+
#![deny(unconditional_recursion)]
63+
#![deny(unions_with_drop_fields)]
64+
#![deny(unused_allocation)]
65+
#![deny(unused_comparisons)]
66+
#![deny(unused_parens)]
67+
#![deny(while_true)]
68+
// Explicitly allow a few warnings that may be verbose
5069
#![allow(non_camel_case_types)]
70+
#![allow(non_snake_case)]
5171
#![no_std]
5272
});
5373

0 commit comments

Comments
 (0)