66#![ allow( unused_attributes) ]
77#![ feature( range_contains) ]
88#![ cfg_attr( unix, feature( libc) ) ]
9- #![ feature( nll) ]
109#![ feature( optin_builtin_traits) ]
10+ #![ deny( rust_2018_idioms) ]
1111
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
2214
2315pub use emitter:: ColorConfig ;
2416
25- use self :: Level :: * ;
17+ use Level :: * ;
2618
2719use emitter:: { Emitter , EmitterWriter } ;
2820
@@ -144,7 +136,7 @@ impl CodeSuggestion {
144136 use syntax_pos:: { CharPos , Loc , Pos } ;
145137
146138 fn push_trailing ( buf : & mut String ,
147- line_opt : Option < & Cow < str > > ,
139+ line_opt : Option < & Cow < ' _ , str > > ,
148140 lo : & Loc ,
149141 hi_opt : Option < & Loc > ) {
150142 let ( lo, hi_opt) = ( lo. col . to_usize ( ) , hi_opt. map ( |hi| hi. col . to_usize ( ) ) ) ;
@@ -247,7 +239,7 @@ impl FatalError {
247239}
248240
249241impl fmt:: Display for FatalError {
250- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
242+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
251243 write ! ( f, "parser fatal error" )
252244 }
253245}
@@ -264,7 +256,7 @@ impl error::Error for FatalError {
264256pub struct ExplicitBug ;
265257
266258impl fmt:: Display for ExplicitBug {
267- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
259+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
268260 write ! ( f, "parser internal bug" )
269261 }
270262}
@@ -496,7 +488,7 @@ impl Handler {
496488 DiagnosticBuilder :: new ( self , Level :: Fatal , msg)
497489 }
498490
499- pub fn cancel ( & self , err : & mut DiagnosticBuilder ) {
491+ pub fn cancel ( & self , err : & mut DiagnosticBuilder < ' _ > ) {
500492 err. cancel ( ) ;
501493 }
502494
@@ -698,12 +690,12 @@ impl Handler {
698690 self . taught_diagnostics . borrow_mut ( ) . insert ( code. clone ( ) )
699691 }
700692
701- pub fn force_print_db ( & self , mut db : DiagnosticBuilder ) {
693+ pub fn force_print_db ( & self , mut db : DiagnosticBuilder < ' _ > ) {
702694 self . emitter . borrow_mut ( ) . emit ( & db) ;
703695 db. cancel ( ) ;
704696 }
705697
706- fn emit_db ( & self , db : & DiagnosticBuilder ) {
698+ fn emit_db ( & self , db : & DiagnosticBuilder < ' _ > ) {
707699 let diagnostic = & * * db;
708700
709701 TRACK_DIAGNOSTICS . with ( |track_diagnostics| {
@@ -749,7 +741,7 @@ pub enum Level {
749741}
750742
751743impl fmt:: Display for Level {
752- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
744+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
753745 self . to_str ( ) . fmt ( f)
754746 }
755747}
0 commit comments