Skip to content

Commit e2413d7

Browse files
committed
Suggest using --verbose when writing type to a file
1 parent e54ef0a commit e2413d7

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

compiler/rustc_hir_typeck/src/method/suggest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
368368
);
369369
};
370370
if let Some(file) = file {
371-
err.note(format!("the full type name has been written to '{}'", file.display()));
371+
err.note(format!("the full type name has been written to '{}' consider using --verbose to print it to the console", file.display()));
372372
}
373373

374374
err
@@ -492,7 +492,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
492492
}
493493

494494
if let Some(file) = ty_file {
495-
err.note(format!("the full type name has been written to '{}'", file.display(),));
495+
err.note(format!("the full type name has been written to '{}' consider using --verbose to print it to the console", file.display(),));
496496
}
497497
if rcvr_ty.references_error() {
498498
err.downgrade_to_delayed_bug();

compiler/rustc_infer/src/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1928,7 +1928,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
19281928
);
19291929
if let Some(path) = path {
19301930
diag.note(format!(
1931-
"the full type name has been written to '{}'",
1931+
"the full type name has been written to '{}' consider using --verbose to print it to the console",
19321932
path.display(),
19331933
));
19341934
}

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
15511551
);
15521552
if let Some(file) = file {
15531553
err.note(format!(
1554-
"the full type name has been written to '{}'",
1554+
"the full type name has been written to '{}' consider using --verbose to print it to the console",
15551555
file.display()
15561556
));
15571557
}
@@ -3597,7 +3597,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
35973597

35983598
if let Some(file) = file {
35993599
err.note(format!(
3600-
"the full type name has been written to '{}'",
3600+
"the full type name has been written to '{}' consider using --verbose to print it to the console",
36013601
file.display(),
36023602
));
36033603
}
@@ -3650,7 +3650,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
36503650
));
36513651
if let Some(file) = file {
36523652
err.note(format!(
3653-
"the full type name has been written to '{}'",
3653+
"the full type name has been written to '{}' consider using --verbose to print it to the console",
36543654
file.display(),
36553655
));
36563656
}

tests/ui/diagnostic-width/long-E0308.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LL | | ))))))))))))))))))))))))))))));
2020
|
2121
= note: expected struct `Atype<Btype<..., ...>, ...>`
2222
found enum `Result<Result<..., ...>, ...>`
23-
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
23+
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt' consider using --verbose to print it to the console
2424

2525
error[E0308]: mismatched types
2626
--> $DIR/long-E0308.rs:57:26
@@ -35,7 +35,7 @@ LL | | ))))))))))))))))))))))));
3535
|
3636
= note: expected enum `Option<Result<..., ...>>`
3737
found enum `Result<Result<..., ...>, ...>`
38-
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
38+
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt' consider using --verbose to print it to the console
3939

4040
error[E0308]: mismatched types
4141
--> $DIR/long-E0308.rs:88:9
@@ -54,7 +54,7 @@ LL | | > = ();
5454
|
5555
= note: expected struct `Atype<Btype<..., ...>, ...>`
5656
found unit type `()`
57-
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
57+
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt' consider using --verbose to print it to the console
5858

5959
error[E0308]: mismatched types
6060
--> $DIR/long-E0308.rs:91:17
@@ -71,7 +71,7 @@ LL | | ))))))))))))))))))))))));
7171
|
7272
= note: expected unit type `()`
7373
found enum `Result<Result<..., ...>, ...>`
74-
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
74+
= note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt' consider using --verbose to print it to the console
7575

7676
error: aborting due to 4 previous errors
7777

0 commit comments

Comments
 (0)