diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-08-25 16:51:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-25 16:51:06 +0200 |
| commit | 86d5c5336295944de1754265fc3e32f062b1db9f (patch) | |
| tree | 11d6e1f85eb2f32859a15b06696bb76ad42d5bf6 | |
| parent | c6f7b1f3905eaa2f52571ff6c0688d68332c6d09 (diff) | |
| parent | 902264b1a6c3d782df3242440cc6c5b866f982d0 (diff) | |
| download | rust-86d5c5336295944de1754265fc3e32f062b1db9f.tar.gz rust-86d5c5336295944de1754265fc3e32f062b1db9f.zip | |
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
| -rw-r--r-- | compiler/rustc_type_ir/Cargo.toml | 3 | ||||
| -rw-r--r-- | compiler/rustc_type_ir/src/elaborate.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_type_ir/src/outlives.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_type_ir/src/search_graph/mod.rs | 2 |
4 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rustc_type_ir/Cargo.toml b/compiler/rustc_type_ir/Cargo.toml index 2750838bbe9..785fa5e386a 100644 --- a/compiler/rustc_type_ir/Cargo.toml +++ b/compiler/rustc_type_ir/Cargo.toml @@ -31,3 +31,6 @@ nightly = [ "rustc_index/nightly", "rustc_ast_ir/nightly" ] + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(bootstrap)'] } diff --git a/compiler/rustc_type_ir/src/elaborate.rs b/compiler/rustc_type_ir/src/elaborate.rs index f30419c801f..433c444e701 100644 --- a/compiler/rustc_type_ir/src/elaborate.rs +++ b/compiler/rustc_type_ir/src/elaborate.rs @@ -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); diff --git a/compiler/rustc_type_ir/src/outlives.rs b/compiler/rustc_type_ir/src/outlives.rs index bfcea6a81d3..e8afaf1a480 100644 --- a/compiler/rustc_type_ir/src/outlives.rs +++ b/compiler/rustc_type_ir/src/outlives.rs @@ -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; diff --git a/compiler/rustc_type_ir/src/search_graph/mod.rs b/compiler/rustc_type_ir/src/search_graph/mod.rs index d47c9e725f3..418139c3aad 100644 --- a/compiler/rustc_type_ir/src/search_graph/mod.rs +++ b/compiler/rustc_type_ir/src/search_graph/mod.rs @@ -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)) |
