fix tooling
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index 38b1240..1642293 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -1841,7 +1841,6 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
// Rustdoc handles `TyKind::Err`s by turning them into `Type::Infer`s.
TyKind::Infer(())
| TyKind::Err(_)
- | TyKind::Typeof(..)
| TyKind::InferDelegation(..)
| TyKind::TraitAscription(_) => Infer,
}
diff --git a/src/tools/clippy/clippy_lints/src/dereference.rs b/src/tools/clippy/clippy_lints/src/dereference.rs
index de13620..548f03c 100644
--- a/src/tools/clippy/clippy_lints/src/dereference.rs
+++ b/src/tools/clippy/clippy_lints/src/dereference.rs
@@ -830,7 +830,6 @@ fn for_hir_ty<'tcx>(ty: &'tcx hir::Ty<'tcx>) -> Self {
TyKind::OpaqueDef(..)
| TyKind::TraitAscription(..)
| TyKind::Infer(())
- | TyKind::Typeof(..)
| TyKind::TraitObject(..)
| TyKind::InferDelegation(..)
| TyKind::Err(_) => Self::Reborrow,
@@ -911,7 +910,7 @@ fn visit_infer(&mut self, inf_id: HirId, _inf_span: Span, kind: InferKind<'_>) -
}
fn visit_ty(&mut self, ty: &hir::Ty<'_, AmbigArg>) {
- if self.0 || matches!(ty.kind, TyKind::OpaqueDef(..) | TyKind::Typeof(_) | TyKind::Err(_)) {
+ if self.0 || matches!(ty.kind, TyKind::OpaqueDef(..) | TyKind::Err(_)) {
self.0 = true;
} else {
walk_ty(self, ty);
diff --git a/src/tools/clippy/clippy_utils/src/ast_utils/mod.rs b/src/tools/clippy/clippy_utils/src/ast_utils/mod.rs
index 04a64e0..4bdbfc8 100644
--- a/src/tools/clippy/clippy_utils/src/ast_utils/mod.rs
+++ b/src/tools/clippy/clippy_utils/src/ast_utils/mod.rs
@@ -875,7 +875,6 @@ pub fn eq_ty(l: &Ty, r: &Ty) -> bool {
(Path(lq, lp), Path(rq, rp)) => both(lq.as_deref(), rq.as_deref(), eq_qself) && eq_path(lp, rp),
(TraitObject(lg, ls), TraitObject(rg, rs)) => ls == rs && over(lg, rg, eq_generic_bound),
(ImplTrait(_, lg), ImplTrait(_, rg)) => over(lg, rg, eq_generic_bound),
- (Typeof(l), Typeof(r)) => eq_expr(&l.value, &r.value),
(MacCall(l), MacCall(r)) => eq_mac_call(l, r),
_ => false,
}
diff --git a/src/tools/clippy/clippy_utils/src/check_proc_macro.rs b/src/tools/clippy/clippy_utils/src/check_proc_macro.rs
index 544218e..50d9136 100644
--- a/src/tools/clippy/clippy_utils/src/check_proc_macro.rs
+++ b/src/tools/clippy/clippy_utils/src/check_proc_macro.rs
@@ -524,11 +524,10 @@ fn ast_ty_search_pat(ty: &ast::Ty) -> (Pat, Pat) {
TyKind::ImplicitSelf
// experimental
- |TyKind::Pat(..)
+ | TyKind::Pat(..)
// unused
| TyKind::CVarArgs
- | TyKind::Typeof(_)
// placeholder
| TyKind::Dummy
diff --git a/src/tools/clippy/clippy_utils/src/hir_utils.rs b/src/tools/clippy/clippy_utils/src/hir_utils.rs
index b286701..c6d82c0 100644
--- a/src/tools/clippy/clippy_utils/src/hir_utils.rs
+++ b/src/tools/clippy/clippy_utils/src/hir_utils.rs
@@ -1309,9 +1309,6 @@ pub fn hash_tykind(&mut self, ty: &TyKind<'_>) {
TyKind::TraitObject(_, lifetime) => {
self.hash_lifetime(lifetime);
},
- TyKind::Typeof(anon_const) => {
- self.hash_body(anon_const.body);
- },
TyKind::UnsafeBinder(binder) => {
self.hash_ty(binder.inner_ty);
},
diff --git a/src/tools/rustfmt/src/types.rs b/src/tools/rustfmt/src/types.rs
index 242d8c23..2d7bc59 100644
--- a/src/tools/rustfmt/src/types.rs
+++ b/src/tools/rustfmt/src/types.rs
@@ -8,8 +8,7 @@
use crate::config::lists::*;
use crate::config::{IndentStyle, StyleEdition, TypeDensity};
use crate::expr::{
- ExprType, RhsAssignKind, format_expr, rewrite_assign_rhs, rewrite_call, rewrite_tuple,
- rewrite_unary_prefix,
+ ExprType, RhsAssignKind, format_expr, rewrite_assign_rhs, rewrite_tuple, rewrite_unary_prefix,
};
use crate::lists::{
ListFormatting, ListItem, Separator, definitive_tactic, itemize_list, write_list,
@@ -1031,13 +1030,6 @@ fn rewrite_result(&self, context: &RewriteContext<'_>, shape: Shape) -> RewriteR
}
ast::TyKind::CVarArgs => Ok("...".to_owned()),
ast::TyKind::Dummy | ast::TyKind::Err(_) => Ok(context.snippet(self.span).to_owned()),
- ast::TyKind::Typeof(ref anon_const) => rewrite_call(
- context,
- "typeof",
- &[anon_const.value.clone()],
- self.span,
- shape,
- ),
ast::TyKind::Pat(ref ty, ref pat) => {
let ty = ty.rewrite_result(context, shape)?;
let pat = pat.rewrite_result(context, shape)?;
diff --git a/src/tools/rustfmt/tests/source/type.rs b/src/tools/rustfmt/tests/source/type.rs
index 213fad7..09ec22c 100644
--- a/src/tools/rustfmt/tests/source/type.rs
+++ b/src/tools/rustfmt/tests/source/type.rs
@@ -158,9 +158,3 @@ fn new(t: T) -> Self {
Self(t)
}
}
-
-// #4357
-type T = typeof(
-1);
-impl T for .. {
-}
diff --git a/src/tools/rustfmt/tests/target/type.rs b/src/tools/rustfmt/tests/target/type.rs
index 93479f8..623192b 100644
--- a/src/tools/rustfmt/tests/target/type.rs
+++ b/src/tools/rustfmt/tests/target/type.rs
@@ -167,7 +167,3 @@ fn new(t: T) -> Self {
Self(t)
}
}
-
-// #4357
-type T = typeof(1);
-impl T for .. {}
diff --git a/tests/rustdoc-ui/issues/ice-typeof-102986.rs b/tests/rustdoc-ui/issues/ice-typeof-102986.rs
deleted file mode 100644
index b1ad19c..0000000
--- a/tests/rustdoc-ui/issues/ice-typeof-102986.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-// https://github.com/rust-lang/rust/issues/102986
-struct Struct {
- y: (typeof("hey"),),
- //~^ ERROR `typeof` is a reserved keyword but unimplemented
-}
diff --git a/tests/rustdoc-ui/issues/ice-typeof-102986.stderr b/tests/rustdoc-ui/issues/ice-typeof-102986.stderr
deleted file mode 100644
index 02e257a..0000000
--- a/tests/rustdoc-ui/issues/ice-typeof-102986.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0516]: `typeof` is a reserved keyword but unimplemented
- --> $DIR/ice-typeof-102986.rs:3:9
- |
-LL | y: (typeof("hey"),),
- | ^^^^^^^^^^^^^ reserved keyword
- |
-help: consider replacing `typeof(...)` with an actual type
- |
-LL - y: (typeof("hey"),),
-LL + y: (&str,),
- |
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0516`.
diff --git a/tests/ui/error-codes/E0516.stderr b/tests/ui/error-codes/E0516.stderr
index 4a34198..b1a9fae 100644
--- a/tests/ui/error-codes/E0516.stderr
+++ b/tests/ui/error-codes/E0516.stderr
@@ -1,8 +1,8 @@
error[E0516]: `typeof` is a reserved keyword but unimplemented
- --> $DIR/E0516.rs:2:19
+ --> $DIR/E0516.rs:2:12
|
LL | let x: typeof(92) = 92;
- | ^^
+ | ^^^^^^^^^^
|
= note: consider replacing `typeof(...)` with an actual type