diff options
| author | bohan <bohan-zhang@foxmail.com> | 2023-07-26 22:46:49 +0800 |
|---|---|---|
| committer | bohan <bohan-zhang@foxmail.com> | 2023-07-29 00:19:50 +0800 |
| commit | cac0bd0bef0661948f558592f43908221e52e2a0 (patch) | |
| tree | f4ab9e6b390451509a5445af6fb7f2536a8cbf2b /compiler/rustc_errors/src | |
| parent | 317ec04d18ab9c5d09a4d9b4418a12da8974b961 (diff) | |
| download | rust-cac0bd0bef0661948f558592f43908221e52e2a0.tar.gz rust-cac0bd0bef0661948f558592f43908221e52e2a0.zip | |
fix(resolve): update the ambiguity glob binding as warning recursively
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 16 |
1 files changed, 16 insertions, 0 deletions
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, |
