about summary refs log tree commit diff
path: root/tests/ui/sized-hierarchy
AgeCommit message (Collapse)AuthorLines
2025-07-20Consider param-env for fast pathMichael Goulet-5/+26
2025-07-18HIR ty lowering: Validate `PointeeSized` boundsLeón Orell Valerian Liehr-4/+101
2025-07-18Reword diagnostic about relaxing non-`Sized` boundLeón Orell Valerian Liehr-4/+4
* The phrasing "only does something for" made sense back when this diagnostic was a (hard) warning. Now however, it's simply a hard error and thus completely rules out "doing something". * The primary message was way too long * The new wording more closely mirrors the wording we use for applying other bound modifiers (like `const` and `async`) to incompatible traits. * "all other traits are not bound by default" is no longer accurate under Sized Hierarchy. E.g., traits and assoc tys are (currently) bounded by `MetaSized` by default but can't be relaxed using `?MetaSized` (instead, you relax it by adding `PointeeSized`). * I've decided against adding any diagnositic notes or suggestions for now like "trait `Trait` can't be relaxed as it's not bound by default" which would be incorrect for `MetaSized` and assoc tys as mentioned above) or "consider changing `?MetaSized` to `PointeeSized`" as the Sized Hierarchy impl is still WIP)
2025-07-18Reword diagnostics about relaxed bounds in invalid contextsLeón Orell Valerian Liehr-16/+7
2025-07-18AST lowering: More robustly deal with relaxed boundsLeón Orell Valerian Liehr-3/+1
2025-07-16trait_sel: `MetaSized` always holds temporarilyDavid Wood-47/+50
As a temporary measure while a proper fix for `tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs` is implemented, make `MetaSized` obligations always hold. In effect, temporarily reverting the `sized_hierarchy` feature. This is a small change that can be backported.
2025-07-01Remove support for dyn*Michael Goulet-39/+34
2025-06-27hir_analysis: prohibit `dyn PointeeSized`David Wood-0/+30
2025-06-16trait_sel: skip elaboration of sizedness supertraitDavid Wood-24/+85
As a performance optimization, skip elaborating the supertraits of `Sized`, and if a `MetaSized` obligation is being checked, then look for a `Sized` predicate in the parameter environment. This makes the `ParamEnv` smaller which should improve compiler performance as it avoids all the iteration over the larger `ParamEnv`.
2025-06-16tests: add overflow testDavid Wood-0/+66
This test case is a reduction from the `hwc` crate on GitHub, following a crater run. It passes with the next solver but fails on the current solver due to a known limitation of the current solver. It starts fails on the current solver with the `sized_hierarchy` changes because `?Sized` is now a proper bound.
2025-06-16middle: print `{Meta,Pointee}Sized` in opaquesDavid Wood-0/+119
When `sized_hierarchy` is enabled, rustc should print `MetaSized` or `PointeeSized` instead of `?Sized` in opaques.
2025-06-16trait_sel: print `{Meta,Pointee}Sized` impl headersDavid Wood-0/+206
When printing impl headers in a diagnostic, the compiler has to account for `?Sized` implying `MetaSized` and new `MetaSized` and `PointeeSized` bounds.
2025-06-16hir_analysis: add `{Meta,Pointee}Sized` boundsDavid Wood-60/+470
Opting-out of `Sized` with `?Sized` is now equivalent to adding a `MetaSized` bound, and adding a `MetaSized` or `PointeeSized` bound is equivalent to removing the default `Sized` bound - this commit implements this change in `rustc_hir_analysis::hir_ty_lowering`. `MetaSized` is also added as a supertrait of all traits, as this is necessary to preserve backwards compatibility. Unfortunately, non-global where clauses being preferred over item bounds (where `PointeeSized` bounds would be proven) - which can result in errors when a `PointeeSized` supertrait/bound/predicate is added to some items. Rather than `PointeeSized` being a bound on everything, it can be the absence of a bound on everything, as `?Sized` was.
2025-06-16trait_sel: `{Meta,Pointee}Sized` on `?Sized` typesDavid Wood-0/+687
Expand the automatic implementation of `MetaSized` and `PointeeSized` so that it is also implemented on non-`Sized` types, just not `ty::Foreign` (extern type).