Rollup merge of #139374 - oli-obk:const-trait-bound, r=compiler-errors
Use the span of the whole bound when the diagnostic talks about a bound While it makes sense that the host predicate only points to the `~const` part, as whether the actual trait bound is satisfied is checked separately, the user facing diagnostic is talking about the entire trait bound, at which point it makes more sense to just highlight the entire bound r? `@compiler-errors` or `@fee1-dead`
This commit is contained in:
commit
f074bbff7a
18 changed files with 33 additions and 33 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue