Skip to content
Permalink
Browse files

Ensure the symbols are pure strings

  • Loading branch information...
Zoxc committed Apr 9, 2019
1 parent 61a7a60 commit afeda72dad761325ea759fd2008730e24a165b9c
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/libsyntax/ast.rs
@@ -70,7 +70,13 @@ pub struct Path {

impl PartialEq<Symbol> for Path {
fn eq(&self, symbol: &Symbol) -> bool {
self.segments.len() == 1 && self.segments[0].ident.name.interned() == *symbol
self.segments.len() == 1 && {
let name = self.segments[0].ident.name;
// Make sure these symbols are pure strings
debug_assert!(!symbol.is_gensymed());
debug_assert!(!name.is_gensymed());
name == *symbol
}
}
}

0 comments on commit afeda72

Please sign in to comment.
You can’t perform that action at this time.