Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy anon const default substs #4

Closed
wants to merge 73 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
5e7fed1
Add a regression test for issue-63355
JohnTitor Jun 30, 2021
5c9bd9c
Recover from a misplaced inner doc comment
Aaron1011 Jul 2, 2021
34ff259
Add help on reinitialization between move and access
ptrojahn May 19, 2021
ae33a97
Set personality with LLVMSetPersonalityFn
tmiasko Jul 7, 2021
f612ba1
Use existing declaration of rust_eh_personality
tmiasko Jul 7, 2021
fd406a8
Give a helpful error for the mistake `..==`
inquisitivecrystal Jun 26, 2021
b56079e
Add diagnostics test for mistyped inclusive ranges
inquisitivecrystal Jul 11, 2021
e32ecee
Remove unnecessary CrateNum from Cache.externs
jyn514 Jul 5, 2021
a30fa08
Remove trival `impl Clean for CrateNum`
jyn514 Jul 5, 2021
7c98b3c
Keep metadata when using gc-sections with profile-generate.
JamieCunliffe Jul 8, 2021
dc639c9
Warn about useless assignments of variables/fields to themselves
FabianWolff Jul 14, 2021
47ea2ae
Separate encoding paths.
cjgillot Jun 24, 2021
c2d43e1
Simplify metadata decoding.
cjgillot Jun 27, 2021
1a90004
Added diagnostic items to functions for Clippy
xFrednet Jul 15, 2021
d38f2b0
Added diagnostic items to structs and traits for Clippy
xFrednet Jul 15, 2021
0d3d6f0
fix typo in compile_fail doctest
RalfJung Jul 16, 2021
774a79e
Mark `Option::insert` as must_use
oxalica Jul 16, 2021
ce59f1a
Consider all fields when comparing DllImports, to remove nondetermini…
ricobbe Jul 12, 2021
9b874c4
Check that const parameters of trait methods have compatible types
FabianWolff Jul 3, 2021
6ffb6c4
rustc_middle: remove redundant clone
matthiaskrgr Jul 16, 2021
67002db
Corrected symbol order after adding diagnostic items
xFrednet Jul 17, 2021
6e78d6c
Make the CrateNum part of the ExpnId.
cjgillot Jul 10, 2021
078dd37
Use LocalExpnId where possible.
cjgillot Jun 25, 2021
2fe37c5
Choose encoding format in caller code.
cjgillot Jun 27, 2021
37a13de
Encode ExpnId using ExpnHash for incr. comp.
cjgillot Jun 27, 2021
dbd2d77
Drop orig_id.
cjgillot Jun 27, 2021
41c1f39
Drop ExpnData::krate.
cjgillot Jun 27, 2021
a51b131
Always hash spans in expn.
cjgillot Jun 27, 2021
0f8573e
Pass ExpnData by reference.
cjgillot Jul 12, 2021
dddaa6d
Rename expn_info -> expn_data.
cjgillot Jul 15, 2021
b35ceee
Simplify Expn creation.
cjgillot Jul 15, 2021
68511b5
Auto merge of #86676 - cjgillot:localexpn, r=petrochenkov
bors Jul 17, 2021
d954a8e
Some perf optimizations and logging
jackh726 Jul 16, 2021
fa839b1
Add needs_normalization
jackh726 Jul 16, 2021
c7331d6
Auto merge of #87203 - jackh726:logging, r=nikomatsakis
bors Jul 17, 2021
eb0b95b
Auto merge of #87129 - FabianWolff:issue-75356, r=varkor
bors Jul 17, 2021
77d1559
Auto merge of #85686 - ptrojahn:loop_reinitialize, r=estebank
bors Jul 18, 2021
ddd5448
Compute a better `lint_node_id` during expansion
Aaron1011 Jul 14, 2021
2bd15a2
Add missing `visit_expr_field`
Aaron1011 Jul 15, 2021
d6e3c11
Add additional missing lint handling logic
Aaron1011 Jul 15, 2021
7ca089c
Only use `assign_id!` for ast nodes that support attributes
Aaron1011 Jul 17, 2021
1c1c794
Add test for `#[allow]` for warnings on attribute macro
Aaron1011 Jul 17, 2021
76300d5
Rollup merge of #86763 - JohnTitor:test-63355, r=oli-obk
JohnTitor Jul 18, 2021
469935f
Rollup merge of #86814 - Aaron1011:inner-doc-recover, r=estebank
JohnTitor Jul 18, 2021
783efd2
Rollup merge of #86843 - FabianWolff:issue-86820, r=lcnr
JohnTitor Jul 18, 2021
eef5108
Rollup merge of #86889 - jyn514:crate-cleanup, r=camelid
JohnTitor Jul 18, 2021
81d0b70
Rollup merge of #87092 - ricobbe:fix-raw-dylib-multiple-definitions, …
JohnTitor Jul 18, 2021
07faa2e
Rollup merge of #87170 - xFrednet:clippy-5393-add-diagnostic-items, r…
JohnTitor Jul 18, 2021
c1ee9a3
Rollup merge of #87183 - RalfJung:option-doctest, r=jyn514
JohnTitor Jul 18, 2021
810e478
Rollup merge of #87205 - matthiaskrgr:clippy_cln, r=oli-obk
JohnTitor Jul 18, 2021
3ab6b60
Auto merge of #87071 - inquisitivecrystal:inclusive-range, r=estebank
bors Jul 18, 2021
5a8a441
Auto merge of #87242 - JohnTitor:rollup-t9rmwpo, r=JohnTitor
bors Jul 18, 2021
81241cb
Move OnDiskCache to rustc_query_impl.
cjgillot Jun 28, 2021
5b92150
Remove deadlock virtual call.
cjgillot Jun 28, 2021
1807305
Auto merge of #86698 - cjgillot:modc, r=estebank
bors Jul 18, 2021
0fcd59a
update Miri
RalfJung Jul 18, 2021
331da58
Auto merge of #87252 - RalfJung:miri, r=RalfJung
bors Jul 18, 2021
dbd4fd5
feat(rustc_lint): add `dyn_drop`
notriddle Jul 3, 2021
83d3a94
Add `#![allow(dyn_drop)]` to test cases with `dyn Drop` in them
notriddle Jul 3, 2021
e054522
fix(clippy): add missing allow(dyn_drop)
notriddle Jul 18, 2021
5921685
Auto merge of #86950 - tmiasko:personality, r=nagisa
bors Jul 18, 2021
b548d9f
Auto merge of #87004 - JamieCunliffe:pgo-gc-sections, r=Mark-Simulacrum
bors Jul 18, 2021
10c0b00
Auto merge of #86848 - notriddle:notriddle/drop-dyn, r=varkor
bors Jul 19, 2021
0ecff8c
Auto merge of #87146 - Aaron1011:better-macro-lint, r=petrochenkov
bors Jul 19, 2021
83f0822
Auto merge of #87196 - oxalica:option-insert-must-use, r=joshtriplett
bors Jul 19, 2021
3372f27
require a `tcx` for `TypeVisitor`
lcnr Mar 13, 2021
1bc1691
make unevaluated const substs optional
lcnr Mar 15, 2021
2e13be1
add `tcx` to `fn walk`
lcnr Jul 17, 2021
80423d6
update `TypeFlags` to deal with missing ct substs
lcnr Jul 17, 2021
3ea3257
don't just compare `ty::Const`
lcnr Jul 19, 2021
d823155
check for cycles in `default_anon_const_substs`
lcnr Jul 19, 2021
4b8eae1
use `ty::Unevaluated` instead of def substs pair
lcnr Jul 19, 2021
ddae395
ignore const substs in `implicit_infer`
lcnr Jul 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add tcx to fn walk
  • Loading branch information
