aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/macros/src/lib.rs
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2019-12-29 20:05:09 +0100
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2019-12-29 20:05:09 +0100
commit6cfbff156b9475da4a2fd3bdaed12244a79085bd (patch)
tree133556d2c99b0796039f606f97d6d3d4bdffe09c /cortex-m-rt/macros/src/lib.rs
parent1b5da39d9d1c3bc6558585a6ecf8ce2448ff82fd (diff)
downloadcortex-m-6cfbff156b9475da4a2fd3bdaed12244a79085bd.tar.gz
cortex-m-6cfbff156b9475da4a2fd3bdaed12244a79085bd.tar.zst
cortex-m-6cfbff156b9475da4a2fd3bdaed12244a79085bd.zip
Changed to whitelist
Diffstat (limited to 'cortex-m-rt/macros/src/lib.rs')
-rw-r--r--cortex-m-rt/macros/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/cortex-m-rt/macros/src/lib.rs b/cortex-m-rt/macros/src/lib.rs
index 9755153..803915c 100644
--- a/cortex-m-rt/macros/src/lib.rs
+++ b/cortex-m-rt/macros/src/lib.rs
@@ -832,7 +832,7 @@ fn extract_cfgs(attrs: Vec<Attribute>) -> (Vec<Attribute>, Vec<Attribute>) {
fn check_for_blacklisted_attrs(attrs: &[Attribute]) -> Option<TokenStream> {
if let Some(val) = containts_blacklist_attrs(attrs) {
- return Some(parse::Error::new(val.span(), "This attribute is not allowed [blacklisted]")
+ return Some(parse::Error::new(val.span(), "this attribute is not allowed on a function controlled by cortex-m-rt")
.to_compile_error()
.into());
}
@@ -841,11 +841,11 @@ fn check_for_blacklisted_attrs(attrs: &[Attribute]) -> Option<TokenStream> {
}
fn containts_blacklist_attrs(attrs: &[Attribute]) -> Option<Attribute> {
- let blacklist = &["inline", "export_name", "no_mangle", "must_use"];
+ let whitelist = &["doc", "link_section"];
for attr in attrs {
- for val in blacklist {
- if eq(&attr, &val) {
+ for val in whitelist {
+ if !eq(&attr, &val) {
return Some(attr.clone());
}
}