]> git.lizzy.rs Git - rust.git/commit
remove `ct.has_vars_bound_at_or_above` calls
authorlcnr <rust@lcnr.de>
Thu, 14 Jul 2022 10:35:09 +0000 (12:35 +0200)
committerlcnr <rust@lcnr.de>
Thu, 14 Jul 2022 10:35:09 +0000 (12:35 +0200)
commit39a990d2f126b4751bd7821f26d166e07b073915
tree067840f36ff81c3334de766f0421a865eb984d7c
parent1c7b36d4db582cb47513a6c7176baaec1c3346ab
remove `ct.has_vars_bound_at_or_above` calls

`ty::Const` doesn't have precomputed type flags, so
computing `has_vars_bound_at_or_above` for constants
requires us to visit the const and its contained types
and constants. A noop fold should be pretty much equally as
fast so removing it prevents us from walking the constant twice
in case it contains bound vars.
compiler/rustc_middle/src/ty/fold.rs
compiler/rustc_trait_selection/src/traits/project.rs