Make diagnostic for unsatisfied Termination bounds more precise

This commit is contained in:
León Orell Valerian Liehr 2022-10-17 12:04:16 +02:00
parent bf286a82e2
commit 684df4d24e
No known key found for this signature in database
GPG key ID: CD75E31CE2CFD7D9
8 changed files with 78 additions and 5 deletions

View file

@ -164,6 +164,10 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
flags.push((sym::from_desugaring, Some(format!("{:?}", k))));
}
if let ObligationCauseCode::MainFunctionType = obligation.cause.code() {
flags.push((sym::cause, Some("MainFunctionType".to_string())));
}
// Add all types without trimmed paths.
ty::print::with_no_trimmed_paths!({
let generics = self.tcx.generics_of(def_id);