Skip to content

Commit 3cb1ed4

Browse files
committed
review comments
1 parent 37f5cc2 commit 3cb1ed4

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/librustc_typeck/constrained_generic_params.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ pub fn parameters_for_impl<'tcx>(
3636
/// uniquely determined by `t` (see RFC 447). If it is true, return the list
3737
/// of parameters whose values are needed in order to constrain `ty` - these
3838
/// differ, with the latter being a superset, in the presence of projections.
39-
pub fn parameters_for<'tcx, T: TypeFoldable<'tcx>>(
40-
t: &T,
39+
pub fn parameters_for<'tcx>(
40+
t: &impl TypeFoldable<'tcx>,
4141
include_nonconstraining: bool,
4242
) -> Vec<Parameter> {
4343
let mut collector = ParameterCollector {

src/test/ui/issues/issue-36836.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Previously, in addition to the real cause of the problem as seen below,
2+
// the compiler would tell the user:
3+
//
4+
// ```
5+
// error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or
6+
// predicates
7+
// ```
8+
//
9+
// With this test, we check that only the relevant error is emitted.
10+
111
trait Foo {}
212

313
impl<T> Foo for Bar<T> {} //~ ERROR cannot find type `Bar` in this scope

src/test/ui/issues/issue-36836.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0412]: cannot find type `Bar` in this scope
2-
--> $DIR/issue-36836.rs:3:17
2+
--> $DIR/issue-36836.rs:13:17
33
|
44
LL | impl<T> Foo for Bar<T> {}
55
| ^^^ not found in this scope

0 commit comments

Comments
 (0)