Skip to content

Commit b409329

Browse files
committed
Workaround issue rust-lang#107747
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.
1 parent 36d09e3 commit b409329

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

compiler/rustc_hir_analysis/src/variance/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ use rustc_arena::DroplessArena;
77
use rustc_hir::def::DefKind;
88
use rustc_hir::def_id::{DefId, LocalDefId};
99
use rustc_middle::ty::query::Providers;
10+
#[cfg(not(bootstrap))]
11+
use rustc_middle::ty::TypeVisitable;
1012
use rustc_middle::ty::{self, CrateVariancesMap, SubstsRef, Ty, TyCtxt};
11-
use rustc_middle::ty::{DefIdTree, TypeSuperVisitable, TypeVisitable};
13+
use rustc_middle::ty::{DefIdTree, TypeSuperVisitable};
1214
use std::ops::ControlFlow;
1315

1416
/// Defines the `TermsContext` basically houses an arena where we can

compiler/rustc_middle/src/ty/layout.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,13 @@ impl From<call::AdjustForForeignAbiError> for FnAbiError<'_> {
11201120

11211121
impl<'tcx> fmt::Display for FnAbiError<'tcx> {
11221122
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1123+
#[cfg(bootstrap)]
1124+
match self {
1125+
Self::Layout(err) => fmt::Display::fmt(err, f),
1126+
Self::AdjustForForeignAbi(err) => fmt::Display::fmt(err, f),
1127+
}
1128+
1129+
#[cfg(not(bootstrap))]
11231130
match self {
11241131
Self::Layout(err) => err.fmt(f),
11251132
Self::AdjustForForeignAbi(err) => err.fmt(f),

compiler/rustc_middle/src/ty/opaque_types.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use crate::error::ConstNotUsedTraitAlias;
22
use crate::ty::fold::{ir::TypeFolder, TypeSuperFoldable};
33
use crate::ty::subst::{GenericArg, GenericArgKind};
4-
use crate::ty::{self, Ty, TyCtxt, TypeFoldable};
4+
#[cfg(not(bootstrap))]
5+
use crate::ty::TypeFoldable;
6+
use crate::ty::{self, Ty, TyCtxt};
57
use rustc_data_structures::fx::FxHashMap;
68
use rustc_span::def_id::DefId;
79
use rustc_span::Span;

compiler/rustc_trait_selection/src/traits/auto_trait.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use crate::infer::InferCtxt;
99
use crate::traits::project::ProjectAndUnifyResult;
1010
use rustc_middle::mir::interpret::ErrorHandled;
1111
use rustc_middle::ty::fold::{ir::TypeFolder, TypeSuperFoldable};
12+
#[cfg(not(bootstrap))]
1213
use rustc_middle::ty::visit::TypeVisitable;
1314
use rustc_middle::ty::{ImplPolarity, Region, RegionVid};
1415

compiler/rustc_trait_selection/src/traits/structural_match.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use rustc_data_structures::fx::FxHashSet;
22
use rustc_hir as hir;
3-
use rustc_middle::ty::{self, ir::TypeVisitor, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable};
3+
#[cfg(not(bootstrap))]
4+
use rustc_middle::ty::TypeVisitable;
5+
use rustc_middle::ty::{self, ir::TypeVisitor, Ty, TyCtxt, TypeSuperVisitable};
46
use rustc_span::Span;
57
use std::ops::ControlFlow;
68

0 commit comments

Comments
 (0)