diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs index e49f1f28e5f..4d3db15ef29 100644 --- a/src/libsyntax_pos/symbol.rs +++ b/src/libsyntax_pos/symbol.rs @@ -115,6 +115,12 @@ pub fn as_u32(self) -> u32 { } } +impl<'a> From<&'a str> for Symbol { + fn from(string: &'a str) -> Symbol { + Symbol::intern(string) + } +} + impl fmt::Debug for Symbol { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}({})", self, self.0)