Skip to content

Commit e449daa

Browse files
committed
stop mentioning number of applicate implementations
1 parent 19d46b6 commit e449daa

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -2388,14 +2388,11 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
23882388
// If there is only one implementation of the trait, suggest using it.
23892389
// Otherwise, use a placeholder comment for the implementation.
23902390
let (message, impl_suggestion) = if non_blanket_impl_count == 1 {(
2391-
"use the fully-qualified path to the only available implementation".to_string(),
2391+
"use the fully-qualified path to the only available implementation",
23922392
format!("<{} as ", self.tcx.type_of(impl_def_id).instantiate_identity())
2393-
)} else {(
2394-
format!(
2395-
"use a fully-qualified path to a specific available implementation ({} found)",
2396-
non_blanket_impl_count
2397-
),
2398-
"</* self type */ as ".to_string()
2393+
)} else {
2394+
("use a fully-qualified path to a specific available implementation",
2395+
"</* self type */ as ".to_string()
23992396
)};
24002397
let mut suggestions = vec![(
24012398
path.span.shrink_to_lo(),

tests/ui/error-codes/E0283.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | fn create() -> u32;
77
LL | let cont: u32 = Generator::create();
88
| ^^^^^^^^^^^^^^^^^ cannot call associated function of trait
99
|
10-
help: use a fully-qualified path to a specific available implementation (2 found)
10+
help: use a fully-qualified path to a specific available implementation
1111
|
1212
LL | let cont: u32 = </* self type */ as Generator>::create();
1313
| +++++++++++++++++++ +

tests/ui/error-codes/E0790.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ LL | fn my_fn();
6363
LL | MyTrait2::my_fn();
6464
| ^^^^^^^^^^^^^^^ cannot call associated function of trait
6565
|
66-
help: use a fully-qualified path to a specific available implementation (2 found)
66+
help: use a fully-qualified path to a specific available implementation
6767
|
6868
LL | </* self type */ as MyTrait2>::my_fn();
6969
| +++++++++++++++++++ +

tests/ui/inference/need_type_info/infer-var-for-self-param.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0790]: cannot call associated function on trait without specifying the co
44
LL | let _ = (Default::default(),);
55
| ^^^^^^^^^^^^^^^^ cannot call associated function of trait
66
|
7-
help: use a fully-qualified path to a specific available implementation (271 found)
7+
help: use a fully-qualified path to a specific available implementation
88
|
99
LL | let _ = (</* self type */ as Default>::default(),);
1010
| +++++++++++++++++++ +

0 commit comments

Comments
 (0)