@@ -12,7 +12,7 @@ use rustc::lint::builtin::{SAFE_EXTERN_STATICS, SAFE_PACKED_BORROWS, UNUSED_UNSA
1212use rustc:: mir:: * ;
1313use rustc:: mir:: visit:: { PlaceContext , Visitor , MutatingUseContext } ;
1414
15- use syntax:: symbol:: { Symbol , sym} ;
15+ use syntax:: symbol:: { InternedString , sym} ;
1616
1717use std:: ops:: Bound ;
1818
@@ -167,9 +167,9 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> {
167167 ( CastTy :: FnPtr , CastTy :: Int ( _) ) => {
168168 self . register_violations ( & [ UnsafetyViolation {
169169 source_info : self . source_info ,
170- description : Symbol :: intern ( "cast of pointer to int" ) . as_interned_str ( ) ,
171- details : Symbol :: intern ( "casting pointers to integers in constants" )
172- . as_interned_str ( ) ,
170+ description : InternedString :: intern ( "cast of pointer to int" ) ,
171+ details : InternedString :: intern (
172+ "casting pointers to integers in constants" ) ,
173173 kind : UnsafetyViolationKind :: General ,
174174 } ] , & [ ] ) ;
175175 } ,
@@ -185,9 +185,8 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> {
185185 if let ty:: RawPtr ( _) | ty:: FnPtr ( ..) = lhs. ty ( self . mir , self . tcx ) . sty {
186186 self . register_violations ( & [ UnsafetyViolation {
187187 source_info : self . source_info ,
188- description : Symbol :: intern ( "pointer operation" ) . as_interned_str ( ) ,
189- details : Symbol :: intern ( "operations on pointers in constants" )
190- . as_interned_str ( ) ,
188+ description : InternedString :: intern ( "pointer operation" ) ,
189+ details : InternedString :: intern ( "operations on pointers in constants" ) ,
191190 kind : UnsafetyViolationKind :: General ,
192191 } ] , & [ ] ) ;
193192 }
@@ -212,13 +211,11 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> {
212211 self . source_scope_local_data [ source_info. scope ] . lint_root ;
213212 self . register_violations ( & [ UnsafetyViolation {
214213 source_info,
215- description : Symbol :: intern ( "borrow of packed field" ) . as_interned_str ( ) ,
216- details :
217- Symbol :: intern ( "fields of packed structs might be misaligned: \
218- dereferencing a misaligned pointer or even just \
219- creating a misaligned reference is undefined \
220- behavior")
221- . as_interned_str ( ) ,
214+ description : InternedString :: intern ( "borrow of packed field" ) ,
215+ details : InternedString :: intern (
216+ "fields of packed structs might be misaligned: dereferencing a \
217+ misaligned pointer or even just creating a misaligned reference \
218+ is undefined behavior") ,
222219 kind : UnsafetyViolationKind :: BorrowPacked ( lint_root)
223220 } ] , & [ ] ) ;
224221 }
@@ -315,12 +312,10 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> {
315312 self . source_scope_local_data [ source_info. scope ] . lint_root ;
316313 self . register_violations ( & [ UnsafetyViolation {
317314 source_info,
318- description : Symbol :: intern ( "use of extern static" ) . as_interned_str ( ) ,
319- details :
320- Symbol :: intern ( "extern statics are not controlled by the Rust type \
321- system: invalid data, aliasing violations or data \
322- races will cause undefined behavior")
323- . as_interned_str ( ) ,
315+ description : InternedString :: intern ( "use of extern static" ) ,
316+ details : InternedString :: intern (
317+ "extern statics are not controlled by the Rust type system: invalid \
318+ data, aliasing violations or data races will cause undefined behavior") ,
324319 kind : UnsafetyViolationKind :: ExternStatic ( lint_root)
325320 } ] , & [ ] ) ;
326321 }
@@ -340,8 +335,8 @@ impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
340335 let source_info = self . source_info ;
341336 self . register_violations ( & [ UnsafetyViolation {
342337 source_info,
343- description : Symbol :: intern ( description) . as_interned_str ( ) ,
344- details : Symbol :: intern ( details) . as_interned_str ( ) ,
338+ description : InternedString :: intern ( description) ,
339+ details : InternedString :: intern ( details) ,
345340 kind,
346341 } ] , & [ ] ) ;
347342 }
@@ -441,8 +436,8 @@ impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
441436 let source_info = self . source_info ;
442437 self . register_violations ( & [ UnsafetyViolation {
443438 source_info,
444- description : Symbol :: intern ( description) . as_interned_str ( ) ,
445- details : Symbol :: intern ( details) . as_interned_str ( ) ,
439+ description : InternedString :: intern ( description) ,
440+ details : InternedString :: intern ( details) ,
446441 kind : UnsafetyViolationKind :: GeneralAndConstFn ,
447442 } ] , & [ ] ) ;
448443 }
0 commit comments