This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +5
-7
lines changed
rustc_hir_analysis/src/check
rustc_mir_transform/src/coverage
rustc_transmute/src/layout Expand file tree Collapse file tree 4 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -1317,7 +1317,7 @@ fn compare_number_of_generics<'tcx>(
13171317 impl_count,
13181318 kind,
13191319 pluralize!( impl_count) ,
1320- suffix. unwrap_or_else ( String :: new ) ,
1320+ suffix. unwrap_or_default ( ) ,
13211321 ) ,
13221322 ) ;
13231323 }
Original file line number Diff line number Diff line change @@ -292,10 +292,8 @@ impl DebugCounters {
292292 }
293293
294294 pub fn some_block_label ( & self , operand : ExpressionOperandId ) -> Option < & String > {
295- self . some_counters . as_ref ( ) . map_or ( None , |counters| {
296- counters
297- . get ( & operand)
298- . map_or ( None , |debug_counter| debug_counter. some_block_label . as_ref ( ) )
295+ self . some_counters . as_ref ( ) . and_then ( |counters| {
296+ counters. get ( & operand) . and_then ( |debug_counter| debug_counter. some_block_label . as_ref ( ) )
299297 } )
300298 }
301299
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ pub(crate) mod rustc {
196196 fn from ( err : LayoutError < ' tcx > ) -> Self {
197197 match err {
198198 LayoutError :: Unknown ( ..) => Self :: Unknown ,
199- err @ _ => unimplemented ! ( "{:?}" , err) ,
199+ err => unimplemented ! ( "{:?}" , err) ,
200200 }
201201 }
202202 }
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ where
141141 let f = auto_trait:: AutoTraitFinder :: new ( tcx) ;
142142
143143 debug ! ( "get_auto_trait_impls({:?})" , ty) ;
144- let auto_traits: Vec < _ > = self . cx . auto_traits . iter ( ) . copied ( ) . collect ( ) ;
144+ let auto_traits: Vec < _ > = self . cx . auto_traits . to_vec ( ) ;
145145 let mut auto_traits: Vec < Item > = auto_traits
146146 . into_iter ( )
147147 . filter_map ( |trait_def_id| {
You can’t perform that action at this time.
0 commit comments