Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a2d9d73

Browse files
committedJan 10, 2024
Auto merge of #119751 - nnethercote:error-api-fixes, r=oli-obk
Diagnostic API fixes Some improvements to diagnostic APIs: improve some naming, use shortcuts in more places, and add a couple of missing methods. r? `@compiler-errors`
2 parents e927184 + 700a396 commit a2d9d73

File tree

135 files changed

+766
-756
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+766
-756
lines changed
 

‎compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ macro_rules! gate {
2323
($visitor:expr, $feature:ident, $span:expr, $explain:expr, $help:expr) => {{
2424
if !$visitor.features.$feature && !$span.allows_unstable(sym::$feature) {
2525
feature_err(&$visitor.sess.parse_sess, sym::$feature, $span, $explain)
26-
.help_mv($help)
26+
.with_help($help)
2727
.emit();
2828
}
2929
}};

‎compiler/rustc_ast_passes/src/show_span.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ struct ShowSpanVisitor<'a> {
3838
impl<'a> Visitor<'a> for ShowSpanVisitor<'a> {
3939
fn visit_expr(&mut self, e: &'a ast::Expr) {
4040
if let Mode::Expression = self.mode {
41-
self.dcx.emit_warning(errors::ShowSpan { span: e.span, msg: "expression" });
41+
self.dcx.emit_warn(errors::ShowSpan { span: e.span, msg: "expression" });
4242
}
4343
visit::walk_expr(self, e);
4444
}
4545

4646
fn visit_pat(&mut self, p: &'a ast::Pat) {
4747
if let Mode::Pattern = self.mode {
48-
self.dcx.emit_warning(errors::ShowSpan { span: p.span, msg: "pattern" });
48+
self.dcx.emit_warn(errors::ShowSpan { span: p.span, msg: "pattern" });
4949
}
5050
visit::walk_pat(self, p);
5151
}
5252

5353
fn visit_ty(&mut self, t: &'a ast::Ty) {
5454
if let Mode::Type = self.mode {
55-
self.dcx.emit_warning(errors::ShowSpan { span: t.span, msg: "type" });
55+
self.dcx.emit_warn(errors::ShowSpan { span: t.span, msg: "type" });
5656
}
5757
visit::walk_ty(self, t);
5858
}

0 commit comments

Comments
 (0)
Please sign in to comment.