Eagerly decide whether relaxed bounds are allowed or not#157305
Eagerly decide whether relaxed bounds are allowed or not#157305oli-obk wants to merge 2 commits into
Conversation
|
@bors try @rust-timer queue probably not an issue, but let's see |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Eagerly decide whether relaxed bounds are allowed or not
|
Allowing (Personally I'd even be fine with allowing duplicate relaxed bounds, they're not harmful; not my call though, of course) As my FIXME that you're trying to address alludes to, ideally we'd move all the relaxed bounds logic from AST lowering to HIR ty lowering where "sized elab" actually happens but for that we'd need to pass some new context / policy parameter to |
I assume you plan on moving that flawed HIR ty lowering to AST lowering? I guess that's a valid approach, right. |
| { | ||
| RelaxedBoundPolicy::Allowed | ||
| } else { | ||
| RelaxedBoundPolicy::Forbidden(RelaxedBoundForbiddenReason::LateBoundVarsInScope) |
There was a problem hiding this comment.
LateBoundVarsInScope is not the right reason for relaxed bounds on parent type parameters. Could you add a separate reason or generalize (rename) this one (I know that the diagnostic ends up looking the same)?
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (19e0554): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 3.9%, secondary 1.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 1.8%, secondary 2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 510.625s -> 510.015s (-0.12%) |
1b39cd5 to
876d5f3
Compare
I reverted that
jup |
r? @davidtwco or @fmease
Previously introduced in #142693 by @fmease
I am trying to resolve
rust/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs
Line 196 in d798694
I think this PR further unblocks resolving that FIXME, because it makes it easier to reason about whether we should be reporting an error about duplicate bounds or about relaxed bounds in general