-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Remove deferred sized checks (make them eager) #100652
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @TaKO8Ki (rust-highfive has picked a reviewer for you, use r? to override) |
= help: unsized fn params are gated as an unstable feature | ||
help: function arguments must have a statically known size, borrowed types always have a known size | ||
| | ||
LL | foo(&*x); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be followed up later
6a04da4
to
33212bf
Compare
span, | ||
traits::SizedArgumentType(None), | ||
traits::SizedArgumentType(arg_span), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a somewhat unrelated fix, but it improves spans as well I think.
@bors r+ rollup |
…cks, r=TaKO8Ki Remove deferred sized checks (make them eager) Improves diagnostics spans... this doesn't seem to be the case anymore: ```rust // Some additional `Sized` obligations badly affect type inference. // These obligations are added in a later stage of typeck. pub(super) deferred_sized_obligations: RefCell<Vec<(Ty<'tcx>, Span, traits::ObligationCauseCode<'tcx>)>>, ```
…iaskrgr Rollup of 15 pull requests Successful merges: - rust-lang#99474 (Rustdoc json tests: New `@hasexact` test command) - rust-lang#99972 (interpret: only consider 1-ZST when searching for receiver) - rust-lang#100018 (Clean up `LitKind`) - rust-lang#100379 (triagebot: add translation-related mention groups) - rust-lang#100389 (Do not report cycle error when inferring return type for suggestion) - rust-lang#100489 (`is_knowable` use `Result` instead of `Option`) - rust-lang#100532 (unwind: don't build dependency when building for Miri) - rust-lang#100608 (needless separation of impl blocks) - rust-lang#100621 (Pass +atomics-32 feature for {arm,thumb}v4t-none-eabi) - rust-lang#100646 (Migrate emoji identifier diagnostics to `SessionDiagnostic` in rustc_interface) - rust-lang#100652 (Remove deferred sized checks (make them eager)) - rust-lang#100655 (Update books) - rust-lang#100656 (Update cargo) - rust-lang#100660 (Fixed a few documentation errors) - rust-lang#100661 (Fixed a few documentation errors) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Hey @compiler-errors , it seems like this PR might have caused some performance regressions, based on this comment from the rollup PR: The main benefit of this PR is improvements to the diagnostics, right? I'm trying to figure out whether the tradeoff works out here. |
@rustbot label: +perf-regression |
…ed-sized-checks, r=pnkfelix Revert "Remove deferred sized checks" cc: rust-lang#100652 (comment) I'm okay with reverting this for now, and I will look into the diagnostic regressions. This reverts commit 33212bf. r? `@pnkfelix` ---- EDIT: This _also_ fixes rust-lang#101066, a regression in method selection logic/coercion(?) due to the early registering of a `Sized` bound.
…checks, r=pnkfelix Revert "Remove deferred sized checks" cc: rust-lang/rust#100652 (comment) I'm okay with reverting this for now, and I will look into the diagnostic regressions. This reverts commit 33212bf7f527798a8cfa2bbb38781742f4ca718a. r? `@pnkfelix` ---- EDIT: This _also_ fixes #101066, a regression in method selection logic/coercion(?) due to the early registering of a `Sized` bound.
…checks, r=pnkfelix Revert "Remove deferred sized checks" cc: rust-lang/rust#100652 (comment) I'm okay with reverting this for now, and I will look into the diagnostic regressions. This reverts commit 33212bf7f527798a8cfa2bbb38781742f4ca718a. r? `@pnkfelix` ---- EDIT: This _also_ fixes #101066, a regression in method selection logic/coercion(?) due to the early registering of a `Sized` bound.
Improves diagnostics spans... this doesn't seem to be the case anymore: