Skip to content

Commit

Permalink
Workaround issue rust-lang#107747
Browse files Browse the repository at this point in the history
Only required until fix rust-lang#107803 is merged into stage0 compiler, expected
when beta 1.69.0 is released on 2023-03-09, then this commit can be
reverted.
  • Loading branch information
eggyal committed Feb 13, 2023
1 parent 36d09e3 commit b409329
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
4 changes: 3 additions & 1 deletion compiler/rustc_hir_analysis/src/variance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ use rustc_arena::DroplessArena;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_middle::ty::query::Providers;
#[cfg(not(bootstrap))]
use rustc_middle::ty::TypeVisitable;
use rustc_middle::ty::{self, CrateVariancesMap, SubstsRef, Ty, TyCtxt};
use rustc_middle::ty::{DefIdTree, TypeSuperVisitable, TypeVisitable};
use rustc_middle::ty::{DefIdTree, TypeSuperVisitable};
use std::ops::ControlFlow;

/// Defines the `TermsContext` basically houses an arena where we can
Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_middle/src/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,13 @@ impl From<call::AdjustForForeignAbiError> for FnAbiError<'_> {

impl<'tcx> fmt::Display for FnAbiError<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
#[cfg(bootstrap)]
match self {
Self::Layout(err) => fmt::Display::fmt(err, f),
Self::AdjustForForeignAbi(err) => fmt::Display::fmt(err, f),
}

#[cfg(not(bootstrap))]
match self {
Self::Layout(err) => err.fmt(f),
Self::AdjustForForeignAbi(err) => err.fmt(f),
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_middle/src/ty/opaque_types.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::error::ConstNotUsedTraitAlias;
use crate::ty::fold::{ir::TypeFolder, TypeSuperFoldable};
use crate::ty::subst::{GenericArg, GenericArgKind};
use crate::ty::{self, Ty, TyCtxt, TypeFoldable};
#[cfg(not(bootstrap))]
use crate::ty::TypeFoldable;
use crate::ty::{self, Ty, TyCtxt};
use rustc_data_structures::fx::FxHashMap;
use rustc_span::def_id::DefId;
use rustc_span::Span;
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_trait_selection/src/traits/auto_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::infer::InferCtxt;
use crate::traits::project::ProjectAndUnifyResult;
use rustc_middle::mir::interpret::ErrorHandled;
use rustc_middle::ty::fold::{ir::TypeFolder, TypeSuperFoldable};
#[cfg(not(bootstrap))]
use rustc_middle::ty::visit::TypeVisitable;
use rustc_middle::ty::{ImplPolarity, Region, RegionVid};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use rustc_data_structures::fx::FxHashSet;
use rustc_hir as hir;
use rustc_middle::ty::{self, ir::TypeVisitor, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable};
#[cfg(not(bootstrap))]
use rustc_middle::ty::TypeVisitable;
use rustc_middle::ty::{self, ir::TypeVisitor, Ty, TyCtxt, TypeSuperVisitable};
use rustc_span::Span;
use std::ops::ControlFlow;

Expand Down

0 comments on commit b409329

Please sign in to comment.