@@ -1292,7 +1292,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
1292
1292
// Ignore dependent defaults -- that is, where the default of one type
1293
1293
// parameter includes another (e.g., `<T, U = T>`). In those cases, we can't
1294
1294
// be sure if it will error or not as user might always specify the other.
1295
- if !ty. needs_subst ( ) {
1295
+ if !ty. has_param ( ) {
1296
1296
wfcx. register_wf_obligation (
1297
1297
tcx. def_span ( param. def_id ) ,
1298
1298
Some ( WellFormedLoc :: Ty ( param. def_id . expect_local ( ) ) ) ,
@@ -1308,7 +1308,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
1308
1308
// for `struct Foo<const N: usize, const M: usize = { 1 - 2 }>`
1309
1309
// we should eagerly error.
1310
1310
let default_ct = tcx. const_param_default ( param. def_id ) . subst_identity ( ) ;
1311
- if !default_ct. needs_subst ( ) {
1311
+ if !default_ct. has_param ( ) {
1312
1312
wfcx. register_wf_obligation (
1313
1313
tcx. def_span ( param. def_id ) ,
1314
1314
None ,
@@ -1342,7 +1342,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
1342
1342
if is_our_default ( param) {
1343
1343
let default_ty = tcx. type_of ( param. def_id ) . subst_identity ( ) ;
1344
1344
// ... and it's not a dependent default, ...
1345
- if !default_ty. needs_subst ( ) {
1345
+ if !default_ty. has_param ( ) {
1346
1346
// ... then substitute it with the default.
1347
1347
return default_ty. into ( ) ;
1348
1348
}
@@ -1355,7 +1355,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
1355
1355
if is_our_default ( param) {
1356
1356
let default_ct = tcx. const_param_default ( param. def_id ) . subst_identity ( ) ;
1357
1357
// ... and it's not a dependent default, ...
1358
- if !default_ct. needs_subst ( ) {
1358
+ if !default_ct. has_param ( ) {
1359
1359
// ... then substitute it with the default.
1360
1360
return default_ct. into ( ) ;
1361
1361
}
0 commit comments