Skip to content

Commit feb3ded

Browse files
committed
Fixes compilation warnings with rustc 1.21.0-nightly (13d94d5fa 2017-08-10)
1 parent 5719870 commit feb3ded

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/codegen/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl<'a> CodegenResult<'a> {
175175
/// counter internally so the next time we ask for the overload for this
176176
/// name, we get the incremented value, and so on.
177177
fn overload_number(&mut self, name: &str) -> u32 {
178-
let mut counter =
178+
let counter =
179179
self.overload_counters.entry(name.into()).or_insert(0);
180180
let number = *counter;
181181
*counter += 1;
@@ -2024,7 +2024,7 @@ impl MethodCodegen for Method {
20242024
}
20252025

20262026
let count = {
2027-
let mut count = method_names.entry(name.clone()).or_insert(0);
2027+
let count = method_names.entry(name.clone()).or_insert(0);
20282028
*count += 1;
20292029
*count - 1
20302030
};

src/ir/comp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ fn raw_fields_to_fields_and_bitfield_units<I>(ctx: &BindgenContext,
460460
/// (potentially multiple) bitfield units.
461461
fn bitfields_to_allocation_units<E, I>(ctx: &BindgenContext,
462462
bitfield_unit_count: &mut usize,
463-
mut fields: &mut E,
463+
fields: &mut E,
464464
raw_bitfields: I)
465465
where E: Extend<Field>,
466466
I: IntoIterator<Item=RawField>
@@ -478,7 +478,7 @@ fn bitfields_to_allocation_units<E, I>(ctx: &BindgenContext,
478478
// TODO(emilio): Take into account C++'s wide bitfields, and
479479
// packing, sigh.
480480

481-
fn flush_allocation_unit<E>(mut fields: &mut E,
481+
fn flush_allocation_unit<E>(fields: &mut E,
482482
bitfield_unit_count: &mut usize,
483483
unit_size_in_bits: usize,
484484
unit_align_in_bits: usize,

src/ir/context.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,8 @@ impl<'ctx> BindgenContext<'ctx> {
466466
assert!(item.id() != self.root_module);
467467
assert!(!self.items.contains_key(&item.id()));
468468

469-
if let Some(mut parent) = self.items.get_mut(&item.parent_id()) {
470-
if let Some(mut module) = parent.as_module_mut() {
469+
if let Some(parent) = self.items.get_mut(&item.parent_id()) {
470+
if let Some(module) = parent.as_module_mut() {
471471
debug!("add_item_to_module: adding {:?} as child of parent module {:?}",
472472
item.id(),
473473
item.parent_id());
@@ -607,7 +607,7 @@ impl<'ctx> BindgenContext<'ctx> {
607607
to opaque blob");
608608
Item::new_opaque_type(self.next_item_id(), &ty, self)
609609
});
610-
let mut item = self.items.get_mut(&id).unwrap();
610+
let item = self.items.get_mut(&id).unwrap();
611611

612612
*item.kind_mut().as_type_mut().unwrap().kind_mut() =
613613
TypeKind::ResolvedTypeRef(resolved);
@@ -699,7 +699,7 @@ impl<'ctx> BindgenContext<'ctx> {
699699
debug!("Replacing {:?} with {:?}", id, replacement);
700700

701701
let new_parent = {
702-
let mut item = self.items.get_mut(&id).unwrap();
702+
let item = self.items.get_mut(&id).unwrap();
703703
*item.kind_mut().as_type_mut().unwrap().kind_mut() =
704704
TypeKind::ResolvedTypeRef(replacement);
705705
item.parent_id()

src/ir/template.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ impl IsOpaque for TemplateInstantiation {
322322
arg_path[1..].join("::")
323323
}).collect();
324324
{
325-
let mut last = path.last_mut().unwrap();
325+
let last = path.last_mut().unwrap();
326326
last.push('<');
327327
last.push_str(&args.join(", "));
328328
last.push('>');

0 commit comments

Comments
 (0)