Rollup merge of #97780 - compiler-errors:field-wfcheck-before-sized, r=jackh726
Check ADT field is well-formed before checking it is sized Fixes #96810. There is one diagnostics regression, in [`src/test/ui/generic-associated-types/bugs/issue-80626.stderr`](https://github.com/rust-lang/rust/pull/97780/files#diff-53795946378e78a0af23a10277c628ff79091c18090fdc385801ee70c1ba6963). I am not super concerned about it, since it's GAT related. We _could_ fix it, possibly by using the `FieldSized` obligation cause code instead of `BuiltinDerivedObligation`. But that would require changing `Sized` trait confirmation and the `adt_sized_constraint` query.
This commit is contained in:
@@ -406,7 +406,7 @@ pub enum ObligationCauseCode<'tcx> {
|
||||
QuestionMark,
|
||||
|
||||
/// Well-formed checking. If a `WellFormedLoc` is provided,
|
||||
/// then it will be used to eprform HIR-based wf checking
|
||||
/// then it will be used to perform HIR-based wf checking
|
||||
/// after an error occurs, in order to generate a more precise error span.
|
||||
/// This is purely for diagnostic purposes - it is always
|
||||
/// correct to use `MiscObligation` instead, or to specify
|
||||
|
||||
Reference in New Issue
Block a user