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();
|
.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!(
|
err.help(format!(
|
||||||
"the following {other}types implement trait `{}`:{}{}",
|
"the following {other}types implement trait `{}`:{}{}",
|
||||||
trait_ref.print_trait_sugared(),
|
trait_ref.print_trait_sugared(),
|
||||||
candidates[..end].join(""),
|
candidates[..end].join(""),
|
||||||
if candidates.len() > 9 {
|
if candidates.len() > 9 && !self.tcx.sess.opts.verbose {
|
||||||
format!("\nand {} others", candidates.len() - 8)
|
format!("\nand {} others", candidates.len() - 8)
|
||||||
} else {
|
} else {
|
||||||
String::new()
|
String::new()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue