Skip to content

Commit 7861c4a

Browse files
bors[bot]japaric
andcommitted
Merge #19
19: move code to the 2018 edition r=japaric a=japaric most code changes are minor the annoying part of using the 2018 edition right now is that there is no easy way to create new 2018 project (Cargo still defaults to 2015 projects; see rust-lang/cargo#5980) and there's no visible documentation on how to move a new project to the 2018 edition (see rust-lang/edition-guide#102) so I have included the required changes in the preface -- I hope people won't miss that part. r? @rust-embedded/resources (anyone) closes #1 Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2 parents eba03d8 + 508802f commit 7861c4a

File tree

21 files changed

+128
-82
lines changed

21 files changed

+128
-82
lines changed

ci/exceptions/app/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[package]
2+
authors = ["Jorge Aparicio <jorge@japaric.io>"]
3+
edition = "2018"
24
name = "app"
35
version = "0.1.0"
4-
authors = ["Jorge Aparicio <jorge@japaric.io>"]
56

67
[dependencies]
78
rt = { path = "../rt" }

ci/exceptions/app/src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
#![no_main]
33
#![no_std]
44

5-
#[macro_use]
6-
extern crate rt;
7-
85
use core::intrinsics;
96

7+
use rt::entry;
8+
109
entry!(main);
1110

1211
fn main() -> ! {

ci/exceptions/app2/src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
#![no_main]
33
#![no_std]
44

5-
#[macro_use]
6-
extern crate rt;
7-
85
use core::intrinsics;
96

7+
use rt::entry;
8+
109
entry!(main);
1110

1211
fn main() -> ! {

ci/exceptions/rt/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(panic_handler)]
21
#![no_std]
32

43
use core::panic::PanicInfo;
@@ -37,7 +36,7 @@ pub unsafe extern "C" fn Reset() -> ! {
3736
pub static RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset;
3837

3938
#[panic_handler]
40-
fn panic(_panic: &PanicInfo) -> ! {
39+
fn panic(_panic: &PanicInfo<'_>) -> ! {
4140
loop {}
4241
}
4342

ci/main/app/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[package]
2+
edition = "2018"
23
name = "app"
34
version = "0.1.0"
45
authors = ["Jorge Aparicio <jorge@japaric.io>"]

ci/main/app2/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#![no_std]
22
#![no_main]
33

4-
#[macro_use]
5-
extern crate rt;
4+
use rt::entry;
65

76
entry!(main);
87

ci/main/app3/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#![no_std]
22
#![no_main]
33

4-
#[macro_use]
5-
extern crate rt;
4+
use rt::entry;
65

76
entry!(main);
87

ci/main/app4/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[package]
2+
authors = ["Jorge Aparicio <jorge@japaric.io>"]
3+
edition = "2018"
24
name = "app"
35
version = "0.1.0"
4-
authors = ["Jorge Aparicio <jorge@japaric.io>"]
56

67
[dependencies]
78
rt = { path = "../rt2" }

ci/main/app4/src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
#![no_main]
33
#![no_std]
44

5-
#[macro_use]
6-
extern crate rt;
7-
85
use core::ptr;
96

7+
use rt::entry;
8+
109
entry!(main);
1110

1211
static mut DATA: i32 = 1;

ci/main/rt/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[package]
2-
name = "rt"
2+
edition = "2018"
3+
name = "rt" # <-
34
version = "0.1.0"
45
authors = ["Jorge Aparicio <jorge@japaric.io>"]
56

0 commit comments

Comments
 (0)