diff options
| author | mark <markm@cs.wisc.edu> | 2022-01-22 18:49:12 -0600 |
|---|---|---|
| committer | mark <markm@cs.wisc.edu> | 2022-03-16 10:35:24 -0500 |
| commit | bb8d4307eb723850e98bcb52d71d860a4aba220a (patch) | |
| tree | f3215627c474542776bdbcb03f634651a89b70f8 /compiler/rustc_passes | |
| parent | 461e8078010433ff7de2db2aaae8a3cfb0847215 (diff) | |
| download | rust-bb8d4307eb723850e98bcb52d71d860a4aba220a.tar.gz rust-bb8d4307eb723850e98bcb52d71d860a4aba220a.zip | |
rustc_error: make ErrorReported impossible to construct
There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name.
Diffstat (limited to 'compiler/rustc_passes')
| -rw-r--r-- | compiler/rustc_passes/src/check_attr.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/liveness.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/stability.rs | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 06184b47972..ebf6678d3ad 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -169,7 +169,7 @@ impl CheckAttrVisitor<'_> { } ast::AttrStyle::Inner => "crate-level attribute should be in the root module", }; - lint.build(msg).emit() + lint.build(msg).emit(); }); } } @@ -236,7 +236,7 @@ impl CheckAttrVisitor<'_> { | Target::Method(MethodKind::Trait { body: true } | MethodKind::Inherent) => true, Target::Method(MethodKind::Trait { body: false }) | Target::ForeignFn => { self.tcx.struct_span_lint_hir(UNUSED_ATTRIBUTES, hir_id, attr.span, |lint| { - lint.build("`#[inline]` is ignored on function prototypes").emit() + lint.build("`#[inline]` is ignored on function prototypes").emit(); }); true } diff --git a/compiler/rustc_passes/src/liveness.rs b/compiler/rustc_passes/src/liveness.rs index ea99a90e937..7298aba7e87 100644 --- a/compiler/rustc_passes/src/liveness.rs +++ b/compiler/rustc_passes/src/liveness.rs @@ -1588,7 +1588,7 @@ impl<'tcx> Liveness<'_, 'tcx> { shorthands, Applicability::MachineApplicable, ); - err.emit() + err.emit(); }, ); } else { @@ -1611,7 +1611,7 @@ impl<'tcx> Liveness<'_, 'tcx> { non_shorthands, Applicability::MachineApplicable, ); - err.emit() + err.emit(); }, ); } diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index f36a1f61aac..09be1dac6f1 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -128,7 +128,7 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> { String::new(), rustc_errors::Applicability::MachineApplicable, ) - .emit() + .emit(); }); } @@ -728,10 +728,10 @@ impl<'tcx> Visitor<'tcx> for Checker<'tcx> { INEFFECTIVE_UNSTABLE_TRAIT_IMPL, item.hir_id(), span, - |lint| lint + |lint| {lint .build("an `#[unstable]` annotation here has no effect") .note("see issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information") - .emit() + .emit();} ); } } |
