Rollup merge of #129523 - lqd:stable-type-ir, r=compiler-errors

Make `rustc_type_ir` build on stable

This PR fixes a handful of issues that appear in `rustc_type_ir` when trying to build the new solver on stable.

r? ```@compiler-errors```
```@bors``` rollup
This commit is contained in:
Matthias Krüger 2024-08-25 16:51:06 +02:00 committed by GitHub
commit 86d5c53362
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 2 deletions

View File

@ -31,3 +31,6 @@ nightly = [
"rustc_index/nightly",
"rustc_ast_ir/nightly"
]
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(bootstrap)'] }

View File

@ -237,7 +237,7 @@ pub fn supertrait_def_ids<I: Interner>(
cx: I,
trait_def_id: I::DefId,
) -> impl Iterator<Item = I::DefId> {
let mut set = HashSet::default();
let mut set: HashSet<I::DefId> = HashSet::default();
let mut stack = vec![trait_def_id];
set.insert(trait_def_id);

View File

@ -68,6 +68,9 @@ struct OutlivesCollector<'a, I: Interner> {
}
impl<I: Interner> TypeVisitor<I> for OutlivesCollector<'_, I> {
#[cfg(not(feature = "nightly"))]
type Result = ();
fn visit_ty(&mut self, ty: I::Ty) -> Self::Result {
if !self.visited.insert(ty) {
return;

View File

@ -287,7 +287,7 @@ impl<X: Cx> NestedGoals<X> {
}
}
#[rustc_lint_query_instability]
#[cfg_attr(feature = "nightly", rustc_lint_query_instability)]
#[allow(rustc::potential_query_instability)]
fn iter(&self) -> impl Iterator<Item = (X::Input, UsageKind)> + '_ {
self.nested_goals.iter().map(|(i, p)| (*i, *p))