diff options
| author | Michael Goulet <michael@errs.io> | 2022-06-25 09:18:25 -0700 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-07-01 17:38:34 +0000 |
| commit | f44ae98ceec2361a47e8822a8f5018d4443018ea (patch) | |
| tree | a1908624ac25cb7243da3aa317335c8b1d120a46 /compiler/rustc_trait_selection/src/traits | |
| parent | 5b9775fe17893cba641a071de7e0a7c8f478c41b (diff) | |
Only label place where type is needed if span is meaningful
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index debb9e82951..b5256433306 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -2002,6 +2002,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> { subst, vec![], ErrorCode::E0282, + false, ) .emit(); } @@ -2019,6 +2020,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> { subst, impl_candidates, ErrorCode::E0283, + false, ); let obligation = Obligation::new( @@ -2110,7 +2112,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> { return; } - self.emit_inference_failure_err(body_id, span, arg, vec![], ErrorCode::E0282) + self.emit_inference_failure_err(body_id, span, arg, vec![], ErrorCode::E0282, false) } ty::PredicateKind::Subtype(data) => { @@ -2124,7 +2126,14 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> { let SubtypePredicate { a_is_expected: _, a, b } = data; // both must be type variables, or the other would've been instantiated assert!(a.is_ty_var() && b.is_ty_var()); - self.emit_inference_failure_err(body_id, span, a.into(), vec![], ErrorCode::E0282) + self.emit_inference_failure_err( + body_id, + span, + a.into(), + vec![], + ErrorCode::E0282, + false, + ) } ty::PredicateKind::Projection(data) => { let self_ty = data.projection_ty.self_ty(); @@ -2140,6 +2149,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> { self_ty.into(), vec![], ErrorCode::E0284, + false, ); err.note(&format!("cannot satisfy `{}`", predicate)); err |
