1
Fork 0

Rollup merge of #110563 - bryangarza:refactor-trait-selection-error-reporting, r=compiler-errors

Break up long function in trait selection error reporting + clean up nearby code

- Move blocks of code into their own functions
- Replace a few function argument types with their type aliases
- Create "AppendConstMessage" enum to replace a nested `Option`.
This commit is contained in:
Matthias Krüger 2023-04-25 06:46:48 +02:00 committed by GitHub
commit 5f33a8c026
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 680 additions and 441 deletions

View file

@ -123,7 +123,7 @@ pub struct FulfillmentError<'tcx> {
#[derive(Clone)]
pub enum FulfillmentErrorCode<'tcx> {
/// Inherently impossible to fulfill; this trait is implemented if and only if it is already implemented.
CodeCycle(Vec<Obligation<'tcx, ty::Predicate<'tcx>>>),
CodeCycle(Vec<PredicateObligation<'tcx>>),
CodeSelectionError(SelectionError<'tcx>),
CodeProjectionError(MismatchedProjectionTypes<'tcx>),
CodeSubtypeError(ExpectedFound<Ty<'tcx>>, TypeError<'tcx>), // always comes from a SubtypePredicate