Skip to content

Commit 69769fc

Browse files
committed
Expand list of trait implementers in E0277 when calling rustc with --verbose
Signed-off-by: rongfu.leng <[email protected]>
1 parent db8aca4 commit 69769fc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -2082,12 +2082,16 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
20822082
})
20832083
.collect();
20842084

2085-
let end = if candidates.len() <= 9 { candidates.len() } else { 8 };
2085+
let end = if candidates.len() <= 9 || self.tcx.sess.opts.verbose {
2086+
candidates.len()
2087+
} else {
2088+
8
2089+
};
20862090
err.help(format!(
20872091
"the following {other}types implement trait `{}`:{}{}",
20882092
trait_ref.print_trait_sugared(),
20892093
candidates[..end].join(""),
2090-
if candidates.len() > 9 {
2094+
if candidates.len() > 9 && !self.tcx.sess.opts.verbose {
20912095
format!("\nand {} others", candidates.len() - 8)
20922096
} else {
20932097
String::new()

0 commit comments

Comments
 (0)