Skip to content

Commit 39934be

Browse files
Merge #397
397: Ignore non snake case types that can exist in SVD files r=therealprof a=mvertescher Hi! 👋 Thanks for this awesome project! I've run into a build error generating bindings for the [psoc6-pac](https://github.com/psoc-rs/psoc6-pac). Here's a example of one of the many build failures: ``` error: structure field `data_list_sent_update__status` should have a snake case name --> src/ble.rs:187:9 | 187 | pub data_list_sent_update__status: self::blell::DATA_LIST_SENT_UPDATE__STATUS, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `data_list_sent_update_status` ``` This issue is caused by `#![deny(warnings)]` and should be fixed by adding the `#![allow(non_snake_case)]` exception. There may be alternative fixes, I'm open to suggestions! Co-authored-by: Matt Vertescher <[email protected]>
2 parents f7cb4c3 + 73cfa74 commit 39934be

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)