/// 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 {
+// 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
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