1use rustc_data_structures::fx::FxIndexSet;
5use rustc_errors::ErrorGuaranteed;
6use rustc_infer::infer::{DefineOpaqueTypes, InferCtxt, TyCtxtInferExt};
7use rustc_lint_defs::builtin::UNCOVERED_PARAM_IN_PROJECTION;
8use rustc_middle::ty::{
9 self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, TypingMode,
10 Unnormalized,
11};
12use rustc_middle::{bug, span_bug};
13use rustc_span::def_id::{DefId, LocalDefId};
14use rustc_trait_selection::traits::{
15 self, IsFirstInputType, OrphanCheckErr, OrphanCheckMode, UncoveredTyParams,
16};
17use tracing::{debug, instrument};
18
19use crate::diagnostics;
20
21#[allow(clippy :: suspicious_else_formatting)]
{
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() ||
{ false } {
__tracing_attr_span =
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("orphan_check_impl",
"rustc_hir_analysis::coherence::orphan",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_hir_analysis/src/coherence/orphan.rs"),
::tracing_core::__macro_support::Option::Some(21u32),
::tracing_core::__macro_support::Option::Some("rustc_hir_analysis::coherence::orphan"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("impl_def_id")
}> =
::tracing::__macro_support::FieldName::new("impl_def_id");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() }
&&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::new(meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&impl_def_id)
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
};
__tracing_attr_guard = __tracing_attr_span.enter();
}
#[warn(clippy :: suspicious_else_formatting)]
{
#[allow(unknown_lints, unreachable_code, clippy ::
diverging_sub_expression, clippy :: empty_loop, clippy ::
let_unit_value, clippy :: let_with_type_underscore, clippy ::
needless_return, clippy :: unreachable)]
if false {
let __tracing_attr_fake_return: Result<(), ErrorGuaranteed> =
loop {};
return __tracing_attr_fake_return;
}
{
let trait_ref =
tcx.impl_trait_ref(impl_def_id).instantiate_identity().skip_norm_wip();
trait_ref.error_reported()?;
match orphan_check(tcx, impl_def_id, OrphanCheckMode::Proper) {
Ok(()) => {}
Err(err) =>
match orphan_check(tcx, impl_def_id,
OrphanCheckMode::Compat) {
Ok(()) =>
match err {
OrphanCheckErr::UncoveredTyParams(uncovered_ty_params) => {
let hir_id = tcx.local_def_id_to_hir_id(impl_def_id);
for param_def_id in uncovered_ty_params.uncovered {
let ident = tcx.item_ident(param_def_id);
tcx.emit_node_span_lint(UNCOVERED_PARAM_IN_PROJECTION,
hir_id, ident.span,
diagnostics::UncoveredTyParam {
param: ident,
local_ty: uncovered_ty_params.local_ty,
});
}
}
OrphanCheckErr::NonLocalInputType(_) => {
::rustc_middle::util::bug::bug_fmt(format_args!("orphanck: shouldn\'t\'ve gotten non-local input tys in compat mode"))
}
},
Err(err) =>
return Err(emit_orphan_check_error(tcx, trait_ref,
impl_def_id, err)),
},
}
let trait_def_id = trait_ref.def_id;
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event compiler/rustc_hir_analysis/src/coherence/orphan.rs:92",
"rustc_hir_analysis::coherence::orphan",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_hir_analysis/src/coherence/orphan.rs"),
::tracing_core::__macro_support::Option::Some(92u32),
::tracing_core::__macro_support::Option::Some("rustc_hir_analysis::coherence::orphan"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("trait_ref={0:?} trait_def_id={1:?} trait_is_auto={2}",
trait_ref, trait_def_id, tcx.trait_is_auto(trait_def_id)) as
&dyn ::tracing::field::Value))])
});
} else { ; }
};
if tcx.trait_is_auto(trait_def_id) {
let self_ty = tcx.expand_free_alias_tys(trait_ref.self_ty());
enum LocalImpl {
Allow,
Disallow {
problematic_kind: &'static str,
},
}
enum NonlocalImpl {
Allow,
DisallowBecauseNonlocal,
DisallowOther,
}
let (local_impl, nonlocal_impl) =
match self_ty.kind() {
ty::Adt(self_def, _) =>
(LocalImpl::Allow,
if self_def.did().is_local() {
NonlocalImpl::Allow
} else { NonlocalImpl::DisallowBecauseNonlocal }),
ty::Foreign(did) =>
(LocalImpl::Allow,
if did.is_local() {
NonlocalImpl::Allow
} else { NonlocalImpl::DisallowBecauseNonlocal }),
ty::Dynamic(..) =>
(LocalImpl::Disallow { problematic_kind: "trait object" },
NonlocalImpl::DisallowOther),
ty::Param(..) =>
(if self_ty.is_sized(tcx,
ty::TypingEnv::non_body_analysis(tcx, impl_def_id)) {
LocalImpl::Allow
} else {
LocalImpl::Disallow { problematic_kind: "generic type" }
}, NonlocalImpl::DisallowOther),
ty::Alias(_, ty::AliasTy { kind, .. }) => {
let problematic_kind =
match kind {
ty::Projection { .. } => "associated type",
ty::Free { .. } => "type alias",
ty::Opaque { .. } => "opaque type",
ty::Inherent { .. } => "associated type",
};
(LocalImpl::Disallow { problematic_kind },
NonlocalImpl::DisallowOther)
}
ty::Bool | ty::Pat(..) | ty::Char | ty::Int(..) |
ty::Uint(..) | ty::Float(..) | ty::Str | ty::Array(..) |
ty::Slice(..) | ty::RawPtr(..) | ty::Ref(..) | ty::FnPtr(..)
| ty::Never | ty::Tuple(..) | ty::UnsafeBinder(_) =>
(LocalImpl::Allow, NonlocalImpl::DisallowOther),
ty::FnDef(..) | ty::Closure(..) | ty::CoroutineClosure(..) |
ty::Coroutine(..) | ty::CoroutineWitness(..) | ty::Bound(..)
| ty::Placeholder(..) | ty::Infer(..) => {
let sp = tcx.def_span(impl_def_id);
::rustc_middle::util::bug::span_bug_fmt(sp,
format_args!("weird self type for autotrait impl"))
}
ty::Error(..) => (LocalImpl::Allow, NonlocalImpl::Allow),
};
if trait_def_id.is_local() {
match local_impl {
LocalImpl::Allow => {}
LocalImpl::Disallow { problematic_kind } => {
return Err(tcx.dcx().emit_err(diagnostics::TraitsWithDefaultImpl {
span: tcx.def_span(impl_def_id),
traits: tcx.def_path_str(trait_def_id),
problematic_kind,
self_ty,
}));
}
}
} else {
match nonlocal_impl {
NonlocalImpl::Allow => {}
NonlocalImpl::DisallowBecauseNonlocal => {
return Err(tcx.dcx().emit_err(diagnostics::CrossCrateTraitsDefined {
span: tcx.def_span(impl_def_id),
traits: tcx.def_path_str(trait_def_id),
}));
}
NonlocalImpl::DisallowOther => {
return Err(tcx.dcx().emit_err(diagnostics::CrossCrateTraits {
span: tcx.def_span(impl_def_id),
traits: tcx.def_path_str(trait_def_id),
self_ty,
}));
}
}
}
}
Ok(())
}
}
}#[instrument(level = "debug", skip(tcx))]
22pub(crate) fn orphan_check_impl(
23 tcx: TyCtxt<'_>,
24 impl_def_id: LocalDefId,
25) -> Result<(), ErrorGuaranteed> {
26 let trait_ref = tcx.impl_trait_ref(impl_def_id).instantiate_identity().skip_norm_wip();
27 trait_ref.error_reported()?;
28
29 match orphan_check(tcx, impl_def_id, OrphanCheckMode::Proper) {
30 Ok(()) => {}
31 Err(err) => match orphan_check(tcx, impl_def_id, OrphanCheckMode::Compat) {
32 Ok(()) => match err {
33 OrphanCheckErr::UncoveredTyParams(uncovered_ty_params) => {
34 let hir_id = tcx.local_def_id_to_hir_id(impl_def_id);
35
36 for param_def_id in uncovered_ty_params.uncovered {
37 let ident = tcx.item_ident(param_def_id);
38
39 tcx.emit_node_span_lint(
40 UNCOVERED_PARAM_IN_PROJECTION,
41 hir_id,
42 ident.span,
43 diagnostics::UncoveredTyParam {
44 param: ident,
45 local_ty: uncovered_ty_params.local_ty,
46 },
47 );
48 }
49 }
50 OrphanCheckErr::NonLocalInputType(_) => {
51 bug!("orphanck: shouldn't've gotten non-local input tys in compat mode")
52 }
53 },
54 Err(err) => return Err(emit_orphan_check_error(tcx, trait_ref, impl_def_id, err)),
55 },
56 }
57
58 let trait_def_id = trait_ref.def_id;
59
60 debug!(
93 "trait_ref={:?} trait_def_id={:?} trait_is_auto={}",
94 trait_ref,
95 trait_def_id,
96 tcx.trait_is_auto(trait_def_id)
97 );
98
99 if tcx.trait_is_auto(trait_def_id) {
100 let self_ty = tcx.expand_free_alias_tys(trait_ref.self_ty());
107
108 enum LocalImpl {
144 Allow,
145 Disallow { problematic_kind: &'static str },
146 }
147
148 enum NonlocalImpl {
156 Allow,
157 DisallowBecauseNonlocal,
158 DisallowOther,
159 }
160
161 let (local_impl, nonlocal_impl) = match self_ty.kind() {
164 ty::Adt(self_def, _) => (
167 LocalImpl::Allow,
168 if self_def.did().is_local() {
169 NonlocalImpl::Allow
170 } else {
171 NonlocalImpl::DisallowBecauseNonlocal
172 },
173 ),
174
175 ty::Foreign(did) => (
178 LocalImpl::Allow,
179 if did.is_local() {
180 NonlocalImpl::Allow
181 } else {
182 NonlocalImpl::DisallowBecauseNonlocal
183 },
184 ),
185
186 ty::Dynamic(..) => (
188 LocalImpl::Disallow { problematic_kind: "trait object" },
189 NonlocalImpl::DisallowOther,
190 ),
191
192 ty::Param(..) => (
195 if self_ty.is_sized(tcx, ty::TypingEnv::non_body_analysis(tcx, impl_def_id)) {
196 LocalImpl::Allow
197 } else {
198 LocalImpl::Disallow { problematic_kind: "generic type" }
199 },
200 NonlocalImpl::DisallowOther,
201 ),
202
203 ty::Alias(_, ty::AliasTy { kind, .. }) => {
204 let problematic_kind = match kind {
205 ty::Projection { .. } => "associated type",
211 ty::Free { .. } => "type alias",
214 ty::Opaque { .. } => "opaque type",
217 ty::Inherent { .. } => "associated type",
226 };
227 (LocalImpl::Disallow { problematic_kind }, NonlocalImpl::DisallowOther)
228 }
229
230 ty::Bool
231 | ty::Pat(..)
232 | ty::Char
233 | ty::Int(..)
234 | ty::Uint(..)
235 | ty::Float(..)
236 | ty::Str
237 | ty::Array(..)
238 | ty::Slice(..)
239 | ty::RawPtr(..)
240 | ty::Ref(..)
241 | ty::FnPtr(..)
242 | ty::Never
243 | ty::Tuple(..)
244 | ty::UnsafeBinder(_) => (LocalImpl::Allow, NonlocalImpl::DisallowOther),
245
246 ty::FnDef(..)
247 | ty::Closure(..)
248 | ty::CoroutineClosure(..)
249 | ty::Coroutine(..)
250 | ty::CoroutineWitness(..)
251 | ty::Bound(..)
252 | ty::Placeholder(..)
253 | ty::Infer(..) => {
254 let sp = tcx.def_span(impl_def_id);
255 span_bug!(sp, "weird self type for autotrait impl")
256 }
257
258 ty::Error(..) => (LocalImpl::Allow, NonlocalImpl::Allow),
259 };
260
261 if trait_def_id.is_local() {
262 match local_impl {
263 LocalImpl::Allow => {}
264 LocalImpl::Disallow { problematic_kind } => {
265 return Err(tcx.dcx().emit_err(diagnostics::TraitsWithDefaultImpl {
266 span: tcx.def_span(impl_def_id),
267 traits: tcx.def_path_str(trait_def_id),
268 problematic_kind,
269 self_ty,
270 }));
271 }
272 }
273 } else {
274 match nonlocal_impl {
275 NonlocalImpl::Allow => {}
276 NonlocalImpl::DisallowBecauseNonlocal => {
277 return Err(tcx.dcx().emit_err(diagnostics::CrossCrateTraitsDefined {
278 span: tcx.def_span(impl_def_id),
279 traits: tcx.def_path_str(trait_def_id),
280 }));
281 }
282 NonlocalImpl::DisallowOther => {
283 return Err(tcx.dcx().emit_err(diagnostics::CrossCrateTraits {
284 span: tcx.def_span(impl_def_id),
285 traits: tcx.def_path_str(trait_def_id),
286 self_ty,
287 }));
288 }
289 }
290 }
291 }
292
293 Ok(())
294}
295
296x;#[instrument(level = "debug", skip(tcx), ret)]
305fn orphan_check<'tcx>(
306 tcx: TyCtxt<'tcx>,
307 impl_def_id: LocalDefId,
308 mode: OrphanCheckMode,
309) -> Result<(), OrphanCheckErr<TyCtxt<'tcx>, FxIndexSet<DefId>>> {
310 let trait_ref = tcx.impl_trait_ref(impl_def_id);
313 debug!(trait_ref = ?trait_ref.skip_binder());
314
315 if let Some(def_id) = trait_ref.skip_binder().def_id.as_local() {
317 debug!("trait {def_id:?} is local to current crate");
318 return Ok(());
319 }
320
321 let infcx = tcx
323 .infer_ctxt()
324 .with_next_trait_solver(tcx.next_trait_solver_in_coherence())
325 .enable_next_solver_overflow_fcw(false)
326 .build(TypingMode::Coherence);
327 let cause = traits::ObligationCause::dummy();
328 let args = infcx.fresh_args_for_item(cause.span, impl_def_id.to_def_id());
329 let trait_ref = trait_ref.instantiate(tcx, args).skip_norm_wip();
330
331 let lazily_normalize_ty = |user_ty: Ty<'tcx>| {
332 let ty::Alias(..) = user_ty.kind() else { return Ok(user_ty) };
333
334 let ocx = traits::ObligationCtxt::new(&infcx);
335 let ty = ocx.normalize(&cause, ty::ParamEnv::empty(), Unnormalized::new_wip(user_ty));
336 let ty = infcx.resolve_vars_if_possible(ty);
337 let errors = ocx.try_evaluate_obligations();
338 if !errors.no_errors() {
339 return Ok(user_ty);
340 }
341
342 Ok::<_, !>(ty)
343 };
344
345 let result = traits::orphan_check_trait_ref(
346 &infcx,
347 trait_ref,
348 traits::InCrate::Local { mode },
349 lazily_normalize_ty,
350 )
351 .into_ok();
352
353 result.map_err(|err| match err {
355 OrphanCheckErr::UncoveredTyParams(UncoveredTyParams { uncovered, local_ty }) => {
356 let mut collector =
357 UncoveredTyParamCollector { infcx: &infcx, uncovered_params: Default::default() };
358 uncovered.visit_with(&mut collector);
359 debug_assert!(!collector.uncovered_params.is_empty());
361
362 OrphanCheckErr::UncoveredTyParams(UncoveredTyParams {
363 uncovered: collector.uncovered_params,
364 local_ty,
365 })
366 }
367 OrphanCheckErr::NonLocalInputType(tys) => {
368 let tys = infcx.probe(|_| {
369 for (arg, id_arg) in
372 std::iter::zip(args, ty::GenericArgs::identity_for_item(tcx, impl_def_id))
373 {
374 let _ = infcx.at(&cause, ty::ParamEnv::empty()).eq(
375 DefineOpaqueTypes::No,
376 arg,
377 id_arg,
378 );
379 }
380 infcx.resolve_vars_if_possible(tys)
381 });
382 OrphanCheckErr::NonLocalInputType(tys)
383 }
384 })
385}
386
387fn emit_orphan_check_error<'tcx>(
388 tcx: TyCtxt<'tcx>,
389 trait_ref: ty::TraitRef<'tcx>,
390 impl_def_id: LocalDefId,
391 err: traits::OrphanCheckErr<TyCtxt<'tcx>, FxIndexSet<DefId>>,
392) -> ErrorGuaranteed {
393 match err {
394 traits::OrphanCheckErr::NonLocalInputType(tys) => {
395 let item = tcx.hir_expect_item(impl_def_id);
396 let impl_ = item.expect_impl();
397 let of_trait = impl_.of_trait.unwrap();
398
399 let span = tcx.def_span(impl_def_id);
400 let mut diag = tcx.dcx().create_err(match trait_ref.self_ty().kind() {
401 ty::Adt(..) => diagnostics::OnlyCurrentTraits::Outside { span, note: () },
402 _ if trait_ref.self_ty().is_primitive() => {
403 diagnostics::OnlyCurrentTraits::Primitive { span, note: () }
404 }
405 _ => diagnostics::OnlyCurrentTraits::Arbitrary { span, note: () },
406 });
407
408 for &(mut ty, is_target_ty) in &tys {
409 let span = if #[allow(non_exhaustive_omitted_patterns)] match is_target_ty {
IsFirstInputType::Yes => true,
_ => false,
}matches!(is_target_ty, IsFirstInputType::Yes) {
410 impl_.self_ty.span
412 } else {
413 of_trait.trait_ref.path.span
415 };
416
417 ty = tcx.erase_and_anonymize_regions(ty);
418
419 let is_foreign =
420 !trait_ref.def_id.is_local() && #[allow(non_exhaustive_omitted_patterns)] match is_target_ty {
IsFirstInputType::No => true,
_ => false,
}matches!(is_target_ty, IsFirstInputType::No);
421
422 match *ty.kind() {
423 ty::Slice(_) => {
424 if is_foreign {
425 diag.subdiagnostic(diagnostics::OnlyCurrentTraitsForeign { span });
426 } else {
427 diag.subdiagnostic(diagnostics::OnlyCurrentTraitsName {
428 span,
429 name: "slices",
430 });
431 }
432 }
433 ty::Array(..) => {
434 if is_foreign {
435 diag.subdiagnostic(diagnostics::OnlyCurrentTraitsForeign { span });
436 } else {
437 diag.subdiagnostic(diagnostics::OnlyCurrentTraitsName {
438 span,
439 name: "arrays",
440 });
441 }
442 }
443 ty::Tuple(..) => {
444 if is_foreign {
445 diag.subdiagnostic(diagnostics::OnlyCurrentTraitsForeign { span });
446 } else {
447 diag.subdiagnostic(diagnostics::OnlyCurrentTraitsName {
448 span,
449 name: "tuples",
450 });
451 }
452 }
453 ty::Alias(_, ty::AliasTy { kind: ty::Opaque { .. }, .. }) => {
454 diag.subdiagnostic(diagnostics::OnlyCurrentTraitsOpaque { span });
455 }
456 ty::RawPtr(ptr_ty, mutbl) => {
457 if !trait_ref.self_ty().has_param() {
458 diag.subdiagnostic(diagnostics::OnlyCurrentTraitsPointerSugg {
459 wrapper_span: impl_.self_ty.span,
460 struct_span: item.span.shrink_to_lo(),
461 mut_key: mutbl.prefix_str(),
462 ptr_ty,
463 });
464 }
465 diag.subdiagnostic(diagnostics::OnlyCurrentTraitsPointer {
466 span,
467 pointer: ty,
468 });
469 }
470 ty::Adt(adt_def, _) => {
471 if is_foreign {
472 diag.subdiagnostic(diagnostics::OnlyCurrentTraitsForeign { span });
473 } else {
474 diag.subdiagnostic(diagnostics::OnlyCurrentTraitsAdt {
475 span,
476 name: tcx.def_path_str(adt_def.did()),
477 });
478 }
479 }
480 _ => {
481 if is_foreign {
482 diag.subdiagnostic(diagnostics::OnlyCurrentTraitsForeign { span });
483 } else {
484 diag.subdiagnostic(diagnostics::OnlyCurrentTraitsTy { span, ty });
485 }
486 }
487 }
488 }
489
490 diag.emit()
491 }
492 traits::OrphanCheckErr::UncoveredTyParams(UncoveredTyParams { uncovered, local_ty }) => {
493 let mut guar = None;
494 for param_def_id in uncovered {
495 guar.get_or_insert(tcx.dcx().emit_err(diagnostics::UncoveredTyParam {
496 param: tcx.item_ident(param_def_id),
497 local_ty,
498 }));
499 }
500 guar.unwrap()
501 }
502 }
503}
504
505struct UncoveredTyParamCollector<'cx, 'tcx> {
506 infcx: &'cx InferCtxt<'tcx>,
507 uncovered_params: FxIndexSet<DefId>,
508}
509
510impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for UncoveredTyParamCollector<'_, 'tcx> {
511 fn visit_ty(&mut self, ty: Ty<'tcx>) -> Self::Result {
512 if !ty.has_type_flags(ty::TypeFlags::HAS_TY_INFER) {
513 return;
514 }
515 let ty::Infer(ty::TyVar(vid)) = *ty.kind() else {
516 return ty.super_visit_with(self);
517 };
518 let origin = self.infcx.type_var_origin(vid);
519 if let Some(def_id) = origin.param_def_id {
520 self.uncovered_params.insert(def_id);
521 }
522 }
523
524 fn visit_const(&mut self, ct: ty::Const<'tcx>) -> Self::Result {
525 if ct.has_type_flags(ty::TypeFlags::HAS_TY_INFER) {
526 ct.super_visit_with(self)
527 }
528 }
529}