Update to the rustfmt in rust 1.28, which is now stable.

Also, rustfmt's --write-mode=check is now named --check.
This commit is contained in:
Dan Gohman
2018-08-02 09:05:47 -07:00
parent 26d122306d
commit cd75176f10
40 changed files with 186 additions and 125 deletions

View File

@@ -62,7 +62,8 @@ impl Signature {
/// Even if there are no stack arguments, this will set `params` to `Some(0)` instead
/// of `None`. This indicates that the signature has been legalized.
pub fn compute_argument_bytes(&mut self) {
let bytes = self.params
let bytes = self
.params
.iter()
.filter_map(|arg| match arg.location {
ArgumentLoc::Stack(offset) if offset >= 0 => {

View File

@@ -182,7 +182,8 @@ impl Layout {
/// Assign a valid sequence number to `inst` such that the numbers are still monotonic. This may
/// require renumbering.
fn assign_inst_seq(&mut self, inst: Inst) {
let ebb = self.inst_ebb(inst)
let ebb = self
.inst_ebb(inst)
.expect("inst must be inserted before assigning an seq");
// Get the sequence number immediately before `inst`.
@@ -569,7 +570,8 @@ impl Layout {
/// Insert `inst` before the instruction `before` in the same EBB.
pub fn insert_inst(&mut self, inst: Inst, before: Inst) {
debug_assert_eq!(self.inst_ebb(inst), None);
let ebb = self.inst_ebb(before)
let ebb = self
.inst_ebb(before)
.expect("Instruction before insertion point not in the layout");
let after = self.insts[before].prev;
{
@@ -643,7 +645,8 @@ impl Layout {
/// i4
/// ```
pub fn split_ebb(&mut self, new_ebb: Ebb, before: Inst) {
let old_ebb = self.inst_ebb(before)
let old_ebb = self
.inst_ebb(before)
.expect("The `before` instruction must be in the layout");
debug_assert!(!self.is_ebb_inserted(new_ebb));

View File

@@ -309,7 +309,8 @@ impl StackSlots {
let size = spill_size(ty);
// Find the smallest existing slot that can fit the type.
if let Some(&ss) = self.emergency
if let Some(&ss) = self
.emergency
.iter()
.filter(|&&ss| self[ss].size >= size && !in_use.contains(&ss.into()))
.min_by_key(|&&ss| self[ss].size)
@@ -318,7 +319,8 @@ impl StackSlots {
}
// Alternatively, use the largest available slot and make it larger.
if let Some(&ss) = self.emergency
if let Some(&ss) = self
.emergency
.iter()
.filter(|&&ss| !in_use.contains(&ss.into()))
.max_by_key(|&&ss| self[ss].size)