mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
fix tooling
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
@@ -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)?;
|
||||
|
||||
@@ -158,9 +158,3 @@ fn new(t: T) -> Self {
|
||||
Self(t)
|
||||
}
|
||||
}
|
||||
|
||||
// #4357
|
||||
type T = typeof(
|
||||
1);
|
||||
impl T for .. {
|
||||
}
|
||||
|
||||
@@ -167,7 +167,3 @@ fn new(t: T) -> Self {
|
||||
Self(t)
|
||||
}
|
||||
}
|
||||
|
||||
// #4357
|
||||
type T = typeof(1);
|
||||
impl T for .. {}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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`.
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user