@@ -12,7 +12,7 @@ use rustc::lint::builtin::{SAFE_EXTERN_STATICS, SAFE_PACKED_BORROWS, UNUSED_UNSA
12
12
use rustc:: mir:: * ;
13
13
use rustc:: mir:: visit:: { PlaceContext , Visitor , MutatingUseContext } ;
14
14
15
- use syntax:: symbol:: { Symbol , sym} ;
15
+ use syntax:: symbol:: { InternedString , Symbol , sym} ;
16
16
17
17
use std:: ops:: Bound ;
18
18
@@ -167,7 +167,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> {
167
167
( CastTy :: FnPtr , CastTy :: Int ( _) ) => {
168
168
self . register_violations ( & [ UnsafetyViolation {
169
169
source_info : self . source_info ,
170
- description : Symbol :: intern ( "cast of pointer to int" ) . as_interned_str ( ) ,
170
+ description : InternedString :: intern ( "cast of pointer to int" ) ,
171
171
details : Symbol :: intern ( "casting pointers to integers in constants" )
172
172
. as_interned_str ( ) ,
173
173
kind : UnsafetyViolationKind :: General ,
@@ -185,7 +185,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> {
185
185
if let ty:: RawPtr ( _) | ty:: FnPtr ( ..) = lhs. ty ( self . mir , self . tcx ) . sty {
186
186
self . register_violations ( & [ UnsafetyViolation {
187
187
source_info : self . source_info ,
188
- description : Symbol :: intern ( "pointer operation" ) . as_interned_str ( ) ,
188
+ description : InternedString :: intern ( "pointer operation" ) ,
189
189
details : Symbol :: intern ( "operations on pointers in constants" )
190
190
. as_interned_str ( ) ,
191
191
kind : UnsafetyViolationKind :: General ,
@@ -212,7 +212,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> {
212
212
self . source_scope_local_data [ source_info. scope ] . lint_root ;
213
213
self . register_violations ( & [ UnsafetyViolation {
214
214
source_info,
215
- description : Symbol :: intern ( "borrow of packed field" ) . as_interned_str ( ) ,
215
+ description : InternedString :: intern ( "borrow of packed field" ) ,
216
216
details :
217
217
Symbol :: intern ( "fields of packed structs might be misaligned: \
218
218
dereferencing a misaligned pointer or even just \
@@ -315,7 +315,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> {
315
315
self . source_scope_local_data [ source_info. scope ] . lint_root ;
316
316
self . register_violations ( & [ UnsafetyViolation {
317
317
source_info,
318
- description : Symbol :: intern ( "use of extern static" ) . as_interned_str ( ) ,
318
+ description : InternedString :: intern ( "use of extern static" ) ,
319
319
details :
320
320
Symbol :: intern ( "extern statics are not controlled by the Rust type \
321
321
system: invalid data, aliasing violations or data \
@@ -340,8 +340,8 @@ impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
340
340
let source_info = self . source_info ;
341
341
self . register_violations ( & [ UnsafetyViolation {
342
342
source_info,
343
- description : Symbol :: intern ( description) . as_interned_str ( ) ,
344
- details : Symbol :: intern ( details) . as_interned_str ( ) ,
343
+ description : InternedString :: intern ( description) ,
344
+ details : InternedString :: intern ( details) ,
345
345
kind,
346
346
} ] , & [ ] ) ;
347
347
}
@@ -441,8 +441,8 @@ impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
441
441
let source_info = self . source_info ;
442
442
self . register_violations ( & [ UnsafetyViolation {
443
443
source_info,
444
- description : Symbol :: intern ( description) . as_interned_str ( ) ,
445
- details : Symbol :: intern ( details) . as_interned_str ( ) ,
444
+ description : InternedString :: intern ( description) ,
445
+ details : InternedString :: intern ( details) ,
446
446
kind : UnsafetyViolationKind :: GeneralAndConstFn ,
447
447
} ] , & [ ] ) ;
448
448
}
0 commit comments