]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #98816 - estebank:implicit-sized, r=oli-obk
authorbors <bors@rust-lang.org>
Fri, 8 Jul 2022 23:17:34 +0000 (23:17 +0000)
committerbors <bors@rust-lang.org>
Fri, 8 Jul 2022 23:17:34 +0000 (23:17 +0000)
commit47575bb066f2723f8386a08b4ced872f94c7e249
tree200bf8a0b05aee0e6b64597b5f306d9351def514
parent06754d8852bea286a3a76d373ccd17e66afb5a8b
parent385c79379c1267b04cd614f01269f0add0eb2095
Auto merge of #98816 - estebank:implicit-sized, r=oli-obk

Track implicit `Sized` obligations in type params

When we evaluate `ty::GenericPredicates` we introduce the implicit
`Sized` predicate of type params, but we do so with only the `Predicate`
its `Span` as context, we don't have an `Obligation` or
`ObligationCauseCode` we could influence. To try and carry this
information through, we add a new field to `ty::GenericPredicates` that
tracks both which predicates come from a type param and whether that
param has any bounds already (to use in suggestions).

We also suggest adding a `?Sized` bound if appropriate on E0599.

Address part of #98539.
compiler/rustc_trait_selection/src/traits/wf.rs
src/test/ui/hrtb/issue-30786.stderr
src/test/ui/issues/issue-41880.stderr
src/test/ui/methods/method-not-found-generic-arg-elision.stderr