You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 28, 2025. It is now read-only.
Auto merge of rust-lang#126491 - compiler-errors:is_lang_item, r=oli-obk
Add `TyCtxt::is_lang_item`, use it in the compiler
```rust
pub fn is_lang_item(self, def_id: DefId, lang_item: LangItem) -> bool;
```
Easier than having to use `Some(def_id) == tcx.lang_items().iterator_trait()` or something. Also makes it easier to turn into `TraitSolverLangItem` in the future. Hope it's not too bad for perf.
r? `@lcnr` or `@oli-obk`
// Adapted from https://github.com/rust-lang/rust/blob/f3c66088610c1b80110297c2d9a8b5f9265b013f/compiler/rustc_hir_analysis/src/check/intrinsicck.rs#L136-L151
0 commit comments