Manual rustfmt

This commit is contained in:
Oli Scherer 2024-03-11 17:47:45 +00:00
parent 926bfe5078
commit bbbf06d5e9
4 changed files with 5 additions and 5 deletions

View File

@ -226,7 +226,7 @@ fn check_static_inhabited(tcx: TyCtxt<'_>, def_id: LocalDefId) {
Ok(l) => l, Ok(l) => l,
// Foreign statics that overflow their allowed size should emit an error // Foreign statics that overflow their allowed size should emit an error
Err(LayoutError::SizeOverflow(_)) Err(LayoutError::SizeOverflow(_))
if matches!(tcx.def_kind(def_id), DefKind::Static{..} if matches!(tcx.def_kind(def_id), DefKind::Static{ .. }
if tcx.def_kind(tcx.local_parent(def_id)) == DefKind::ForeignMod) => if tcx.def_kind(tcx.local_parent(def_id)) == DefKind::ForeignMod) =>
{ {
tcx.dcx().emit_err(errors::TooLargeStatic { span }); tcx.dcx().emit_err(errors::TooLargeStatic { span });

View File

@ -574,7 +574,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
ResolutionError::GenericParamsFromOuterItem(outer_res, has_generic_params, def_kind) => { ResolutionError::GenericParamsFromOuterItem(outer_res, has_generic_params, def_kind) => {
use errs::GenericParamsFromOuterItemLabel as Label; use errs::GenericParamsFromOuterItemLabel as Label;
let static_or_const = match def_kind { let static_or_const = match def_kind {
DefKind::Static{..} => Some(errs::GenericParamsFromOuterItemStaticOrConst::Static), DefKind::Static{ .. } => Some(errs::GenericParamsFromOuterItemStaticOrConst::Static),
DefKind::Const => Some(errs::GenericParamsFromOuterItemStaticOrConst::Const), DefKind::Const => Some(errs::GenericParamsFromOuterItemStaticOrConst::Const),
_ => None, _ => None,
}; };

View File

@ -3645,7 +3645,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
} }
Some(res) Some(res)
} }
Res::Def(DefKind::Ctor(..) | DefKind::Const | DefKind::Static{..}, _) => { Res::Def(DefKind::Ctor(..) | DefKind::Const | DefKind::Static { .. }, _) => {
// This is unambiguously a fresh binding, either syntactically // This is unambiguously a fresh binding, either syntactically
// (e.g., `IDENT @ PAT` or `ref IDENT`) or because `IDENT` resolves // (e.g., `IDENT @ PAT` or `ref IDENT`) or because `IDENT` resolves
// to something unusable as a pattern (e.g., constructor function), // to something unusable as a pattern (e.g., constructor function),

View File

@ -41,9 +41,9 @@ pub fn walk_types<'tcx, V: SpannedTypeVisitor<'tcx>>(
} }
} }
// Walk over the type behind the alias // Walk over the type behind the alias
DefKind::TyAlias {..} | DefKind::AssocTy | DefKind::TyAlias { .. } | DefKind::AssocTy |
// Walk over the type of the item // Walk over the type of the item
DefKind::Static{..} | DefKind::Const | DefKind::AssocConst | DefKind::AnonConst => { DefKind::Static { .. } | DefKind::Const | DefKind::AssocConst | DefKind::AnonConst => {
if let Some(ty) = tcx.hir_node_by_def_id(item).ty() { if let Some(ty) = tcx.hir_node_by_def_id(item).ty() {
// If the type of the item uses `_`, we're gonna error out anyway, but // If the type of the item uses `_`, we're gonna error out anyway, but
// typeck (which type_of invokes below), will call back into opaque_types_defined_by // typeck (which type_of invokes below), will call back into opaque_types_defined_by