Fix rustc_index imports outside the compiler

This commit is contained in:
Maybe Waffle 2023-04-19 14:46:39 +00:00
parent 5d809b1764
commit c0daff08c7
7 changed files with 27 additions and 25 deletions

View file

@ -9,7 +9,7 @@ use smallvec::{smallvec, SmallVec};
/// this adds an extra parameter pointing to where the return value needs to be stored.
pub(super) fn codegen_return_param<'tcx>(
fx: &mut FunctionCx<'_, '_, 'tcx>,
ssa_analyzed: &rustc_index::vec::IndexVec<Local, crate::analyze::SsaKind>,
ssa_analyzed: &rustc_index::IndexSlice<Local, crate::analyze::SsaKind>,
block_params_iter: &mut impl Iterator<Item = Value>,
) -> CPlace<'tcx> {
let (ret_place, ret_param): (_, SmallVec<[_; 2]>) = match fx.fn_abi.as_ref().unwrap().ret.mode {

View file

@ -20,7 +20,7 @@ use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
use rustc_hir::lang_items::LangItem;
use rustc_hir::{BodyId, Mutability};
use rustc_hir_analysis::check::intrinsic::intrinsic_operation_unsafety;
use rustc_index::vec::IndexVec;
use rustc_index::IndexVec;
use rustc_middle::ty::fast_reject::SimplifiedType;
use rustc_middle::ty::{self, TyCtxt, Visibility};
use rustc_resolve::rustdoc::{add_doc_fragment, attrs_to_doc_fragments, inner_docs, DocFragment};

View file

@ -48,7 +48,7 @@ use std::{
use rustc_ast::Mutability;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_index::vec::{Idx, IndexVec};
use rustc_index::{Idx, IndexVec};
use rustc_middle::mir;
use rustc_span::Span;
use rustc_target::abi::{Align, Size};

View file

@ -1,7 +1,7 @@
use std::collections::VecDeque;
use std::num::NonZeroU32;
use rustc_index::vec::Idx;
use rustc_index::Idx;
use super::sync::EvalContextExtPriv as _;
use super::thread::MachineCallback;

View file

@ -5,7 +5,7 @@ use std::ops::Not;
use log::trace;
use rustc_data_structures::fx::FxHashMap;
use rustc_index::vec::{Idx, IndexVec};
use rustc_index::{Idx, IndexVec};
use super::init_once::InitOnce;
use super::vector_clock::VClock;

View file

@ -10,7 +10,7 @@ use log::trace;
use rustc_data_structures::fx::FxHashMap;
use rustc_hir::def_id::DefId;
use rustc_index::vec::{Idx, IndexVec};
use rustc_index::{Idx, IndexVec};
use rustc_middle::mir::Mutability;
use rustc_middle::ty::layout::TyAndLayout;
use rustc_span::Span;
@ -272,8 +272,9 @@ impl Time {
fn get_wait_time(&self, clock: &Clock) -> Duration {
match self {
Time::Monotonic(instant) => instant.duration_since(clock.now()),
Time::RealTime(time) =>
time.duration_since(SystemTime::now()).unwrap_or(Duration::new(0, 0)),
Time::RealTime(time) => {
time.duration_since(SystemTime::now()).unwrap_or(Duration::new(0, 0))
}
}
}
}
@ -603,10 +604,11 @@ impl<'mir, 'tcx: 'mir> ThreadManager<'mir, 'tcx> {
// this allows us to have a deterministic scheduler.
for thread in self.threads.indices() {
match self.timeout_callbacks.entry(thread) {
Entry::Occupied(entry) =>
Entry::Occupied(entry) => {
if entry.get().call_time.get_wait_time(clock) == Duration::new(0, 0) {
return Some((thread, entry.remove().callback));
},
}
}
Entry::Vacant(_) => {}
}
}

View file

@ -1,4 +1,4 @@
use rustc_index::vec::Idx;
use rustc_index::Idx;
use rustc_span::{Span, SpanData, DUMMY_SP};
use smallvec::SmallVec;
use std::{
@ -212,14 +212,16 @@ impl PartialOrd for VClock {
for (l, r) in iter {
match order {
Ordering::Equal => order = l.cmp(r),
Ordering::Less =>
Ordering::Less => {
if l > r {
return None;
},
Ordering::Greater =>
}
}
Ordering::Greater => {
if l < r {
return None;
},
}
}
}
}
@ -234,18 +236,16 @@ impl PartialOrd for VClock {
Ordering::Equal => Some(order),
// Right has at least 1 element > than the implicit 0,
// so the only valid values are Ordering::Less or None.
Ordering::Less =>
match order {
Ordering::Less | Ordering::Equal => Some(Ordering::Less),
Ordering::Greater => None,
},
Ordering::Less => match order {
Ordering::Less | Ordering::Equal => Some(Ordering::Less),
Ordering::Greater => None,
},
// Left has at least 1 element > than the implicit 0,
// so the only valid values are Ordering::Greater or None.
Ordering::Greater =>
match order {
Ordering::Greater | Ordering::Equal => Some(Ordering::Greater),
Ordering::Less => None,
},
Ordering::Greater => match order {
Ordering::Greater | Ordering::Equal => Some(Ordering::Greater),
Ordering::Less => None,
},
}
}