1
Fork 0

review comments

This commit is contained in:
Esteban Küber 2019-09-02 20:51:31 -07:00
parent 37f5cc2239
commit 3cb1ed4279
3 changed files with 13 additions and 3 deletions

View file

@ -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 {

View file

@ -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

View file

@ -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