Skip to content

Commit 1aa7d5d

Browse files
bors[bot]adamgreig
andcommitted
Merge #160
160: Update for 2018 edition r=korken89 a=adamgreig Co-authored-by: Adam Greig <[email protected]>
2 parents 6a21391 + 9987c6f commit 1aa7d5d

File tree

17 files changed

+62
-76
lines changed

17 files changed

+62
-76
lines changed

CHANGELOG.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
302302
#![feature(used)]
303303
#![no_std]
304304

305-
extern crate cortex_m;
306-
extern crate cortex_m_rt;
307-
extern crate stm32f30x;
308-
309305
use core::cell::RefCell;
310306

311307
use cortex_m::ctxt::Local;

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ name = "cortex-m"
1212
readme = "README.md"
1313
repository = "https://github.com/japaric/cortex-m"
1414
version = "0.6.0"
15+
edition = "2018"
1516
links = "cortex-m" # prevent multiple versions of this crate to be linked together
1617

1718
[dependencies]

src/interrupt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn free<F, R>(f: F) -> R
6161
where
6262
F: FnOnce(&CriticalSection) -> R,
6363
{
64-
let primask = ::register::primask::read();
64+
let primask = crate::register::primask::read();
6565

6666
// disable interrupts
6767
disable();

src/itm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use core::{fmt, mem, ptr, slice};
66

77
use aligned::{Aligned, A4};
88

9-
use peripheral::itm::Stim;
9+
use crate::peripheral::itm::Stim;
1010

1111
// NOTE assumes that `bytes` is 32-bit aligned
1212
unsafe fn write_words(stim: &mut Stim, bytes: &[u32]) {

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ pub mod itm;
4747
pub mod peripheral;
4848
pub mod register;
4949

50-
pub use peripheral::Peripherals;
50+
pub use crate::peripheral::Peripherals;

src/macros.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ macro_rules! iprintln {
3333
/// # Example
3434
///
3535
/// ``` no_run
36-
/// #[macro_use(singleton)]
37-
/// extern crate cortex_m;
36+
/// use cortex_m::singleton;
3837
///
3938
/// fn main() {
4039
/// // OK if `main` is executed only once
@@ -77,8 +76,7 @@ macro_rules! singleton {
7776
}
7877

7978
/// ``` compile_fail
80-
/// #[macro_use(singleton)]
81-
/// extern crate cortex_m;
79+
/// use cortex_m::singleton;
8280
///
8381
/// fn main() {}
8482
///
@@ -92,8 +90,7 @@ const CFAIL: () = ();
9290

9391
/// ```
9492
/// #![deny(unsafe_code)]
95-
/// #[macro_use(singleton)]
96-
/// extern crate cortex_m;
93+
/// use cortex_m::singleton;
9794
///
9895
/// fn main() {}
9996
///

src/peripheral/cbp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use volatile_register::WO;
66

7-
use peripheral::CBP;
7+
use crate::peripheral::CBP;
88

99
/// Register block
1010
#[repr(C)]

src/peripheral/cpuid.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use volatile_register::RO;
55
use volatile_register::RW;
66

77
#[cfg(not(armv6m))]
8-
use peripheral::CPUID;
8+
use crate::peripheral::CPUID;
99

1010
/// Register block
1111
#[repr(C)]
@@ -104,7 +104,7 @@ impl CPUID {
104104
const CCSIDR_ASSOCIATIVITY_MASK: u32 = 0x3FF << CCSIDR_ASSOCIATIVITY_POS;
105105

106106
self.select_cache(level, ind);
107-
::asm::dsb();
107+
crate::asm::dsb();
108108
let ccsidr = self.ccsidr.read();
109109
(
110110
(1 + ((ccsidr & CCSIDR_NUMSETS_MASK) >> CCSIDR_NUMSETS_POS)) as u16,

src/peripheral/dcb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use volatile_register::{RW, WO};
44

55
use core::ptr;
6-
use peripheral::DCB;
6+
use crate::peripheral::DCB;
77

88
const DCB_DEMCR_TRCENA: u32 = 1 << 24;
99

src/peripheral/dwt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use volatile_register::WO;
55
use volatile_register::{RO, RW};
66

7-
use peripheral::DWT;
7+
use crate::peripheral::DWT;
88

99
/// Register block
1010
#[repr(C)]

0 commit comments

Comments
 (0)