Skip to content

Commit 86d5c53

Browse files
authored
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
2 parents c6f7b1f + 902264b commit 86d5c53

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

compiler/rustc_type_ir/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ nightly = [
3131
"rustc_index/nightly",
3232
"rustc_ast_ir/nightly"
3333
]
34+
35+
[lints.rust]
36+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(bootstrap)'] }

compiler/rustc_type_ir/src/elaborate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ pub fn supertrait_def_ids<I: Interner>(
237237
cx: I,
238238
trait_def_id: I::DefId,
239239
) -> impl Iterator<Item = I::DefId> {
240-
let mut set = HashSet::default();
240+
let mut set: HashSet<I::DefId> = HashSet::default();
241241
let mut stack = vec![trait_def_id];
242242

243243
set.insert(trait_def_id);

compiler/rustc_type_ir/src/outlives.rs

+3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ struct OutlivesCollector<'a, I: Interner> {
6868
}
6969

7070
impl<I: Interner> TypeVisitor<I> for OutlivesCollector<'_, I> {
71+
#[cfg(not(feature = "nightly"))]
72+
type Result = ();
73+
7174
fn visit_ty(&mut self, ty: I::Ty) -> Self::Result {
7275
if !self.visited.insert(ty) {
7376
return;

compiler/rustc_type_ir/src/search_graph/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl<X: Cx> NestedGoals<X> {
287287
}
288288
}
289289

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

0 commit comments

Comments
 (0)