lcnr committed Jul 19, 2021
commit 2e13be1441dc0e1f990bca640adfac3f9bdf1e8f
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<'a, 'tcx> FindHirNodeVisitor<'a, 'tcx> {

fn node_ty_contains_target(&self, hir_id: HirId) -> Option<Ty<'tcx>> {
self.node_type_opt(hir_id).map(|ty| self.infcx.resolve_vars_if_possible(ty)).filter(|ty| {
ty.walk().any(|inner| {
ty.walk(self.infcx.tcx).any(|inner| {
inner == self.target
|| match (inner.unpack(), self.target.unpack()) {
(GenericArgKind::Type(inner_ty), GenericArgKind::Type(target_ty)) => {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/outlives/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl<'cx, 'tcx> VerifyBoundCx<'cx, 'tcx> {
visited: &mut SsoHashSet<GenericArg<'tcx>>,
) -> VerifyBound<'tcx> {
let mut bounds = parent
.walk_shallow(visited)
.walk_shallow(self.tcx, visited)
.filter_map(|child| match child.unpack() {
GenericArgKind::Type(ty) => Some(self.type_bound(ty, visited)),
GenericArgKind::Lifetime(lt) => {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ declare_lint! {
declare_lint_pass!(BoxPointers => [BOX_POINTERS]);

impl BoxPointers {
fn check_heap_type(&self, cx: &LateContext<'_>, span: Span, ty: Ty<'_>) {
for leaf in ty.walk() {
fn check_heap_type<'tcx>(&self, cx: &LateContext<'tcx>, span: Span, ty: Ty<'tcx>) {
for leaf in ty.walk(cx.tcx) {
if let GenericArgKind::Type(leaf_ty) = leaf.unpack() {
if leaf_ty.is_box() {
cx.struct_span_lint(BOX_POINTERS, span, |lint| {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/outlives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ fn compute_components_recursive(
out: &mut SmallVec<[Component<'tcx>; 4]>,
visited: &mut SsoHashSet<GenericArg<'tcx>>,
) {
for child in parent.walk_shallow(visited) {
for child in parent.walk_shallow(tcx, visited) {
match child.unpack() {
GenericArgKind::Type(ty) => {
compute_components(tcx, ty, out, visited);
Expand Down
41 changes: 23 additions & 18 deletions compiler/rustc_middle/src/ty/walk.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! An iterator over the type substructure.
//! WARNING: this does not keep track of the region depth.

use crate::ty;
use crate::ty::subst::{GenericArg, GenericArgKind};
use crate::ty::{self, TyCtxt};
use rustc_data_structures::sso::SsoHashSet;
use smallvec::{self, SmallVec};

Expand All @@ -11,6 +11,7 @@ use smallvec::{self, SmallVec};
type TypeWalkerStack<'tcx> = SmallVec<[GenericArg<'tcx>; 8]>;

pub struct TypeWalker<'tcx> {
tcx: TyCtxt<'tcx>,
stack: TypeWalkerStack<'tcx>,
last_subtree: usize,
pub visited: SsoHashSet<GenericArg<'tcx>>,
Expand All @@ -25,8 +26,8 @@ pub struct TypeWalker<'tcx> {
/// It maintains a set of visited types and
/// skips any types that are already there.
impl<'tcx> TypeWalker<'tcx> {
pub fn new(root: GenericArg<'tcx>) -> Self {
Self { stack: smallvec![root], last_subtree: 1, visited: SsoHashSet::new() }
fn new(tcx: TyCtxt<'tcx>, root: GenericArg<'tcx>) -> Self {
Self { tcx, stack: smallvec![root], last_subtree: 1, visited: SsoHashSet::new() }
}

/// Skips the subtree corresponding to the last type
Expand Down Expand Up @@ -55,7 +56,7 @@ impl<'tcx> Iterator for TypeWalker<'tcx> {
let next = self.stack.pop()?;
self.last_subtree = self.stack.len();
if self.visited.insert(next) {
push_inner(&mut self.stack, next);
push_inner(self.tcx, &mut self.stack, next);
debug!("next: stack={:?}", self.stack);
return Some(next);
}
Expand All @@ -74,8 +75,8 @@ impl GenericArg<'tcx> {
/// Foo<Bar<isize>> => { Foo<Bar<isize>>, Bar<isize>, isize }
/// [isize] => { [isize], isize }
/// ```
pub fn walk(self) -> TypeWalker<'tcx> {
TypeWalker::new(self)
pub fn walk(self, tcx: TyCtxt<'tcx>) -> TypeWalker<'tcx> {
TypeWalker::new(tcx, self)
}

/// Iterator that walks the immediate children of `self`. Hence
Expand All @@ -87,10 +88,11 @@ impl GenericArg<'tcx> {
/// and skips any types that are already there.
pub fn walk_shallow(
self,
tcx: TyCtxt<'tcx>,
visited: &mut SsoHashSet<GenericArg<'tcx>>,
) -> impl Iterator<Item = GenericArg<'tcx>> {
let mut stack = SmallVec::new();
push_inner(&mut stack, self);
push_inner(tcx, &mut stack, self);
stack.retain(|a| visited.insert(*a));
stack.into_iter()
}
Expand All @@ -107,18 +109,22 @@ impl<'tcx> super::TyS<'tcx> {
/// Foo<Bar<isize>> => { Foo<Bar<isize>>, Bar<isize>, isize }
/// [isize] => { [isize], isize }
/// ```
pub fn walk(&'tcx self) -> TypeWalker<'tcx> {
TypeWalker::new(self.into())
pub fn walk(&'tcx self, tcx: TyCtxt<'tcx>) -> TypeWalker<'tcx> {
TypeWalker::new(tcx, self.into())
}
}

// We push `GenericArg`s on the stack in reverse order so as to
// maintain a pre-order traversal. As of the time of this
// writing, the fact that the traversal is pre-order is not
// known to be significant to any code, but it seems like the
// natural order one would expect (basically, the order of the
// types as they are written).
fn push_inner<'tcx>(stack: &mut TypeWalkerStack<'tcx>, parent: GenericArg<'tcx>) {
/// We push `GenericArg`s on the stack in reverse order so as to
/// maintain a pre-order traversal. As of the time of this
/// writing, the fact that the traversal is pre-order is not
/// known to be significant to any code, but it seems like the
/// natural order one would expect (basically, the order of the
/// types as they are written).
fn push_inner<'tcx>(
tcx: TyCtxt<'tcx>,
stack: &mut TypeWalkerStack<'tcx>,
parent: GenericArg<'tcx>,
) {
match parent.unpack() {
GenericArgKind::Type(parent_ty) => match *parent_ty.kind() {
ty::Bool
Expand Down Expand Up @@ -196,8 +202,7 @@ fn push_inner<'tcx>(stack: &mut TypeWalkerStack<'tcx>, parent: GenericArg<'tcx>)
| ty::ConstKind::Error(_) => {}

ty::ConstKind::Unevaluated(ct) => {
// TODO
stack.extend(ct.substs_.unwrap().iter().rev());
stack.extend(ct.substs(tcx).iter().rev());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir/src/monomorphize/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ fn check_type_length_limit<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) {
let type_length = instance
.substs
.iter()
.flat_map(|arg| arg.walk())
.flat_map(|arg| arg.walk(tcx))
.filter(|arg| match arg.unpack() {
GenericArgKind::Type(_) | GenericArgKind::Const(_) => true,
GenericArgKind::Lifetime(_) => false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ impl Validator<'mir, 'tcx> {
fn check_local_or_return_ty(&mut self, ty: Ty<'tcx>, local: Local) {
let kind = self.body.local_kind(local);

for ty in ty.walk() {
for ty in ty.walk(self.tcx) {
let ty = match ty.unpack() {
GenericArgKind::Type(ty) => ty,

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_mir/src/transform/function_item_references.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<'a, 'tcx> Visitor<'tcx> for FunctionItemRefChecker<'a, 'tcx> {
// Handle calls to `transmute`
if self.tcx.is_diagnostic_item(sym::transmute, def_id) {
let arg_ty = args[0].ty(self.body, self.tcx);
for generic_inner_ty in arg_ty.walk() {
for generic_inner_ty in arg_ty.walk(self.tcx) {
if let GenericArgKind::Type(inner_ty) = generic_inner_ty.unpack() {
if let Some((fn_id, fn_substs)) =
FunctionItemRefChecker::is_fn_ref(inner_ty)
Expand Down Expand Up @@ -110,7 +110,7 @@ impl<'a, 'tcx> FunctionItemRefChecker<'a, 'tcx> {
let arg_defs = self.tcx.fn_sig(def_id).skip_binder().inputs();
for (arg_num, arg_def) in arg_defs.iter().enumerate() {
// For all types reachable from the argument type in the fn sig
for generic_inner_ty in arg_def.walk() {
for generic_inner_ty in arg_def.walk(self.tcx) {
if let GenericArgKind::Type(inner_ty) = generic_inner_ty.unpack() {
// If the inner type matches the type bound by `Pointer`
if TyS::same_type(inner_ty, bound_ty) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
// code at the moment, because types like `for <'a> fn(&'a ())` do
// not *yet* implement `PartialEq`. So for now we leave this here.
has_impl
|| ty.walk().any(|t| match t.unpack() {
|| ty.walk(self.tcx()).any(|t| match t.unpack() {
ty::subst::GenericArgKind::Lifetime(_) => false,
ty::subst::GenericArgKind::Type(t) => t.is_fn_ptr(),
ty::subst::GenericArgKind::Const(_) => false,
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_trait_selection/src/traits/fulfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,14 +694,15 @@ fn substs_infer_vars<'a, 'tcx>(
selcx: &mut SelectionContext<'a, 'tcx>,
substs: ty::Binder<'tcx, SubstsRef<'tcx>>,
) -> impl Iterator<Item = TyOrConstInferVar<'tcx>> {
let tcx = selcx.tcx();
selcx
.infcx()
.resolve_vars_if_possible(substs)
.skip_binder() // ok because this check doesn't care about regions
.iter()
.filter(|arg| arg.has_infer_types_or_consts())
.flat_map(|arg| {
let mut walker = arg.walk();
.flat_map(move |arg| {
let mut walker = arg.walk(tcx);
while let Some(c) = walker.next() {
if !c.has_infer_types_or_consts() {
walker.visited.remove(&c);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/object_safety.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ fn predicate_references_self(
(predicate, sp): (ty::Predicate<'tcx>, Span),
) -> Option<Span> {
let self_ty = tcx.types.self_param;
let has_self_ty = |arg: &GenericArg<'_>| arg.walk().any(|arg| arg == self_ty.into());
let has_self_ty = |arg: &GenericArg<'tcx>| arg.walk(tcx).any(|arg| arg == self_ty.into());
match predicate.kind().skip_binder() {
ty::PredicateKind::Trait(ref data, _) => {
// In the case of a trait predicate, we can skip the "self" type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {

let mut unsizing_params = GrowableBitSet::new_empty();
if tcx.features().relaxed_struct_unsize {
for arg in tail_field_ty.walk() {
for arg in tail_field_ty.walk(tcx) {
if let Some(i) = maybe_unsizing_param_idx(arg) {
unsizing_params.insert(i);
}
Expand All @@ -840,7 +840,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
// Ensure none of the other fields mention the parameters used
// in unsizing.
for field in prefix_fields {
for arg in tcx.type_of(field.did).walk() {
for arg in tcx.type_of(field.did).walk(tcx) {
if let Some(i) = maybe_unsizing_param_idx(arg) {
unsizing_params.remove(i);
}
Expand All @@ -852,7 +852,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
}
} else {
let mut found = false;
for arg in tail_field_ty.walk() {
for arg in tail_field_ty.walk(tcx) {
if let Some(i) = maybe_unsizing_param_idx(arg) {
unsizing_params.insert(i);
found = true;
Expand All @@ -868,7 +868,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
// by putting it in a query; it would only need the `DefId` as it
// looks at declared field types, not anything substituted.
for field in prefix_fields {
for arg in tcx.type_of(field.did).walk() {
for arg in tcx.type_of(field.did).walk(tcx) {
if let Some(i) = maybe_unsizing_param_idx(arg) {
if unsizing_params.contains(i) {
return Err(Unimplemented);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/wf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {

/// Pushes all the predicates needed to validate that `ty` is WF into `out`.
fn compute(&mut self, arg: GenericArg<'tcx>) {
let mut walker = arg.walk();
let mut walker = arg.walk(self.tcx());
let param_env = self.param_env;
let depth = self.recursion_depth;
while let Some(arg) = walker.next() {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ty_utils/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ fn well_formed_types_in_env<'tcx>(
// constituents are well-formed.
NodeKind::InherentImpl => {
let self_ty = tcx.type_of(def_id);
inputs.extend(self_ty.walk());
inputs.extend(self_ty.walk(tcx));
}

// In an fn, we assume that the arguments and all their constituents are
Expand All @@ -370,7 +370,7 @@ fn well_formed_types_in_env<'tcx>(
let fn_sig = tcx.fn_sig(def_id);
let fn_sig = tcx.liberate_late_bound_regions(def_id, fn_sig);

inputs.extend(fn_sig.inputs().iter().flat_map(|ty| ty.walk()));
inputs.extend(fn_sig.inputs().iter().flat_map(|ty| ty.walk(tcx)));
}

NodeKind::Other => (),
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_typeck/src/astconv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
if self.is_object && has_default {
let default_ty = tcx.at(self.span).type_of(param.def_id);
let self_param = tcx.types.self_param;
if default_ty.walk().any(|arg| arg == self_param.into()) {
if default_ty.walk(tcx).any(|arg| arg == self_param.into()) {
// There is no suitable inference default for a type parameter
// that references self, in an object type.
return true;
Expand Down Expand Up @@ -1307,7 +1307,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
// A `Self` within the original bound will be substituted with a
// `trait_object_dummy_self`, so check for that.
let references_self =
pred.skip_binder().ty.walk().any(|arg| arg == dummy_self.into());
pred.skip_binder().ty.walk(tcx).any(|arg| arg == dummy_self.into());

// If the projection output contains `Self`, force the user to
// elaborate it explicitly to avoid a lot of complexity.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ pub(super) fn check_type_params_are_used<'tcx>(
return;
}

for leaf in ty.walk() {
for leaf in ty.walk(tcx) {
if let GenericArgKind::Type(leaf_ty) = leaf.unpack() {
if let ty::Param(param) = leaf_ty.kind() {
debug!("found use of ty param {:?}", param);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let ty = self.resolve_vars_if_possible(ty);
// We walk the argument type because the argument's type could have
// been `Option<T>`, but the `FulfillmentError` references `T`.
if ty.walk().any(|arg| arg == predicate.self_ty().into()) {
if ty.walk(self.tcx).any(|arg| arg == predicate.self_ty().into()) {
Some(i)
} else {
None
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_typeck/src/outlives/implicit_infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn insert_required_predicates_to_be_wf<'tcx>(
required_predicates: &mut RequiredPredicates<'tcx>,
explicit_map: &mut ExplicitPredicatesMap<'tcx>,
) {
for arg in field_ty.walk() {
for arg in field_ty.walk(tcx) {
let ty = match arg.unpack() {
GenericArgKind::Type(ty) => ty,

Expand Down Expand Up @@ -306,7 +306,7 @@ pub fn check_explicit_predicates<'tcx>(
// 'b`.
if let Some(self_ty) = ignored_self_ty {
if let GenericArgKind::Type(ty) = outlives_predicate.0.unpack() {
if ty.walk().any(|arg| arg == self_ty.into()) {
if ty.walk(tcx).any(|arg| arg == self_ty.into()) {
debug!("skipping self ty = {:?}", &ty);
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_lints/src/escape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn is_non_trait_box(ty: Ty<'_>) -> bool {
struct EscapeDelegate<'a, 'tcx> {
cx: &'a LateContext<'tcx>,
set: HirIdSet,
trait_self_ty: Option<Ty<'a>>,
trait_self_ty: Option<Ty<'tcx>>,
too_large_for_stack: u64,
}

Expand Down Expand Up @@ -171,7 +171,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
// skip if there is a `self` parameter binding to a type
// that contains `Self` (i.e.: `self: Box<Self>`), see #4804
if let Some(trait_self_ty) = self.trait_self_ty {
if map.name(cmt.hir_id) == kw::SelfLower && contains_ty(cmt.place.ty(), trait_self_ty) {
if map.name(cmt.hir_id) == kw::SelfLower && contains_ty(self.cx.tcx, cmt.place.ty(), trait_self_ty) {
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/let_underscore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl<'tcx> LateLintPass<'tcx> for LetUnderscore {
if let Some(init) = local.init;
then {
let init_ty = cx.typeck_results().expr_ty(init);
let contains_sync_guard = init_ty.walk().any(|inner| match inner.unpack() {
let contains_sync_guard = init_ty.walk(cx.tcx).any(|inner| match inner.unpack() {
GenericArgKind::Type(inner_ty) => {
SYNC_GUARD_PATHS.iter().any(|path| match_type(cx, inner_ty, path))
},
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/loops/same_item_push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub(super) fn check<'tcx>(
if same_item_push_visitor.should_lint();
if let Some((vec, pushed_item)) = same_item_push_visitor.vec_push;
let vec_ty = cx.typeck_results().expr_ty(vec);
let ty = vec_ty.walk().nth(1).unwrap().expect_ty();
let ty = vec_ty.walk(cx.tcx).nth(1).unwrap().expect_ty();
if cx
.tcx
.lang_items()
Expand Down
Loading