Skip to content

Commit b513063

Browse files
BoxyUwUlcnr
authored andcommitted
break on stable
1 parent ae6b75e commit b513063

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

compiler/rustc_next_trait_solver/src/solve/eval_ctxt/solver_region_constraints.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
//! Logic for `-Zassumptions-on-binders` stuff
22
3+
#[cfg(feature = "nightly")]
34
use rustc_data_structures::transitive_relation::TransitiveRelationBuilder;
45
use rustc_type_ir::ClauseKind::*;
56
use rustc_type_ir::inherent::*;
67
use rustc_type_ir::outlives::{Component, push_outlives_components};
8+
#[cfg(not(feature = "nightly"))]
9+
use rustc_type_ir::region_constraint::TransitiveRelationBuilder;
710
use rustc_type_ir::region_constraint::{
811
Assumptions, RegionConstraint, eagerly_handle_placeholders_in_universe, max_universe,
912
};

compiler/rustc_type_ir/src/region_constraint.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,47 @@ use derive_where::derive_where;
44
use indexmap::IndexSet;
55
#[cfg(feature = "nightly")]
66
use rustc_data_structures::stable_hasher::{StableHash, StableHashCtxt, StableHasher};
7+
#[cfg(feature = "nightly")]
78
use rustc_data_structures::transitive_relation::{TransitiveRelation, TransitiveRelationBuilder};
89
use tracing::{debug, instrument};
910

11+
// Workaround for TransitiveRelation being in rustc_data_structures which isn't accessible on stable
12+
#[cfg(not(feature = "nightly"))]
13+
#[derive(Default, Clone, Debug)]
14+
pub struct TransitiveRelation<T>(T);
15+
#[cfg(not(feature = "nightly"))]
16+
impl<T> TransitiveRelation<T> {
17+
pub fn reachable_from(&self, _data: T) -> Vec<T> {
18+
unreachable!("-Zassumptions-on-binders is not supported for r-a")
19+
}
20+
21+
pub fn base_edges(&self) -> impl Iterator<Item = (T, T)> {
22+
unreachable!("-Zassumptions-on-binders is not supported for r-a");
23+
24+
#[allow(unreachable_code)]
25+
[].into_iter()
26+
}
27+
}
28+
#[derive(Clone, Debug)]
29+
#[cfg(not(feature = "nightly"))]
30+
pub struct TransitiveRelationBuilder<T>(T);
31+
#[cfg(not(feature = "nightly"))]
32+
impl<T> TransitiveRelationBuilder<T> {
33+
pub fn freeze(self) -> TransitiveRelation<T> {
34+
unreachable!("-Zassumptions-on-binders is not supported for r-a")
35+
}
36+
37+
pub fn add(&mut self, _: T, _: T) {
38+
unreachable!("-Zassumptions-on-binders is not supported for r-a")
39+
}
40+
}
41+
#[cfg(not(feature = "nightly"))]
42+
impl<T> Default for TransitiveRelationBuilder<T> {
43+
fn default() -> Self {
44+
unreachable!("-Zassumptions-on-binders is not supported for r-a")
45+
}
46+
}
47+
1048
use crate::data_structures::IndexMap;
1149
use crate::fold::TypeSuperFoldable;
1250
use crate::inherent::*;

0 commit comments

Comments
 (0)