diff options
author | 2018-11-04 00:38:19 +0000 | |
---|---|---|
committer | 2018-11-04 00:38:19 +0000 | |
commit | 3e0bbeec390068f6b205060d9a236a8064abd3bf (patch) | |
tree | 177290bf54b326717157b43568006a42b16387d7 /cortex-m-rt/src/lib.rs | |
parent | 2f890d87b1945f1f901355b94375d2531fa71f7c (diff) | |
parent | b6facc16d893c2e886401cb0743bb29700388293 (diff) | |
download | cortex-m-3e0bbeec390068f6b205060d9a236a8064abd3bf.tar.gz cortex-m-3e0bbeec390068f6b205060d9a236a8064abd3bf.tar.zst cortex-m-3e0bbeec390068f6b205060d9a236a8064abd3bf.zip |
Merge #149
149: reject duplicate `static mut` variables r=therealprof a=japaric
after #140 landed the entry, exception and interrupt attributes started
accepting code like this:
``` rust
#[entry]
fn main() -> ! {
static mut FOO: u32 = 0;
static mut FOO: i32 = 0;
}
```
because that code expands into:
``` rust
fn main() -> ! {
let FOO: &'static mut u32 = unsafe {
static mut FOO: u32 = 0;
&mut FOO
};
// shadows previous variable
let FOO: &'static mut u32 = unsafe {
static mut FOO: i32 = 0;
&mut FOO
};
}
```
this commit adds a check that rejects `static mut`s with duplicated names to
these three attributes.
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Diffstat (limited to 'cortex-m-rt/src/lib.rs')
0 files changed, 0 insertions, 0 deletions