diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-04-02 19:57:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-02 19:57:32 +0200 |
| commit | 6cb74ad99f8f6cc994ebe18d906ec1dd7ccd8b3d (patch) | |
| tree | 0c7dae9869d3e9fd19f6ffb4456aecc4d9268355 /compiler | |
| parent | 542f441d445026d0996eebee9ddddee98f5dc3e5 (diff) | |
| parent | 8f7735624924e3399a1abee68615a99072347cc9 (diff) | |
| download | rust-6cb74ad99f8f6cc994ebe18d906ec1dd7ccd8b3d.tar.gz rust-6cb74ad99f8f6cc994ebe18d906ec1dd7ccd8b3d.zip | |
Rollup merge of #83673 - hi-rustin:rustin-patch-suggestion, r=estebank
give full path of constraint in suggest_constraining_type_param close https://github.com/rust-lang/rust/issues/83513
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index 0549db06806..2b8c8d36973 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -28,6 +28,7 @@ use std::fmt; use super::InferCtxtPrivExt; use crate::traits::query::evaluate_obligation::InferCtxtExt as _; +use rustc_middle::ty::print::with_no_trimmed_paths; #[derive(Debug)] pub enum GeneratorInteriorOrUpvar { @@ -440,7 +441,8 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { { // Missing generic type parameter bound. let param_name = self_ty.to_string(); - let constraint = trait_ref.print_only_trait_path().to_string(); + let constraint = + with_no_trimmed_paths(|| trait_ref.print_only_trait_path().to_string()); if suggest_constraining_type_param( self.tcx, generics, |
