Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not complain about unconstrained params when Self is Ty Error #64108

Merged
merged 4 commits into from
Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
review comments
  • Loading branch information
estebank committed Sep 3, 2019
commit 3cb1ed4279d8ca4528e3777d5470ca7dc85a976a
4 changes: 2 additions & 2 deletions src/librustc_typeck/constrained_generic_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ pub fn parameters_for_impl<'tcx>(
/// uniquely determined by `t` (see RFC 447). If it is true, return the list
/// of parameters whose values are needed in order to constrain `ty` - these
/// differ, with the latter being a superset, in the presence of projections.
pub fn parameters_for<'tcx, T: TypeFoldable<'tcx>>(
t: &T,
pub fn parameters_for<'tcx>(
t: &impl TypeFoldable<'tcx>,
include_nonconstraining: bool,
) -> Vec<Parameter> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spurious rustfmt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My guess is manual drive-by fixing... but who cares. ;)

let mut collector = ParameterCollector {
Expand Down
10 changes: 10 additions & 0 deletions src/test/ui/issues/issue-36836.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Previously, in addition to the real cause of the problem as seen below,
// the compiler would tell the user:
//
// ```
// error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or
// predicates
// ```
//
// With this test, we check that only the relevant error is emitted.

trait Foo {}
estebank marked this conversation as resolved.
Show resolved Hide resolved

impl<T> Foo for Bar<T> {} //~ ERROR cannot find type `Bar` in this scope
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-36836.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0412]: cannot find type `Bar` in this scope
--> $DIR/issue-36836.rs:3:17
--> $DIR/issue-36836.rs:13:17
|
LL | impl<T> Foo for Bar<T> {}
| ^^^ not found in this scope
Expand Down