File tree 1 file changed +3
-8
lines changed
compiler/rustc_typeck/src
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -1306,18 +1306,13 @@ fn trait_def(tcx: TyCtxt<'_>, def_id: DefId) -> ty::TraitDef {
1306
1306
} )
1307
1307
// Check for duplicates
1308
1308
. and_then ( |list| {
1309
- let mut set: FxHashSet < & Ident > = FxHashSet :: default ( ) ;
1309
+ let mut set: FxHashMap < Symbol , Span > = FxHashMap :: default ( ) ;
1310
1310
let mut no_dups = true ;
1311
1311
1312
1312
for ident in & * list {
1313
- if let Some ( dup) = set. replace ( ident) {
1314
- let dup2 = set. get ( & dup) . copied ( ) . unwrap ( ) ; // We've just inserted it
1315
-
1313
+ if let Some ( dup) = set. insert ( ident. name , ident. span ) {
1316
1314
tcx. sess
1317
- . struct_span_err (
1318
- vec ! [ dup. span, dup2. span] ,
1319
- "Functions names are duplicated" ,
1320
- )
1315
+ . struct_span_err ( vec ! [ dup, ident. span] , "Functions names are duplicated" )
1321
1316
. note (
1322
1317
"All `#[rustc_must_implement_one_of]` arguments \
1323
1318
must be unique",
You can’t perform that action at this time.
0 commit comments