@@ -1292,7 +1292,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
12921292 // Ignore dependent defaults -- that is, where the default of one type
12931293 // parameter includes another (e.g., `<T, U = T>`). In those cases, we can't
12941294 // 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 ( ) {
12961296 wfcx. register_wf_obligation (
12971297 tcx. def_span ( param. def_id ) ,
12981298 Some ( WellFormedLoc :: Ty ( param. def_id . expect_local ( ) ) ) ,
@@ -1308,7 +1308,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
13081308 // for `struct Foo<const N: usize, const M: usize = { 1 - 2 }>`
13091309 // we should eagerly error.
13101310 let default_ct = tcx. const_param_default ( param. def_id ) . subst_identity ( ) ;
1311- if !default_ct. needs_subst ( ) {
1311+ if !default_ct. has_param ( ) {
13121312 wfcx. register_wf_obligation (
13131313 tcx. def_span ( param. def_id ) ,
13141314 None ,
@@ -1342,7 +1342,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
13421342 if is_our_default ( param) {
13431343 let default_ty = tcx. type_of ( param. def_id ) . subst_identity ( ) ;
13441344 // ... and it's not a dependent default, ...
1345- if !default_ty. needs_subst ( ) {
1345+ if !default_ty. has_param ( ) {
13461346 // ... then substitute it with the default.
13471347 return default_ty. into ( ) ;
13481348 }
@@ -1355,7 +1355,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
13551355 if is_our_default ( param) {
13561356 let default_ct = tcx. const_param_default ( param. def_id ) . subst_identity ( ) ;
13571357 // ... and it's not a dependent default, ...
1358- if !default_ct. needs_subst ( ) {
1358+ if !default_ct. has_param ( ) {
13591359 // ... then substitute it with the default.
13601360 return default_ct. into ( ) ;
13611361 }
0 commit comments