Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
190589f
Use structured suggestion for restricting bounds
estebank Oct 7, 2019
5b7ffd9
Handle more cases
estebank Oct 8, 2019
dbd75c8
Handle more cases involving `impl` and `trait`
estebank Oct 8, 2019
99ab45b
Handle `Self` restriction needed
estebank Oct 8, 2019
ca1885d
Update some tests involving `Self`
estebank Oct 8, 2019
b81df6b
Consider trait aliases
estebank Oct 8, 2019
daa8491
Update NLL tests
estebank Oct 8, 2019
5cc99ee
Handle missing projection restriction
estebank Oct 9, 2019
bc744bc
Suggest associated bound restrictions in `impl`s
estebank Oct 9, 2019
ab7d8f0
Deduplicate some code and apply review comments
estebank Oct 10, 2019
39a9e2e
Remove useless `help`
estebank Oct 10, 2019
8cabb42
Remove trailing whitespace
estebank Oct 10, 2019
9c525ee
review comments
estebank Oct 15, 2019
9ed463a
Do not suggest restriction on spans originating in macros
estebank Oct 15, 2019
9ecd1d2
Simplify code
estebank Oct 15, 2019
c6dce78
Fix comparison after rebase
estebank Oct 15, 2019
470e9d2
Rc: value -> allocation
RalfJung Oct 17, 2019
868a772
more consistency and clarification
RalfJung Oct 17, 2019
5697432
BTreeSet symmetric_difference & union optimized, cleaned
ssomers Oct 8, 2019
696cba6
the exampleis about drop, not (de)allocation
RalfJung Oct 19, 2019
fac34eb
bump miri
RalfJung Oct 19, 2019
52a31f7
some more Rc tweaks
RalfJung Oct 19, 2019
1b38463
do all the same edits with Arc
RalfJung Oct 19, 2019
ef8ac78
Rollup merge of #65192 - estebank:restrict-bound, r=matthewjasper
Centril Oct 19, 2019
7c0186a
Rollup merge of #65226 - ssomers:master, r=bluss
Centril Oct 19, 2019
df2c324
Rollup merge of #65505 - RalfJung:rc, r=Centril
Centril Oct 19, 2019
a9d40b4
Rollup merge of #65594 - RalfJung:miri, r=RalfJung
Centril Oct 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove useless help
  • Loading branch information
estebank committed Oct 15, 2019
commit 39a9e2ecba1797ef196725c25f48746834d8ac8f
11 changes: 1 addition & 10 deletions src/librustc/traits/error_reporting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -969,19 +969,10 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
trait_ref: &ty::PolyTraitRef<'_>,
body_id: hir::HirId,
) {
debug!(
"suggest_restricting_param_bound trait_ref={:?} ty={:?} ({:?})",
trait_ref,
trait_ref.self_ty(),
trait_ref.self_ty().kind,
);
let (param_ty, projection) = match &trait_ref.self_ty().kind {
ty::Param(param_ty) => (Some(param_ty), None),
ty::Projection(projection) => (None, Some(projection)),
_ => {
err.help(&format!("consider adding a `where {}` bound", trait_ref.to_predicate()));
return;
}
_ => return,
};

let mut suggest_restriction = |generics: &hir::Generics, msg| {
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/partialeq_help.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ LL | a == b;
| ^^ no implementation for `&T == T`
|
= help: the trait `std::cmp::PartialEq<T>` is not implemented for `&T`
= help: consider adding a `where &T: std::cmp::PartialEq<T>` bound

error: aborting due to previous error

Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/traits/trait-suggest-where-clause.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ error[E0277]: the trait bound `u64: std::convert::From<T>` is not satisfied
LL | <u64 as From<T>>::from;
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<T>` is not implemented for `u64`
|
= help: consider adding a `where u64: std::convert::From<T>` bound
= note: required by `std::convert::From::from`

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

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