Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cfee10c

Browse filesBrowse files
committed
remove outdated comment
1 parent bd36e69 commit cfee10c
Copy full SHA for cfee10c

File tree

Expand file treeCollapse file tree

1 file changed

+4
-11
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-11
lines changed

‎compiler/rustc_lint/src/internal.rs

Copy file name to clipboardExpand all lines: compiler/rustc_lint/src/internal.rs
+4-11Lines changed: 4 additions & 11 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.