summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastian Köcher <git@kchr.de>2017-08-11 18:01:54 +0200
committerBastian Köcher <git@kchr.de>2017-08-14 18:34:53 +0200
commit31f6ced7f5213101401cda7fc1659c35be17ceb6 (patch)
tree65ba3e8b0d0bd4a7ff52e842b26795f20a19f001
parent170f4f57ccd893becbefad947e7862d0917c83c4 (diff)
Fixes compilation warnings with rustc 1.21.0-nightly (13d94d5fa 2017-08-10)
-rw-r--r--src/codegen/mod.rs4
-rw-r--r--src/ir/comp.rs4
-rw-r--r--src/ir/context.rs8
-rw-r--r--src/ir/template.rs2
4 files changed, 9 insertions, 9 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index 886f3860..6113e5d5 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -175,7 +175,7 @@ impl<'a> CodegenResult<'a> {
/// counter internally so the next time we ask for the overload for this
/// name, we get the incremented value, and so on.
fn overload_number(&mut self, name: &str) -> u32 {
- let mut counter =
+ let counter =
self.overload_counters.entry(name.into()).or_insert(0);
let number = *counter;
*counter += 1;
@@ -2030,7 +2030,7 @@ impl MethodCodegen for Method {
}
let count = {
- let mut count = method_names.entry(name.clone()).or_insert(0);
+ let count = method_names.entry(name.clone()).or_insert(0);
*count += 1;
*count - 1
};
diff --git a/src/ir/comp.rs b/src/ir/comp.rs
index ecdfb5de..98002b68 100644
--- a/src/ir/comp.rs
+++ b/src/ir/comp.rs
@@ -460,7 +460,7 @@ fn raw_fields_to_fields_and_bitfield_units<I>(ctx: &BindgenContext,
/// (potentially multiple) bitfield units.
fn bitfields_to_allocation_units<E, I>(ctx: &BindgenContext,
bitfield_unit_count: &mut usize,
- mut fields: &mut E,
+ fields: &mut E,
raw_bitfields: I)
where E: Extend<Field>,
I: IntoIterator<Item=RawField>
@@ -478,7 +478,7 @@ fn bitfields_to_allocation_units<E, I>(ctx: &BindgenContext,
// TODO(emilio): Take into account C++'s wide bitfields, and
// packing, sigh.
- fn flush_allocation_unit<E>(mut fields: &mut E,
+ fn flush_allocation_unit<E>(fields: &mut E,
bitfield_unit_count: &mut usize,
unit_size_in_bits: usize,
unit_align_in_bits: usize,
diff --git a/src/ir/context.rs b/src/ir/context.rs
index a0663d8c..a2493aee 100644
--- a/src/ir/context.rs
+++ b/src/ir/context.rs
@@ -466,8 +466,8 @@ impl<'ctx> BindgenContext<'ctx> {
assert!(item.id() != self.root_module);
assert!(!self.items.contains_key(&item.id()));
- if let Some(mut parent) = self.items.get_mut(&item.parent_id()) {
- if let Some(mut module) = parent.as_module_mut() {
+ if let Some(parent) = self.items.get_mut(&item.parent_id()) {
+ if let Some(module) = parent.as_module_mut() {
debug!("add_item_to_module: adding {:?} as child of parent module {:?}",
item.id(),
item.parent_id());
@@ -607,7 +607,7 @@ impl<'ctx> BindgenContext<'ctx> {
to opaque blob");
Item::new_opaque_type(self.next_item_id(), &ty, self)
});
- let mut item = self.items.get_mut(&id).unwrap();
+ let item = self.items.get_mut(&id).unwrap();
*item.kind_mut().as_type_mut().unwrap().kind_mut() =
TypeKind::ResolvedTypeRef(resolved);
@@ -699,7 +699,7 @@ impl<'ctx> BindgenContext<'ctx> {
debug!("Replacing {:?} with {:?}", id, replacement);
let new_parent = {
- let mut item = self.items.get_mut(&id).unwrap();
+ let item = self.items.get_mut(&id).unwrap();
*item.kind_mut().as_type_mut().unwrap().kind_mut() =
TypeKind::ResolvedTypeRef(replacement);
item.parent_id()
diff --git a/src/ir/template.rs b/src/ir/template.rs
index 30189908..f1828327 100644
--- a/src/ir/template.rs
+++ b/src/ir/template.rs
@@ -322,7 +322,7 @@ impl IsOpaque for TemplateInstantiation {
arg_path[1..].join("::")
}).collect();
{
- let mut last = path.last_mut().unwrap();
+ let last = path.last_mut().unwrap();
last.push('<');
last.push_str(&args.join(", "));
last.push('>');