diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-09-02 20:51:31 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-09-02 20:51:31 -0700 |
| commit | 3cb1ed4279d8ca4528e3777d5470ca7dc85a976a (patch) | |
| tree | 34f0d1e906ce9cf7efd65a8c46aa0f2fae2dc7b5 | |
| parent | 37f5cc22391e693523e8320a1d5c214610790911 (diff) | |
| download | rust-3cb1ed4279d8ca4528e3777d5470ca7dc85a976a.tar.gz rust-3cb1ed4279d8ca4528e3777d5470ca7dc85a976a.zip | |
review comments
| -rw-r--r-- | src/librustc_typeck/constrained_generic_params.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-36836.rs | 10 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-36836.stderr | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/librustc_typeck/constrained_generic_params.rs b/src/librustc_typeck/constrained_generic_params.rs index c95f81506cd..dd44f86717f 100644 --- a/src/librustc_typeck/constrained_generic_params.rs +++ b/src/librustc_typeck/constrained_generic_params.rs @@ -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> { let mut collector = ParameterCollector { diff --git a/src/test/ui/issues/issue-36836.rs b/src/test/ui/issues/issue-36836.rs index 56d5a7cca45..99c56213153 100644 --- a/src/test/ui/issues/issue-36836.rs +++ b/src/test/ui/issues/issue-36836.rs @@ -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 {} impl<T> Foo for Bar<T> {} //~ ERROR cannot find type `Bar` in this scope diff --git a/src/test/ui/issues/issue-36836.stderr b/src/test/ui/issues/issue-36836.stderr index bfda9b0bbdd..418194fac99 100644 --- a/src/test/ui/issues/issue-36836.stderr +++ b/src/test/ui/issues/issue-36836.stderr @@ -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 |
