diff options
| author | bors <bors@rust-lang.org> | 2024-06-11 22:20:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-11 22:20:35 +0000 |
| commit | ebcb862bbb9031c4969c06ec73d44780ea37d0ff (patch) | |
| tree | f71fabd3f6c637b9eeb5afb72180a50f8ba285b3 /compiler/rustc_trait_selection/src | |
| parent | d0227c6a19c2d6e8dceb87c7a2776dc2b10d2a04 (diff) | |
| parent | e37c423f106a16302718c5e413166b74ea3d4583 (diff) | |
| download | rust-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.rs | 8 |
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() |
