Upgrade to rustfmt 0.6.3

This commit is contained in:
Jakob Stoklund Olesen
2016-12-21 10:05:14 -08:00
parent 3568b93b84
commit 893a630ca0
3 changed files with 32 additions and 26 deletions

View File

@@ -165,9 +165,9 @@ impl Pattern {
let refname = s[refname_begin..refname_end].to_string();
return if let Some(defidx) = def {
Ok((Part::DefVar {
def: defidx,
var: refname,
},
def: defidx,
var: refname,
},
refname_end + 1))
} else {
Err(Error::Syntax(format!("expected variable name in $(=${})", refname)))
@@ -462,37 +462,37 @@ mod tests {
assert_eq!(pat.parse_part("$(foo=$bar)").unwrap(),
(Part::DefVar {
def: 0,
var: "bar".to_string(),
},
def: 0,
var: "bar".to_string(),
},
11));
assert_eq!(pat.parse_part("$(foo=$bar)").unwrap_err().to_string(),
"duplicate definition of $foo in same pattern");
assert_eq!(pat.parse_part("$(fxo=$bar)x").unwrap(),
(Part::DefVar {
def: 1,
var: "bar".to_string(),
},
def: 1,
var: "bar".to_string(),
},
11));
assert_eq!(pat.parse_part("$(fo2=[a-z])").unwrap(),
(Part::DefLit {
def: 2,
regex: "(?P<fo2>[a-z])".to_string(),
},
def: 2,
regex: "(?P<fo2>[a-z])".to_string(),
},
12));
assert_eq!(pat.parse_part("$(fo3=[a-)])").unwrap(),
(Part::DefLit {
def: 3,
regex: "(?P<fo3>[a-)])".to_string(),
},
def: 3,
regex: "(?P<fo3>[a-)])".to_string(),
},
12));
assert_eq!(pat.parse_part("$(fo4=)").unwrap(),
(Part::DefLit {
def: 4,
regex: "(?P<fo4>)".to_string(),
},
def: 4,
regex: "(?P<fo4>)".to_string(),
},
7));
assert_eq!(pat.parse_part("$(=.*)").unwrap(),

View File

@@ -30,7 +30,7 @@ function banner() {
# rustfmt is installed.
#
# This version should always be bumped to the newest version available.
RUSTFMT_VERSION="0.6.2"
RUSTFMT_VERSION="0.6.3"
if cargo install --list | grep -q "^rustfmt v$RUSTFMT_VERSION"; then
banner "Rust formatting"

View File

@@ -9,8 +9,9 @@ use self::cretonne::entity_map::EntityMap;
fn test_reverse_postorder_traversal(function_source: &str, ebb_order: Vec<u32>) {
let func = &parse_functions(function_source).unwrap()[0];
let cfg = ControlFlowGraph::new(&func);
let ebbs = ebb_order.iter().map(|n| Ebb::with_number(*n).unwrap())
.collect::<Vec<Ebb>>();
let ebbs = ebb_order.iter()
.map(|n| Ebb::with_number(*n).unwrap())
.collect::<Vec<Ebb>>();
let mut postorder_ebbs = cfg.postorder_ebbs();
let mut postorder_map = EntityMap::with_capacity(postorder_ebbs.len());
@@ -50,7 +51,8 @@ fn simple_traversal() {
ebb5:
trap
}
", vec![0, 2, 1, 3, 4, 5]);
",
vec![0, 2, 1, 3, 4, 5]);
}
#[test]
@@ -67,7 +69,8 @@ fn loops_one() {
ebb3:
return
}
", vec![0, 1, 2, 3]);
",
vec![0, 1, 2, 3]);
}
#[test]
@@ -91,7 +94,8 @@ fn loops_two() {
brz v0, ebb4
return
}
", vec![0, 1, 2, 5, 4, 3]);
",
vec![0, 1, 2, 5, 4, 3]);
}
#[test]
@@ -120,7 +124,8 @@ fn loops_three() {
ebb7:
return
}
", vec![0, 1, 2, 5, 4, 3, 6, 7]);
",
vec![0, 1, 2, 5, 4, 3, 6, 7]);
}
#[test]
@@ -142,5 +147,6 @@ fn back_edge_one() {
ebb4:
trap
}
", vec![0, 1, 3, 2, 4]);
",
vec![0, 1, 3, 2, 4]);
}