aboutsummaryrefslogtreecommitdiff
path: root/macros/src/syntax.rs
diff options
context:
space:
mode:
authorGravatar bors[bot] <bors[bot]@users.noreply.github.com> 2019-02-15 23:39:28 +0000
committerGravatar bors[bot] <bors[bot]@users.noreply.github.com> 2019-02-15 23:39:28 +0000
commitc91b14bcd49f05ea40617dbd3166afa63234cb91 (patch)
tree1a7c65d4a68619966e4a133dd165de7a3ec64c6b /macros/src/syntax.rs
parentfdba26525c4a190d0275dd3b5f3a154fa189a799 (diff)
parente5e54ee8f1b7afca614f642ee064a7f00a1f8548 (diff)
downloadrtic-c91b14bcd49f05ea40617dbd3166afa63234cb91.tar.gz
rtic-c91b14bcd49f05ea40617dbd3166afa63234cb91.tar.zst
rtic-c91b14bcd49f05ea40617dbd3166afa63234cb91.zip
Merge #151
151: make builds reproducible r=japaric a=japaric This is a rebased and augmented version of #132. With this PR both dev and release builds that do not use the owned-singleton stuff become reproducible. (I haven't really bothered to make owned-singleton reproducible since [lifo] is way more ergonomic than [alloc-singleton] and will eventually make its way into heapless). [lifo]: https://github.com/japaric/lifo [alloc-singleton]: https://crates.io/crates/alloc-singleton Thanks @hugwijst for doing the bulk of the work! closes #132 Co-authored-by: Hugo van der Wijst <hvanderwijst@tesla.com> Co-authored-by: Hugo van der Wijst <hugo@wij.st> Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Diffstat (limited to 'macros/src/syntax.rs')
-rw-r--r--macros/src/syntax.rs36
1 files changed, 18 insertions, 18 deletions
diff --git a/macros/src/syntax.rs b/macros/src/syntax.rs
index ad7d8bde..581eb831 100644
--- a/macros/src/syntax.rs
+++ b/macros/src/syntax.rs
@@ -1,5 +1,5 @@
use std::{
- collections::{HashMap, HashSet},
+ collections::{BTreeMap, BTreeSet},
iter, u8,
};
@@ -120,10 +120,10 @@ impl App {
pub fn parse(items: Vec<Item>, args: AppArgs) -> parse::Result<Self> {
let mut idle = None;
let mut init = None;
- let mut exceptions = HashMap::new();
- let mut interrupts = HashMap::new();
- let mut resources = HashMap::new();
- let mut tasks = HashMap::new();
+ let mut exceptions = BTreeMap::new();
+ let mut interrupts = BTreeMap::new();
+ let mut resources = BTreeMap::new();
+ let mut tasks = BTreeMap::new();
let mut free_interrupts = None;
for item in items {
@@ -418,25 +418,25 @@ impl App {
}
}
-pub type Idents = HashSet<Ident>;
+pub type Idents = BTreeSet<Ident>;
-pub type Exceptions = HashMap<Ident, Exception>;
+pub type Exceptions = BTreeMap<Ident, Exception>;
-pub type Interrupts = HashMap<Ident, Interrupt>;
+pub type Interrupts = BTreeMap<Ident, Interrupt>;
-pub type Resources = HashMap<Ident, Resource>;
+pub type Resources = BTreeMap<Ident, Resource>;
pub type Statics = Vec<ItemStatic>;
-pub type Tasks = HashMap<Ident, Task>;
+pub type Tasks = BTreeMap<Ident, Task>;
-pub type FreeInterrupts = HashMap<Ident, FreeInterrupt>;
+pub type FreeInterrupts = BTreeMap<Ident, FreeInterrupt>;
pub struct Idle {
pub args: IdleArgs,
pub attrs: Vec<Attribute>,
pub unsafety: Option<Token![unsafe]>,
- pub statics: HashMap<Ident, Static>,
+ pub statics: BTreeMap<Ident, Static>,
pub stmts: Vec<Stmt>,
}
@@ -607,7 +607,7 @@ pub struct Init {
pub args: InitArgs,
pub attrs: Vec<Attribute>,
pub unsafety: Option<Token![unsafe]>,
- pub statics: HashMap<Ident, Static>,
+ pub statics: BTreeMap<Ident, Static>,
pub stmts: Vec<Stmt>,
// TODO remove in v0.5.x
pub assigns: Vec<Assign>,
@@ -703,7 +703,7 @@ pub struct Exception {
pub args: ExceptionArgs,
pub attrs: Vec<Attribute>,
pub unsafety: Option<Token![unsafe]>,
- pub statics: HashMap<Ident, Static>,
+ pub statics: BTreeMap<Ident, Static>,
pub stmts: Vec<Stmt>,
}
@@ -791,7 +791,7 @@ pub struct Interrupt {
pub args: InterruptArgs,
pub attrs: Vec<Attribute>,
pub unsafety: Option<Token![unsafe]>,
- pub statics: HashMap<Ident, Static>,
+ pub statics: BTreeMap<Ident, Static>,
pub stmts: Vec<Stmt>,
}
@@ -1070,8 +1070,8 @@ pub struct Static {
}
impl Static {
- fn parse(items: Vec<ItemStatic>) -> parse::Result<HashMap<Ident, Static>> {
- let mut statics = HashMap::new();
+ fn parse(items: Vec<ItemStatic>) -> parse::Result<BTreeMap<Ident, Static>> {
+ let mut statics = BTreeMap::new();
for item in items {
if statics.contains_key(&item.ident) {
@@ -1104,7 +1104,7 @@ pub struct Task {
pub attrs: Vec<Attribute>,
pub unsafety: Option<Token![unsafe]>,
pub inputs: Vec<ArgCaptured>,
- pub statics: HashMap<Ident, Static>,
+ pub statics: BTreeMap<Ident, Static>,
pub stmts: Vec<Stmt>,
}