From cac0bd0bef0661948f558592f43908221e52e2a0 Mon Sep 17 00:00:00 2001 From: bohan Date: Wed, 26 Jul 2023 22:46:49 +0800 Subject: fix(resolve): update the ambiguity glob binding as warning recursively --- compiler/rustc_errors/src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'compiler/rustc_errors') diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index e01e80939ca..80f20fddf55 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -1871,6 +1871,22 @@ pub fn add_elided_lifetime_in_path_suggestion( }); } +pub fn report_ambiguity_error<'a, G: EmissionGuarantee>( + db: &mut DiagnosticBuilder<'a, G>, + ambiguity: rustc_lint_defs::AmbiguityErrorDiag, +) { + db.span_label(ambiguity.label_span, ambiguity.label_msg); + db.note(ambiguity.note_msg); + db.span_note(ambiguity.b1_span, ambiguity.b1_note_msg); + for help_msg in ambiguity.b1_help_msgs { + db.help(help_msg); + } + db.span_note(ambiguity.b2_span, ambiguity.b2_note_msg); + for help_msg in ambiguity.b2_help_msgs { + db.help(help_msg); + } +} + #[derive(Clone, Copy, PartialEq, Hash, Debug)] pub enum TerminalUrl { No, -- cgit 1.4.1-3-g733a5