Remove some unintended changes to imports

This commit is contained in:
Noah Lev 2024-07-17 20:20:18 -07:00
parent 2e4a0e37e6
commit c8457e60e8
4 changed files with 13 additions and 10 deletions

View File

@ -8,10 +8,10 @@ use rustc_ast::ast::ParamKindOrd;
use rustc_errors::{
codes::*, struct_span_code_err, Applicability, Diag, ErrorGuaranteed, MultiSpan,
};
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id::DefId;
use rustc_hir::{self as hir};
use rustc_hir::{ConstArgKind, GenericArg};
use rustc_hir::GenericArg;
use rustc_middle::ty::{
self, GenericArgsRef, GenericParamDef, GenericParamDefKind, IsSuggestable, Ty,
};
@ -115,7 +115,7 @@ fn generic_arg_mismatch_err(
(GenericArg::Const(cnst), GenericParamDefKind::Type { .. }) => {
// FIXME(min_generic_const_args): once ConstArgKind::Path is used for non-params too,
// this should match against that instead of ::Anon
if let ConstArgKind::Anon(anon) = cnst.kind
if let hir::ConstArgKind::Anon(anon) = cnst.kind
&& let body = tcx.hir().body(anon.body)
&& let rustc_hir::ExprKind::Path(rustc_hir::QPath::Resolved(_, path)) =
body.value.kind

View File

@ -10,10 +10,11 @@ use rustc_ast::util::parser::{self, AssocOp, Fixity};
use rustc_ast_pretty::pp::Breaks::{Consistent, Inconsistent};
use rustc_ast_pretty::pp::{self, Breaks};
use rustc_ast_pretty::pprust::{Comments, PrintState};
use rustc_hir::{self as hir, ConstArgKind};
use rustc_hir as hir;
use rustc_hir::{
BindingMode, ByRef, GenericArg, GenericBound, GenericParam, GenericParamKind, HirId,
LifetimeParamKind, Node, PatKind, PreciseCapturingArg, RangeEnd, Term, TraitBoundModifier,
BindingMode, ByRef, ConstArgKind, GenericArg, GenericBound, GenericParam, GenericParamKind,
HirId, LifetimeParamKind, Node, PatKind, PreciseCapturingArg, RangeEnd, Term,
TraitBoundModifier,
};
use rustc_span::source_map::SourceMap;
use rustc_span::symbol::{kw, Ident, Symbol};

View File

@ -5,10 +5,10 @@ use crate::rvalue_scopes;
use crate::{BreakableCtxt, Diverges, Expectation, FnCtxt, LoweredTy};
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan, StashKey};
use rustc_hir as hir;
use rustc_hir::def::{CtorOf, DefKind, Res};
use rustc_hir::def_id::DefId;
use rustc_hir::lang_items::LangItem;
use rustc_hir::{self as hir};
use rustc_hir::{ExprKind, GenericArg, HirId, Node, QPath};
use rustc_hir_analysis::hir_ty_lowering::errors::GenericsArgsErrExtend;
use rustc_hir_analysis::hir_ty_lowering::generics::{

View File

@ -36,10 +36,10 @@ use rustc_ast::tokenstream::{TokenStream, TokenTree};
use rustc_attr as attr;
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet, IndexEntry};
use rustc_errors::{codes::*, struct_span_code_err, FatalError};
use rustc_hir as hir;
use rustc_hir::def::{CtorKind, DefKind, Res};
use rustc_hir::def_id::{DefId, DefIdMap, DefIdSet, LocalDefId, LOCAL_CRATE};
use rustc_hir::PredicateOrigin;
use rustc_hir::{self as hir, ConstArgKind};
use rustc_hir_analysis::lower_ty;
use rustc_middle::metadata::Reexport;
use rustc_middle::middle::resolve_bound_vars as rbv;
@ -289,10 +289,12 @@ pub(crate) fn clean_const<'tcx>(
_cx: &mut DocContext<'tcx>,
) -> Constant {
match &constant.kind {
ConstArgKind::Path(qpath) => {
hir::ConstArgKind::Path(qpath) => {
Constant { kind: ConstantKind::Path { path: qpath_to_string(&qpath).into() } }
}
ConstArgKind::Anon(anon) => Constant { kind: ConstantKind::Anonymous { body: anon.body } },
hir::ConstArgKind::Anon(anon) => {
Constant { kind: ConstantKind::Anonymous { body: anon.body } }
}
}
}