Skip to content

Commit

Permalink
Unrolled build for rust-lang#129523
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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
  • Loading branch information
rust-timer authored Aug 25, 2024
2 parents 1a94d83 + 902264b commit 1337227
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_type_ir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ nightly = [
"rustc_index/nightly",
"rustc_ast_ir/nightly"
]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(bootstrap)'] }
2 changes: 1 addition & 1 deletion compiler/rustc_type_ir/src/elaborate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_type_ir/src/outlives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_type_ir/src/search_graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 1337227

Please sign in to comment.