Skip to content

Commit cfee10c

Browse files
committed
remove outdated comment
1 parent bd36e69 commit cfee10c

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

compiler/rustc_lint/src/internal.rs

+4-11
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,10 @@ fn is_ty_or_ty_ctxt(cx: &LateContext<'_>, path: &Path<'_>) -> Option<String> {
242242
}
243243
// Only lint on `&Ty` and `&TyCtxt` if it is used outside of a trait.
244244
Res::SelfTyAlias { alias_to: did, is_trait_impl: false, .. } => {
245-
if let ty::Adt(adt, args) = cx.tcx.type_of(did).instantiate_identity().kind() {
246-
if let Some(name @ (sym::Ty | sym::TyCtxt)) = cx.tcx.get_diagnostic_name(adt.did())
247-
{
248-
// NOTE: This path is currently unreachable as `Ty<'tcx>` is
249-
// defined as a type alias meaning that `impl<'tcx> Ty<'tcx>`
250-
// is not actually allowed.
251-
//
252-
// I(@lcnr) still kept this branch in so we don't miss this
253-
// if we ever change it in the future.
254-
return Some(format!("{}<{}>", name, args[0]));
255-
}
245+
if let ty::Adt(adt, args) = cx.tcx.type_of(did).instantiate_identity().kind()
246+
&& let Some(name @ (sym::Ty | sym::TyCtxt)) = cx.tcx.get_diagnostic_name(adt.did())
247+
{
248+
return Some(format!("{}<{}>", name, args[0]));
256249
}
257250
}
258251
_ => (),

0 commit comments

Comments
 (0)