]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/coherence/mod.rs
Use numeric field `Name`s ("0", "1" etc) for positional fields
[rust.git] / src / librustc_typeck / coherence / mod.rs
index 2dfbaab2844754f9a81841835ee4448d10f766a9..941900100bbaf2741e69b3f07770b8e5b36f3154 100644 (file)
@@ -36,7 +36,6 @@
 use std::cell::RefCell;
 use std::rc::Rc;
 use syntax::codemap::Span;
-use syntax::parse::token;
 use util::nodemap::{DefIdMap, FnvHashMap};
 use rustc::dep_graph::DepNode;
 use rustc::front::map as hir_map;
@@ -449,13 +448,7 @@ fn check_implementations_of_coerce_unsized(&self) {
                                    for a coercion between structures with one field \
                                    being coerced, but {} fields need coercions: {}",
                                    diff_fields.len(), diff_fields.iter().map(|&(i, a, b)| {
-                                        let name = fields[i].name;
-                                        format!("{} ({} to {})",
-                                                if name == token::special_names::unnamed_field {
-                                                    i.to_string()
-                                                } else {
-                                                    name.to_string()
-                                                }, a, b)
+                                        format!("{} ({} to {})", fields[i].name, a, b)
                                    }).collect::<Vec<_>>().join(", "));
                         return;
                     }