Use the span of the whole bound when the diagnostic talks about a bound

This commit is contained in:
Oli Scherer 2025-04-01 16:21:50 +00:00
parent a4166dabaa
commit a69a219f96
18 changed files with 33 additions and 33 deletions

View file

@ -838,7 +838,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
| PredicateFilter::SelfOnly
| PredicateFilter::SelfAndAssociatedTypeBounds => {
match constness {
hir::BoundConstness::Always(span) => {
hir::BoundConstness::Always(_) => {
if polarity == ty::PredicatePolarity::Positive {
bounds.push((
poly_trait_ref
@ -864,7 +864,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
// in `lower_assoc_item_constraint`.
PredicateFilter::ConstIfConst | PredicateFilter::SelfConstIfConst => {
match constness {
hir::BoundConstness::Maybe(span) => {
hir::BoundConstness::Maybe(_) => {
if polarity == ty::PredicatePolarity::Positive {
bounds.push((
poly_trait_ref