1
Fork 0

Suggest using --verbose when writing type to a file

This commit is contained in:
Fernando Fernandez Mancera 2024-02-20 09:31:01 +01:00
parent e54ef0a7ab
commit e35481f90b
4 changed files with 23 additions and 0 deletions

View file

@ -369,6 +369,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}; };
if let Some(file) = file { if let Some(file) = file {
err.note(format!("the full type name has been written to '{}'", file.display())); err.note(format!("the full type name has been written to '{}'", file.display()));
err.note(format!(
"consider using `--verbose` to print the full type name to the console"
));
} }
err err
@ -493,6 +496,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
if let Some(file) = ty_file { if let Some(file) = ty_file {
err.note(format!("the full type name has been written to '{}'", file.display(),)); err.note(format!("the full type name has been written to '{}'", file.display(),));
err.note(format!(
"consider using `--verbose` to print the full type name to the console"
));
} }
if rcvr_ty.references_error() { if rcvr_ty.references_error() {
err.downgrade_to_delayed_bug(); err.downgrade_to_delayed_bug();

View file

@ -1931,6 +1931,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
"the full type name has been written to '{}'", "the full type name has been written to '{}'",
path.display(), path.display(),
)); ));
diag.note(format!("consider using `--verbose` to print the full type name to the console"));
} }
} }
} }

View file

@ -1554,6 +1554,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
"the full type name has been written to '{}'", "the full type name has been written to '{}'",
file.display() file.display()
)); ));
err.note(format!(
"consider using `--verbose` to print full type name to the console"
));
} }
if imm_ref_self_ty_satisfies_pred && mut_ref_self_ty_satisfies_pred { if imm_ref_self_ty_satisfies_pred && mut_ref_self_ty_satisfies_pred {
@ -3133,6 +3136,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
"the full name for the type has been written to '{}'", "the full name for the type has been written to '{}'",
file.display(), file.display(),
)); ));
err.note(format!(
"consider using `--verbose` to print the full type name to the console"
));
} }
} }
ObligationCauseCode::RepeatElementCopy { ObligationCauseCode::RepeatElementCopy {
@ -3600,6 +3606,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
"the full type name has been written to '{}'", "the full type name has been written to '{}'",
file.display(), file.display(),
)); ));
err.note(format!(
"consider using `--verbose` to print the full type name to the console"
));
} }
let mut parent_predicate = parent_trait_pred; let mut parent_predicate = parent_trait_pred;
let mut data = &data.derived; let mut data = &data.derived;
@ -3653,6 +3662,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
"the full type name has been written to '{}'", "the full type name has been written to '{}'",
file.display(), file.display(),
)); ));
err.note(format!(
"consider using `--verbose` to print the full type name to the console"
));
} }
} }
// #74711: avoid a stack overflow // #74711: avoid a stack overflow

View file

@ -21,6 +21,7 @@ LL | | ))))))))))))))))))))))))))))));
= note: expected struct `Atype<Btype<..., ...>, ...>` = note: expected struct `Atype<Btype<..., ...>, ...>`
found enum `Result<Result<..., ...>, ...>` found enum `Result<Result<..., ...>, ...>`
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt' = note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
= note: consider using `--verbose` to print the full type name to the console
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/long-E0308.rs:57:26 --> $DIR/long-E0308.rs:57:26
@ -36,6 +37,7 @@ LL | | ))))))))))))))))))))))));
= note: expected enum `Option<Result<..., ...>>` = note: expected enum `Option<Result<..., ...>>`
found enum `Result<Result<..., ...>, ...>` found enum `Result<Result<..., ...>, ...>`
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt' = note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
= note: consider using `--verbose` to print the full type name to the console
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/long-E0308.rs:88:9 --> $DIR/long-E0308.rs:88:9
@ -55,6 +57,7 @@ LL | | > = ();
= note: expected struct `Atype<Btype<..., ...>, ...>` = note: expected struct `Atype<Btype<..., ...>, ...>`
found unit type `()` found unit type `()`
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt' = note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
= note: consider using `--verbose` to print the full type name to the console
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/long-E0308.rs:91:17 --> $DIR/long-E0308.rs:91:17
@ -72,6 +75,7 @@ LL | | ))))))))))))))))))))))));
= note: expected unit type `()` = note: expected unit type `()`
found enum `Result<Result<..., ...>, ...>` found enum `Result<Result<..., ...>, ...>`
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt' = note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
= note: consider using `--verbose` to print the full type name to the console
error: aborting due to 4 previous errors error: aborting due to 4 previous errors