Expand list of trait implementers in E0277 when calling rustc with --verbose
Signed-off-by: rongfu.leng <lenronfu@gmail.com>
This commit is contained in:
parent
db8aca4812
commit
69769fc797
1 changed files with 6 additions and 2 deletions
|
@ -2082,12 +2082,16 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||
})
|
||||
.collect();
|
||||
|
||||
let end = if candidates.len() <= 9 { candidates.len() } else { 8 };
|
||||
let end = if candidates.len() <= 9 || self.tcx.sess.opts.verbose {
|
||||
candidates.len()
|
||||
} else {
|
||||
8
|
||||
};
|
||||
err.help(format!(
|
||||
"the following {other}types implement trait `{}`:{}{}",
|
||||
trait_ref.print_trait_sugared(),
|
||||
candidates[..end].join(""),
|
||||
if candidates.len() > 9 {
|
||||
if candidates.len() > 9 && !self.tcx.sess.opts.verbose {
|
||||
format!("\nand {} others", candidates.len() - 8)
|
||||
} else {
|
||||
String::new()
|
||||
|
|
Loading…
Add table
Reference in a new issue