File tree 7 files changed +16
-9
lines changed
7 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,15 @@ main() {
31
31
if [ $TARGET = x86_64-unknown-linux-gnu ]; then
32
32
./check-blobs.sh
33
33
fi
34
+
35
+ if [ $TRAVIS_RUST_VERSION = nightly ]; then
36
+ # Get the latest nightly with a working clippy
37
+ rustup toolchain uninstall nightly
38
+ rustup set profile default
39
+ rustup default nightly
40
+ rustup target add $TARGET
41
+ cargo clippy --target $TARGET -- -D warnings
42
+ fi
34
43
}
35
44
36
45
main
Original file line number Diff line number Diff line change 33
33
#![ deny( missing_docs) ]
34
34
#![ no_std]
35
35
#![ allow( clippy:: identity_op) ]
36
+ #![ allow( clippy:: missing_safety_doc) ]
36
37
37
38
extern crate aligned;
38
39
extern crate bare_metal;
Original file line number Diff line number Diff line change @@ -78,8 +78,6 @@ macro_rules! singleton {
78
78
/// ``` compile_fail
79
79
/// use cortex_m::singleton;
80
80
///
81
- /// fn main() {}
82
- ///
83
81
/// fn foo() {
84
82
/// // check that the call to `uninitialized` requires unsafe
85
83
/// singleton!(: u8 = std::mem::uninitialized());
@@ -92,8 +90,6 @@ const CFAIL: () = ();
92
90
/// #![deny(unsafe_code)]
93
91
/// use cortex_m::singleton;
94
92
///
95
- /// fn main() {}
96
- ///
97
93
/// fn foo() {
98
94
/// // check that calls to `singleton!` don't trip the `unsafe_code` lint
99
95
/// singleton!(: u8 = 0);
Original file line number Diff line number Diff line change @@ -82,6 +82,6 @@ impl DWT {
82
82
#[ cfg( not( armv6m) ) ]
83
83
pub fn unlock ( ) {
84
84
// NOTE(unsafe) atomic write to a stateless, write-only register
85
- unsafe { ( * Self :: ptr ( ) ) . lar . write ( 0xC5ACCE55 ) }
85
+ unsafe { ( * Self :: ptr ( ) ) . lar . write ( 0xC5AC_CE55 ) }
86
86
}
87
87
}
Original file line number Diff line number Diff line change
1
+ #![ allow( clippy:: needless_doctest_main) ]
1
2
//! Core peripherals
2
3
//!
3
4
//! # API
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ impl NVIC {
164
164
{
165
165
// NOTE(unsafe) atomic read with no side effects
166
166
let ipr_n = unsafe { ( * Self :: ptr ( ) ) . ipr [ Self :: ipr_index ( & interrupt) ] . read ( ) } ;
167
- let prio = ( ipr_n >> Self :: ipr_shift ( & interrupt) ) & 0x000000ff ;
167
+ let prio = ( ipr_n >> Self :: ipr_shift ( & interrupt) ) & 0x0000_00ff ;
168
168
prio as u8
169
169
}
170
170
}
@@ -251,7 +251,7 @@ impl NVIC {
251
251
#[ cfg( armv6m) ]
252
252
{
253
253
self . ipr [ Self :: ipr_index ( & interrupt) ] . modify ( |value| {
254
- let mask = 0x000000ff << Self :: ipr_shift ( & interrupt) ;
254
+ let mask = 0x0000_00ff << Self :: ipr_shift ( & interrupt) ;
255
255
let prio = u32:: from ( prio) << Self :: ipr_shift ( & interrupt) ;
256
256
257
257
( value & !mask) | prio
Original file line number Diff line number Diff line change @@ -781,7 +781,7 @@ impl SCB {
781
781
{
782
782
// NOTE(unsafe) atomic read with no side effects
783
783
let shpr = unsafe { ( * Self :: ptr ( ) ) . shpr [ usize:: from ( ( index - 8 ) / 4 ) ] . read ( ) } ;
784
- let prio = ( shpr >> ( 8 * ( index % 4 ) ) ) & 0x000000ff ;
784
+ let prio = ( shpr >> ( 8 * ( index % 4 ) ) ) & 0x0000_00ff ;
785
785
prio as u8
786
786
}
787
787
}
@@ -810,7 +810,7 @@ impl SCB {
810
810
{
811
811
self . shpr [ usize:: from ( ( index - 8 ) / 4 ) ] . modify ( |value| {
812
812
let shift = 8 * ( index % 4 ) ;
813
- let mask = 0x000000ff << shift;
813
+ let mask = 0x0000_00ff << shift;
814
814
let prio = u32:: from ( prio) << shift;
815
815
816
816
( value & !mask) | prio
You can’t perform that action at this time.
0 commit comments