Skip to content

Commit

Permalink
feat(exporter): feature(trait_alias): only when feature(rustc)
Browse files Browse the repository at this point in the history
  • Loading branch information
W95Psp committed Jul 9, 2024
1 parent cae3db5 commit c51df12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/exporter/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![feature(trait_alias)]
#![allow(rustdoc::private_intra_doc_links)]
#![cfg_attr(feature = "rustc", feature(type_changing_struct_update))]
#![cfg_attr(feature = "rustc", feature(macro_metavar_expr))]
#![cfg_attr(feature = "rustc", feature(concat_idents))]
#![cfg_attr(feature = "rustc", feature(trait_alias))]
#![cfg_attr(feature = "rustc", feature(rustc_private))]

macro_rules! cfg_feature_rustc {
Expand Down
5 changes: 5 additions & 0 deletions frontend/exporter/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,14 @@ pub fn with_owner_id<'tcx, THIR, MIR>(
}

pub trait BaseState<'tcx> = HasBase<'tcx> + Clone + IsState<'tcx>;

/// State of anything below a `owner_id`
pub trait UnderOwnerState<'tcx> = BaseState<'tcx> + HasOwnerId;

/// While translating expressions, we expect to always have a THIR
/// body and an `owner_id` in the state
pub trait ExprState<'tcx> = UnderOwnerState<'tcx> + HasThir<'tcx>;

impl ImplInfos {
fn from<'tcx>(base: Base<'tcx>, did: rustc_hir::def_id::DefId) -> Self {
let tcx = base.tcx;
Expand Down
5 changes: 0 additions & 5 deletions frontend/exporter/src/types/copied.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1322,11 +1322,6 @@ impl<'tcx, S: ExprState<'tcx>> SInto<S, Stmt> for rustc_middle::thir::StmtId {
}
}

/// While translating expressions, we expect to always have a THIR
/// body and an `owner_id` in the state
#[cfg(feature = "rustc")]
pub trait ExprState<'tcx> = UnderOwnerState<'tcx> + HasThir<'tcx>;

#[cfg(feature = "rustc")]
impl<'tcx, S: ExprState<'tcx>> SInto<S, Expr> for rustc_middle::thir::Expr<'tcx> {
fn sinto(&self, s: &S) -> Expr {
Expand Down

0 comments on commit c51df12

Please sign in to comment.