rust/tests/ui/sized-hierarchy
Stuart Cook f87f9a456c
Rollup merge of #147734 - fmease:tighten-relaxed, r=lcnr
Further tighten up relaxed bounds

Follow-up to rust-lang/rust#142693, rust-lang/rust#135331 and rust-lang/rust#135841.
Fixes rust-lang/rust#143122.

* Reject relaxed bounds `?Trait` in the bounds of trait aliases.
  Just like `trait Trait {}` doesn't mean `trait Trait: Sized {}` and we therefore reject `trait Trait: ?Sized {}`, `trait Trait =;` (sic!) doesn't mean `trait Trait = Sized;` (never did!) and as a logical consequence `trait Trait = ?Sized;` is meaningless and should be forbidden.
* Don't permit `?Sized` in more places (e.g., supertrait bounds, trait object types) if feature `more_maybe_bounds` is enabled.
  That internal feature is only meant to allow the user to define & use *new* default traits (that have fewer rules to follow for now to ease experimentation).
* Unconditionally check that the `Trait` in `?Trait` is a default trait.
  Previously, we would only perform this check in selected places which was very brittle and led to bugs slipping through.
* Slightly improve diagnostics.
2025-10-20 22:30:53 +11:00
..
auxiliary trait_sel: print {Meta,Pointee}Sized impl headers 2025-06-16 23:04:34 +00:00
alias-bounds.rs hir_analysis: add {Meta,Pointee}Sized bounds 2025-06-16 23:04:33 +00:00
bound-on-assoc-type-projection-1.rs trait_sel: don't require predicates of aliases hold 2025-10-15 09:35:05 +01:00
default-bound.rs Reword diagnostic about relaxing non-Sized bound 2025-07-18 12:13:30 +02:00
default-bound.stderr Reword diagnostic about relaxing non-Sized bound 2025-07-18 12:13:30 +02:00
default-supertrait.rs More robustly reject relaxing non-default trait bounds 2025-10-16 19:53:32 +02:00
default-supertrait.stderr More robustly reject relaxing non-default trait bounds 2025-10-16 19:53:32 +02:00
elaboration-opt-regions-1.rs trait_sel: skip elaboration of sizedness supertrait 2025-06-16 23:04:36 +00:00
elaboration-opt-regions.rs trait_sel: skip elaboration of sizedness supertrait 2025-06-16 23:04:36 +00:00
extern-type-behind-ptr.rs hir_analysis: add {Meta,Pointee}Sized bounds 2025-06-16 23:04:33 +00:00
impls.rs Remove support for dyn* 2025-07-01 19:00:21 +00:00
impls.stderr Remove support for dyn* 2025-07-01 19:00:21 +00:00
incomplete-inference-issue-143992.rs trait_sel: sizedness goals prefer alias candidates 2025-10-15 09:35:04 +01:00
overflow.current.stderr revert: PR144016 - MetaSized does not always hold 2025-10-15 09:35:04 +01:00
overflow.rs revert: PR144016 - MetaSized does not always hold 2025-10-15 09:35:04 +01:00
pointee-supertrait.rs hir_analysis: add {Meta,Pointee}Sized bounds 2025-06-16 23:04:33 +00:00
pointee-validation.rs HIR ty lowering: Validate PointeeSized bounds 2025-07-18 12:25:24 +02:00
pointee-validation.stderr HIR ty lowering: Validate PointeeSized bounds 2025-07-18 12:25:24 +02:00
prefer-non-nested-alias-bound.rs trait_sel: prefer only nested alias bounds 2025-10-15 09:35:05 +01:00
pretty-print-no-feat-dep-has-feat.rs trait_sel: print {Meta,Pointee}Sized impl headers 2025-06-16 23:04:34 +00:00
pretty-print-no-feat-dep-has-feat.stderr trait_sel: print {Meta,Pointee}Sized impl headers 2025-06-16 23:04:34 +00:00
pretty-print-no-feat.rs trait_sel: print {Meta,Pointee}Sized impl headers 2025-06-16 23:04:34 +00:00
pretty-print-no-feat.stderr trait_sel: print {Meta,Pointee}Sized impl headers 2025-06-16 23:04:34 +00:00
pretty-print-opaque-no-feat.rs middle: print {Meta,Pointee}Sized in opaques 2025-06-16 23:04:34 +00:00
pretty-print-opaque-no-feat.stderr middle: print {Meta,Pointee}Sized in opaques 2025-06-16 23:04:34 +00:00
pretty-print-opaque.rs trait_sel: skip elaboration of sizedness supertrait 2025-06-16 23:04:36 +00:00
pretty-print-opaque.stderr trait_sel: skip elaboration of sizedness supertrait 2025-06-16 23:04:36 +00:00
pretty-print.rs trait_sel: print {Meta,Pointee}Sized impl headers 2025-06-16 23:04:34 +00:00
pretty-print.stderr trait_sel: print {Meta,Pointee}Sized impl headers 2025-06-16 23:04:34 +00:00
reject-dyn-pointeesized.rs HIR ty lowering: Validate PointeeSized bounds 2025-07-18 12:25:24 +02:00
reject-dyn-pointeesized.stderr HIR ty lowering: Validate PointeeSized bounds 2025-07-18 12:25:24 +02:00