Skip to content

Commit e5ce6d1

Browse files
committed
rustc_typeck to rustc_hir_analysis
1 parent 06568fd commit e5ce6d1

25 files changed

+31
-31
lines changed

clippy_lints/src/default_union_representation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_lint::{LateContext, LateLintPass};
44
use rustc_middle::ty::layout::LayoutOf;
55
use rustc_session::{declare_lint_pass, declare_tool_lint};
66
use rustc_span::sym;
7-
use rustc_typeck::hir_ty_to_ty;
7+
use rustc_hir_analysis::hir_ty_to_ty;
88

99
declare_clippy_lint! {
1010
/// ### What it does

clippy_lints/src/escape.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_session::{declare_tool_lint, impl_lint_pass};
1010
use rustc_span::source_map::Span;
1111
use rustc_span::symbol::kw;
1212
use rustc_target::spec::abi::Abi;
13-
use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
13+
use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
1414

1515
#[derive(Copy, Clone)]
1616
pub struct BoxedLocal {
@@ -177,7 +177,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
177177
}
178178
}
179179

180-
fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
180+
fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
181181
}
182182

183183
impl<'a, 'tcx> EscapeDelegate<'a, 'tcx> {

clippy_lints/src/implicit_hasher.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_middle::ty::{Ty, TypeckResults};
1212
use rustc_session::{declare_lint_pass, declare_tool_lint};
1313
use rustc_span::source_map::Span;
1414
use rustc_span::symbol::sym;
15-
use rustc_typeck::hir_ty_to_ty;
15+
use rustc_hir_analysis::hir_ty_to_ty;
1616

1717
use if_chain::if_chain;
1818

clippy_lints/src/large_const_arrays.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_middle::ty::layout::LayoutOf;
77
use rustc_middle::ty::{self, ConstKind};
88
use rustc_session::{declare_tool_lint, impl_lint_pass};
99
use rustc_span::{BytePos, Pos, Span};
10-
use rustc_typeck::hir_ty_to_ty;
10+
use rustc_hir_analysis::hir_ty_to_ty;
1111

1212
declare_clippy_lint! {
1313
/// ### What it does

clippy_lints/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extern crate rustc_session;
4343
extern crate rustc_span;
4444
extern crate rustc_target;
4545
extern crate rustc_trait_selection;
46-
extern crate rustc_typeck;
46+
extern crate rustc_hir_analysis;
4747

4848
#[macro_use]
4949
extern crate clippy_utils;

clippy_lints/src/loops/mut_range_bound.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_infer::infer::TyCtxtInferExt;
88
use rustc_lint::LateContext;
99
use rustc_middle::{mir::FakeReadCause, ty};
1010
use rustc_span::source_map::Span;
11-
use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
11+
use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
1212

1313
pub(super) fn check(cx: &LateContext<'_>, arg: &Expr<'_>, body: &Expr<'_>) {
1414
if_chain! {
@@ -114,7 +114,7 @@ impl<'tcx> Delegate<'tcx> for MutatePairDelegate<'_, 'tcx> {
114114
}
115115
}
116116

117-
fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
117+
fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
118118
}
119119

120120
impl MutatePairDelegate<'_, '_> {

clippy_lints/src/loops/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_middle::hir::nested_filter;
1010
use rustc_middle::ty::{self, Ty};
1111
use rustc_span::source_map::Spanned;
1212
use rustc_span::symbol::{sym, Symbol};
13-
use rustc_typeck::hir_ty_to_ty;
13+
use rustc_hir_analysis::hir_ty_to_ty;
1414
use std::iter::Iterator;
1515

1616
#[derive(Debug, PartialEq, Eq)]

clippy_lints/src/matches/needless_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_hir::LangItem::OptionNone;
1111
use rustc_hir::{Arm, BindingAnnotation, ByRef, Expr, ExprKind, FnRetTy, Guard, Node, Pat, PatKind, Path, QPath};
1212
use rustc_lint::LateContext;
1313
use rustc_span::sym;
14-
use rustc_typeck::hir_ty_to_ty;
14+
use rustc_hir_analysis::hir_ty_to_ty;
1515

1616
pub(crate) fn check_match(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>], expr: &Expr<'_>) {
1717
if arms.len() > 1 && expr_ty_matches_p_ty(cx, ex, expr) && check_all_arms(cx, ex, arms) {

clippy_lints/src/methods/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ use rustc_middle::ty::{self, TraitRef, Ty};
115115
use rustc_semver::RustcVersion;
116116
use rustc_session::{declare_tool_lint, impl_lint_pass};
117117
use rustc_span::{sym, Span};
118-
use rustc_typeck::hir_ty_to_ty;
118+
use rustc_hir_analysis::hir_ty_to_ty;
119119

120120
declare_clippy_lint! {
121121
/// ### What it does

clippy_lints/src/methods/unnecessary_to_owned.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use rustc_middle::ty::{self, ParamTy, PredicateKind, ProjectionPredicate, TraitP
1818
use rustc_semver::RustcVersion;
1919
use rustc_span::{sym, Symbol};
2020
use rustc_trait_selection::traits::{query::evaluate_obligation::InferCtxtExt as _, Obligation, ObligationCause};
21-
use rustc_typeck::check::{FnCtxt, Inherited};
21+
use rustc_hir_analysis::check::{FnCtxt, Inherited};
2222
use std::cmp::max;
2323

2424
use super::UNNECESSARY_TO_OWNED;

clippy_lints/src/missing_const_for_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_middle::lint::in_external_macro;
1313
use rustc_semver::RustcVersion;
1414
use rustc_session::{declare_tool_lint, impl_lint_pass};
1515
use rustc_span::Span;
16-
use rustc_typeck::hir_ty_to_ty;
16+
use rustc_hir_analysis::hir_ty_to_ty;
1717

1818
declare_clippy_lint! {
1919
/// ### What it does

clippy_lints/src/needless_pass_by_value.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use rustc_span::{sym, Span};
2222
use rustc_target::spec::abi::Abi;
2323
use rustc_trait_selection::traits;
2424
use rustc_trait_selection::traits::misc::can_type_implement_copy;
25-
use rustc_typeck::expr_use_visitor as euv;
25+
use rustc_hir_analysis::expr_use_visitor as euv;
2626
use std::borrow::Cow;
2727

2828
declare_clippy_lint! {
@@ -341,5 +341,5 @@ impl<'tcx> euv::Delegate<'tcx> for MovedVariablesCtxt {
341341

342342
fn mutate(&mut self, _: &euv::PlaceWithHirId<'tcx>, _: HirId) {}
343343

344-
fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
344+
fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
345345
}

clippy_lints/src/non_copy_const.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rustc_middle::ty::adjustment::Adjust;
2020
use rustc_middle::ty::{self, Ty};
2121
use rustc_session::{declare_lint_pass, declare_tool_lint};
2222
use rustc_span::{sym, InnerSpan, Span, DUMMY_SP};
23-
use rustc_typeck::hir_ty_to_ty;
23+
use rustc_hir_analysis::hir_ty_to_ty;
2424

2525
// FIXME: this is a correctness problem but there's no suitable
2626
// warn-by-default category.

clippy_lints/src/operators/assign_op_pattern.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_lint::LateContext;
1111
use rustc_middle::mir::FakeReadCause;
1212
use rustc_middle::ty::BorrowKind;
1313
use rustc_trait_selection::infer::TyCtxtInferExt;
14-
use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
14+
use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
1515

1616
use super::ASSIGN_OP_PATTERN;
1717

clippy_lints/src/transmute/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc_hir::Expr;
22
use rustc_lint::LateContext;
33
use rustc_middle::ty::{cast::CastKind, Ty};
44
use rustc_span::DUMMY_SP;
5-
use rustc_typeck::check::{cast::{self, CastCheckResult}, FnCtxt, Inherited};
5+
use rustc_hir_analysis::check::{cast::{self, CastCheckResult}, FnCtxt, Inherited};
66

77
// check if the component types of the transmuted collection and the result have different ABI,
88
// size or alignment

clippy_lints/src/types/redundant_allocation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_errors::Applicability;
55
use rustc_hir::{self as hir, def_id::DefId, QPath, TyKind};
66
use rustc_lint::LateContext;
77
use rustc_span::symbol::sym;
8-
use rustc_typeck::hir_ty_to_ty;
8+
use rustc_hir_analysis::hir_ty_to_ty;
99

1010
use super::{utils, REDUNDANT_ALLOCATION};
1111

clippy_lints/src/types/vec_box.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_lint::LateContext;
88
use rustc_middle::ty::layout::LayoutOf;
99
use rustc_middle::ty::TypeVisitable;
1010
use rustc_span::symbol::sym;
11-
use rustc_typeck::hir_ty_to_ty;
11+
use rustc_hir_analysis::hir_ty_to_ty;
1212

1313
use super::VEC_BOX;
1414

clippy_lints/src/use_self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_lint::{LateContext, LateLintPass};
1616
use rustc_semver::RustcVersion;
1717
use rustc_session::{declare_tool_lint, impl_lint_pass};
1818
use rustc_span::Span;
19-
use rustc_typeck::hir_ty_to_ty;
19+
use rustc_hir_analysis::hir_ty_to_ty;
2020

2121
declare_clippy_lint! {
2222
/// ### What it does

clippy_lints/src/utils/internal_lints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use rustc_session::{declare_lint_pass, declare_tool_lint, impl_lint_pass};
3232
use rustc_span::source_map::Spanned;
3333
use rustc_span::symbol::Symbol;
3434
use rustc_span::{sym, BytePos, Span};
35-
use rustc_typeck::hir_ty_to_ty;
35+
use rustc_hir_analysis::hir_ty_to_ty;
3636

3737
use std::borrow::{Borrow, Cow};
3838

clippy_lints/src/zero_sized_map_values.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_middle::ty::layout::LayoutOf as _;
77
use rustc_middle::ty::{Adt, Ty, TypeVisitable};
88
use rustc_session::{declare_lint_pass, declare_tool_lint};
99
use rustc_span::sym;
10-
use rustc_typeck::hir_ty_to_ty;
10+
use rustc_hir_analysis::hir_ty_to_ty;
1111

1212
declare_clippy_lint! {
1313
/// ### What it does

clippy_utils/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extern crate rustc_session;
3232
extern crate rustc_span;
3333
extern crate rustc_target;
3434
extern crate rustc_trait_selection;
35-
extern crate rustc_typeck;
35+
extern crate rustc_hir_analysis;
3636

3737
#[macro_use]
3838
pub mod sym_helper;
@@ -1386,7 +1386,7 @@ pub fn is_integer_literal(expr: &Expr<'_>, value: u128) -> bool {
13861386
/// Examples of coercions can be found in the Nomicon at
13871387
/// <https://doc.rust-lang.org/nomicon/coercions.html>.
13881388
///
1389-
/// See `rustc_middle::ty::adjustment::Adjustment` and `rustc_typeck::check::coercion` for more
1389+
/// See `rustc_middle::ty::adjustment::Adjustment` and `rustc_hir_analysis::check::coercion` for more
13901390
/// information on adjustments and coercions.
13911391
pub fn is_adjusted(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
13921392
cx.typeck_results().adjustments().get(e.hir_id).is_some()

clippy_utils/src/sugg.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_middle::hir::place::ProjectionKind;
1616
use rustc_middle::mir::{FakeReadCause, Mutability};
1717
use rustc_middle::ty;
1818
use rustc_span::source_map::{BytePos, CharPos, Pos, Span, SyntaxContext};
19-
use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
19+
use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
2020
use std::borrow::Cow;
2121
use std::fmt::{Display, Write as _};
2222
use std::ops::{Add, Neg, Not, Sub};
@@ -1056,7 +1056,7 @@ impl<'tcx> Delegate<'tcx> for DerefDelegate<'_, 'tcx> {
10561056

10571057
fn mutate(&mut self, _: &PlaceWithHirId<'tcx>, _: HirId) {}
10581058

1059-
fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
1059+
fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
10601060
}
10611061

10621062
#[cfg(test)]

clippy_utils/src/usage.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_lint::LateContext;
99
use rustc_middle::hir::nested_filter;
1010
use rustc_middle::mir::FakeReadCause;
1111
use rustc_middle::ty;
12-
use rustc_typeck::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
12+
use rustc_hir_analysis::expr_use_visitor::{Delegate, ExprUseVisitor, PlaceBase, PlaceWithHirId};
1313

1414
/// Returns a set of mutated local variable IDs, or `None` if mutations could not be determined.
1515
pub fn mutated_variables<'tcx>(expr: &'tcx Expr<'_>, cx: &LateContext<'tcx>) -> Option<HirIdSet> {
@@ -73,7 +73,7 @@ impl<'tcx> Delegate<'tcx> for MutVarsDelegate {
7373
self.update(cmt);
7474
}
7575

76-
fn fake_read(&mut self, _: &rustc_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
76+
fn fake_read(&mut self, _: &rustc_hir_analysis::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
7777
}
7878

7979
pub struct ParamBindingIdCollector {

tests/ui/transmutes_expressible_as_ptr_casts.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
use std::mem::{size_of, transmute};
1010

11-
// rustc_typeck::check::cast contains documentation about when a cast `e as U` is
11+
// rustc_hir_analysis::check::cast contains documentation about when a cast `e as U` is
1212
// valid, which we quote from below.
1313
fn main() {
1414
// We should see an error message for each transmute, and no error messages for

tests/ui/transmutes_expressible_as_ptr_casts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
use std::mem::{size_of, transmute};
1010

11-
// rustc_typeck::check::cast contains documentation about when a cast `e as U` is
11+
// rustc_hir_analysis::check::cast contains documentation about when a cast `e as U` is
1212
// valid, which we quote from below.
1313
fn main() {
1414
// We should see an error message for each transmute, and no error messages for

0 commit comments

Comments
 (0)