8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
+ #![ deny( bare_trait_objects) ]
12
+
11
13
#![ doc( html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" ,
12
14
html_favicon_url = "https://doc.rust-lang.org/favicon.ico" ,
13
15
html_root_url = "https://doc.rust-lang.org/nightly/" ) ]
@@ -110,7 +112,7 @@ pub struct SubstitutionPart {
110
112
pub snippet : String ,
111
113
}
112
114
113
- pub type CodeMapperDyn = CodeMapper + sync:: Send + sync:: Sync ;
115
+ pub type CodeMapperDyn = dyn CodeMapper + sync:: Send + sync:: Sync ;
114
116
115
117
pub trait CodeMapper {
116
118
fn lookup_char_pos ( & self , pos : BytePos ) -> Loc ;
@@ -270,7 +272,7 @@ pub struct Handler {
270
272
pub flags : HandlerFlags ,
271
273
272
274
err_count : AtomicUsize ,
273
- emitter : Lock < Box < Emitter + sync:: Send > > ,
275
+ emitter : Lock < Box < dyn Emitter + sync:: Send > > ,
274
276
continue_after_error : LockCell < bool > ,
275
277
delayed_span_bug : Lock < Option < Diagnostic > > ,
276
278
@@ -326,7 +328,7 @@ impl Handler {
326
328
327
329
pub fn with_emitter ( can_emit_warnings : bool ,
328
330
treat_err_as_bug : bool ,
329
- e : Box < Emitter + sync:: Send > )
331
+ e : Box < dyn Emitter + sync:: Send > )
330
332
-> Handler {
331
333
Handler :: with_emitter_and_flags (
332
334
e,
@@ -337,7 +339,8 @@ impl Handler {
337
339
} )
338
340
}
339
341
340
- pub fn with_emitter_and_flags ( e : Box < Emitter + sync:: Send > , flags : HandlerFlags ) -> Handler {
342
+ pub fn with_emitter_and_flags ( e : Box < dyn Emitter + sync:: Send > , flags : HandlerFlags ) -> Handler
343
+ {
341
344
Handler {
342
345
flags,
343
346
err_count : AtomicUsize :: new ( 0 ) ,
0 commit comments