Skip to content

Commit 39a9e2e

Browse files
committed
Remove useless help
1 parent ab7d8f0 commit 39a9e2e

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

src/librustc/traits/error_reporting.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -969,19 +969,10 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
969969
trait_ref: &ty::PolyTraitRef<'_>,
970970
body_id: hir::HirId,
971971
) {
972-
debug!(
973-
"suggest_restricting_param_bound trait_ref={:?} ty={:?} ({:?})",
974-
trait_ref,
975-
trait_ref.self_ty(),
976-
trait_ref.self_ty().kind,
977-
);
978972
let (param_ty, projection) = match &trait_ref.self_ty().kind {
979973
ty::Param(param_ty) => (Some(param_ty), None),
980974
ty::Projection(projection) => (None, Some(projection)),
981-
_ => {
982-
err.help(&format!("consider adding a `where {}` bound", trait_ref.to_predicate()));
983-
return;
984-
}
975+
_ => return,
985976
};
986977

987978
let mut suggest_restriction = |generics: &hir::Generics, msg| {

src/test/ui/partialeq_help.stderr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | a == b;
55
| ^^ no implementation for `&T == T`
66
|
77
= help: the trait `std::cmp::PartialEq<T>` is not implemented for `&T`
8-
= help: consider adding a `where &T: std::cmp::PartialEq<T>` bound
98

109
error: aborting due to previous error
1110

src/test/ui/traits/trait-suggest-where-clause.stderr

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ error[E0277]: the trait bound `u64: std::convert::From<T>` is not satisfied
3939
LL | <u64 as From<T>>::from;
4040
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<T>` is not implemented for `u64`
4141
|
42-
= help: consider adding a `where u64: std::convert::From<T>` bound
4342
= note: required by `std::convert::From::from`
4443

4544
error[E0277]: the trait bound `u64: std::convert::From<<T as std::iter::Iterator>::Item>` is not satisfied
@@ -48,7 +47,6 @@ error[E0277]: the trait bound `u64: std::convert::From<<T as std::iter::Iterator
4847
LL | <u64 as From<<T as Iterator>::Item>>::from;
4948
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<<T as std::iter::Iterator>::Item>` is not implemented for `u64`
5049
|
51-
= help: consider adding a `where u64: std::convert::From<<T as std::iter::Iterator>::Item>` bound
5250
= note: required by `std::convert::From::from`
5351

5452
error[E0277]: the trait bound `Misc<_>: std::convert::From<T>` is not satisfied

0 commit comments

Comments
 (0)