]> git.lizzy.rs Git - rust.git/commitdiff
ident->name in debuginfo
authorJohn Clements <clements@racket-lang.org>
Sat, 7 Sep 2013 06:19:11 +0000 (23:19 -0700)
committerJohn Clements <clements@racket-lang.org>
Sat, 7 Sep 2013 06:19:11 +0000 (23:19 -0700)
src/librustc/middle/trans/debuginfo.rs

index 646f71ec28ad23aa82079a1b062ef74c7a061d4f..e4879ef4a11da0666c595ebe024670e2158fe425 100644 (file)
@@ -1012,7 +1012,7 @@ fn struct_metadata(cx: &mut CrateContext,
 
     let field_llvm_types = do fields.map |field| { type_of::type_of(cx, field.mt.ty) };
     let field_names = do fields.map |field| {
-        if field.ident == special_idents::unnamed_field {
+        if field.ident.name == special_idents::unnamed_field.name {
             ~""
         } else {
             cx.sess.str_of(field.ident).to_owned()
@@ -1875,9 +1875,12 @@ fn walk_pattern(cx: &mut CrateContext,
                     // }
 
                     // Is there already a binding with that name?
+                    // N.B.: this comparison must be UNhygienic... because
+                    // gdb knows nothing about the context, so any two
+                    // variables with the same name will cause the problem.
                     let need_new_scope = scope_stack
                         .iter()
-                        .any(|entry| entry.ident.iter().any(|i| *i == ident));
+                        .any(|entry| entry.ident.iter().any(|i| i.name == ident.name));
 
                     if need_new_scope {
                         // Create a new lexical scope and push it onto the stack