3c1357ca6b
Fix is_foreign_item for StableMIR instance Change the implementation of `Instance::is_foreign_item` to directly query the compiler for the instance `def_id` instead of incorrectly relying on the conversion to `CrateItem`. I also added a method to check if the instance has body, since the function already existed and it just wasn't exposed via public APIs. This makes it much cheaper for the user to check if the instance has body. ## Background: - In pull https://github.com/rust-lang/rust/pull/118524, I fixed the conversion from Instance to CrateItem to avoid the conversion if the instance didn't have a body available. This broke the `is_foreign_item`. r? `@ouz-a` |
||
---|---|---|
.. | ||
auxiliary | ||
fluent-messages | ||
internal-lints | ||
mod_dir_simple | ||
session-diagnostic | ||
stable-mir | ||
compiler-calls.rs | ||
deriving-global.rs | ||
deriving-hygiene.rs | ||
dropck_tarena_sound_drop.rs | ||
dropck-tarena-cycle-checked.rs | ||
dropck-tarena-cycle-checked.stderr | ||
dropck-tarena-unsound-drop.rs | ||
dropck-tarena-unsound-drop.stderr | ||
empty-struct-braces-derive.rs | ||
hash-stable-is-unstable.rs | ||
hash-stable-is-unstable.stderr | ||
lint-pass-macros.rs | ||
missing-rustc-driver-error.rs | ||
missing-rustc-driver-error.stderr | ||
mod_dir_path_canonicalized.rs | ||
pathless-extern-unstable.rs | ||
pathless-extern-unstable.stderr | ||
pprust-expr-roundtrip.rs | ||
regions-mock-tcx.rs | ||
rustc_encodable_hygiene.rs |