Skip to content

Commit ad49671

Browse files
bors[bot]japaric
andcommitted
Merge #252
252: make non cortex-m targets compile on stable r=therealprof a=japaric see individual commits for details this is a breaking change Co-authored-by: Jorge Aparicio <[email protected]>
2 parents de2a426 + 38571a1 commit ad49671

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

src/generate/device.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ pub fn render(d: &Device, target: &Target, nightly: bool, device_x: &mut String)
4343
#![no_std]
4444
});
4545

46-
if *target != Target::CortexM {
47-
out.push(quote! {
48-
#![feature(const_fn)]
49-
#![feature(try_from)]
50-
});
51-
}
52-
5346
if nightly {
5447
out.push(quote! {
5548
#![feature(untagged_unions)]

src/generate/interrupt.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,14 @@ pub fn render(
233233
root.push(interrupt_enum);
234234
} else {
235235
mod_items.push(quote! {
236-
use core::convert::TryFrom;
237-
238236
#interrupt_enum
239237

240238
#[derive(Debug, Copy, Clone)]
241239
pub struct TryFromInterruptError(());
242240

243-
impl TryFrom<u8> for Interrupt {
244-
type Error = TryFromInterruptError;
245-
241+
impl Interrupt {
246242
#[inline]
247-
fn try_from(value: u8) -> Result<Self, Self::Error> {
243+
pub fn try_from(value: u8) -> Result<Self, TryFromInterruptError> {
248244
match value {
249245
#(#from_arms)*
250246
_ => Err(TryFromInterruptError(())),

0 commit comments

Comments
 (0)