about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-11 22:20:35 +0000
committerbors <bors@rust-lang.org>2024-06-11 22:20:35 +0000
commitebcb862bbb9031c4969c06ec73d44780ea37d0ff (patch)
treef71fabd3f6c637b9eeb5afb72180a50f8ba285b3 /compiler/rustc_trait_selection/src
parentd0227c6a19c2d6e8dceb87c7a2776dc2b10d2a04 (diff)
parente37c423f106a16302718c5e413166b74ea3d4583 (diff)
downloadrust-ebcb862bbb9031c4969c06ec73d44780ea37d0ff.tar.gz
rust-ebcb862bbb9031c4969c06ec73d44780ea37d0ff.zip
Auto merge of #126284 - jieyouxu:rollup-nq7bf9k, r=jieyouxu
Rollup of 6 pull requests

Successful merges:

 - #115974 (Split core's PanicInfo and std's PanicInfo)
 - #125659 (Remove usage of `isize` in example)
 - #125669 (CI: Update riscv64gc-linux job to Ubuntu 22.04, rename to riscv64gc-gnu)
 - #125684 (Account for existing bindings when suggesting `pin!()`)
 - #126055 (Expand list of trait implementers in E0277 when calling rustc with --verbose)
 - #126174 (Migrate `tests/run-make/prefer-dylib` to `rmake.rs`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
index 46b13788186..aeb7f587a26 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
@@ -2069,12 +2069,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()