6
6
#![ allow( unused_attributes) ]
7
7
#![ feature( range_contains) ]
8
8
#![ cfg_attr( unix, feature( libc) ) ]
9
- #![ feature( nll) ]
10
9
#![ feature( optin_builtin_traits) ]
10
+ #![ deny( rust_2018_idioms) ]
11
11
12
- extern crate atty;
13
- extern crate termcolor;
14
- #[ cfg( unix) ]
15
- extern crate libc;
16
- #[ macro_use]
17
- extern crate log;
18
- extern crate rustc_data_structures;
19
- extern crate serialize as rustc_serialize;
20
- extern crate syntax_pos;
21
- extern crate unicode_width;
12
+ #[ allow( unused_extern_crates) ]
13
+ extern crate serialize as rustc_serialize; // used by deriving
22
14
23
15
pub use emitter:: ColorConfig ;
24
16
25
- use self :: Level :: * ;
17
+ use Level :: * ;
26
18
27
19
use emitter:: { Emitter , EmitterWriter } ;
28
20
@@ -144,7 +136,7 @@ impl CodeSuggestion {
144
136
use syntax_pos:: { CharPos , Loc , Pos } ;
145
137
146
138
fn push_trailing ( buf : & mut String ,
147
- line_opt : Option < & Cow < str > > ,
139
+ line_opt : Option < & Cow < ' _ , str > > ,
148
140
lo : & Loc ,
149
141
hi_opt : Option < & Loc > ) {
150
142
let ( lo, hi_opt) = ( lo. col . to_usize ( ) , hi_opt. map ( |hi| hi. col . to_usize ( ) ) ) ;
@@ -247,7 +239,7 @@ impl FatalError {
247
239
}
248
240
249
241
impl fmt:: Display for FatalError {
250
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
242
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
251
243
write ! ( f, "parser fatal error" )
252
244
}
253
245
}
@@ -264,7 +256,7 @@ impl error::Error for FatalError {
264
256
pub struct ExplicitBug ;
265
257
266
258
impl fmt:: Display for ExplicitBug {
267
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
259
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
268
260
write ! ( f, "parser internal bug" )
269
261
}
270
262
}
@@ -496,7 +488,7 @@ impl Handler {
496
488
DiagnosticBuilder :: new ( self , Level :: Fatal , msg)
497
489
}
498
490
499
- pub fn cancel ( & self , err : & mut DiagnosticBuilder ) {
491
+ pub fn cancel ( & self , err : & mut DiagnosticBuilder < ' _ > ) {
500
492
err. cancel ( ) ;
501
493
}
502
494
@@ -698,12 +690,12 @@ impl Handler {
698
690
self . taught_diagnostics . borrow_mut ( ) . insert ( code. clone ( ) )
699
691
}
700
692
701
- pub fn force_print_db ( & self , mut db : DiagnosticBuilder ) {
693
+ pub fn force_print_db ( & self , mut db : DiagnosticBuilder < ' _ > ) {
702
694
self . emitter . borrow_mut ( ) . emit ( & db) ;
703
695
db. cancel ( ) ;
704
696
}
705
697
706
- fn emit_db ( & self , db : & DiagnosticBuilder ) {
698
+ fn emit_db ( & self , db : & DiagnosticBuilder < ' _ > ) {
707
699
let diagnostic = & * * db;
708
700
709
701
TRACK_DIAGNOSTICS . with ( |track_diagnostics| {
@@ -749,7 +741,7 @@ pub enum Level {
749
741
}
750
742
751
743
impl fmt:: Display for Level {
752
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
744
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
753
745
self . to_str ( ) . fmt ( f)
754
746
}
755
747
}
0 commit comments