-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
Description
It seems that #20692 is not only a case for duplicate error messages as shown by
fn main() {
let array = [1, 2, 3];
for a in array {
println!( "{}", a);
}
}
Which print the error 3 times.
It is the same as the other case about map
rust/src/librustc/middle/traits/object_safety.rs
Lines 78 to 85 in 7ae4a8e
pub fn object_safety_violations<'tcx>(tcx: &ty::ctxt<'tcx>, | |
trait_def_id: ast::DefId) | |
-> Vec<ObjectSafetyViolation<'tcx>> | |
{ | |
traits::supertrait_def_ids(tcx, trait_def_id) | |
.flat_map(|def_id| object_safety_violations_for_trait(tcx, def_id).into_iter()) | |
.collect() | |
} |
originally spot at https://users.rust-lang.org/t/iterator-and-differences-between-array-and-array/2672
I think implementing distinct
so that you can collect only the different items could be a good way to start solving this in the board way (all across scala error reporting).
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints