Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ fn gen_define_handling<'ll>(
// reference) types.
let num_ptr_types = types
.iter()
.map(|&x| matches!(cx.type_kind(x), rustc_codegen_ssa::common::TypeKind::Pointer))
.filter(|&x| matches!(cx.type_kind(x), rustc_codegen_ssa::common::TypeKind::Pointer))
.count();

// We do not know their size anymore at this level, so hardcode a placeholder.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ impl<'tcx> Display for Const<'tcx> {
}

///////////////////////////////////////////////////////////////////////////
/// Const-related utilities
// Const-related utilities

impl<'tcx> TyCtxt<'tcx> {
pub fn span_as_caller_location(self, span: Span) -> ConstValue {
Expand Down
22 changes: 11 additions & 11 deletions compiler/rustc_middle/src/mir/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,14 @@ impl<'tcx> Place<'tcx> {
self.as_ref().project_deeper(more_projections, tcx)
}

pub fn ty_from<D: ?Sized>(
pub fn ty_from<D>(
local: Local,
projection: &[PlaceElem<'tcx>],
local_decls: &D,
tcx: TyCtxt<'tcx>,
) -> PlaceTy<'tcx>
where
D: HasLocalDecls<'tcx>,
D: ?Sized + HasLocalDecls<'tcx>,
{
PlaceTy::from_ty(local_decls.local_decls()[local].ty).multi_projection_ty(tcx, projection)
}
Expand Down Expand Up @@ -529,9 +529,9 @@ impl<'tcx> PlaceRef<'tcx> {
Place { local: self.local, projection: tcx.mk_place_elems(new_projections) }
}

pub fn ty<D: ?Sized>(&self, local_decls: &D, tcx: TyCtxt<'tcx>) -> PlaceTy<'tcx>
pub fn ty<D>(&self, local_decls: &D, tcx: TyCtxt<'tcx>) -> PlaceTy<'tcx>
where
D: HasLocalDecls<'tcx>,
D: ?Sized + HasLocalDecls<'tcx>,
{
Place::ty_from(self.local, self.projection, local_decls, tcx)
}
Expand Down Expand Up @@ -630,19 +630,19 @@ impl<'tcx> Operand<'tcx> {
if let ty::FnDef(def_id, args) = *const_ty.kind() { Some((def_id, args)) } else { None }
}

pub fn ty<D: ?Sized>(&self, local_decls: &D, tcx: TyCtxt<'tcx>) -> Ty<'tcx>
pub fn ty<D>(&self, local_decls: &D, tcx: TyCtxt<'tcx>) -> Ty<'tcx>
where
D: HasLocalDecls<'tcx>,
D: ?Sized + HasLocalDecls<'tcx>,
{
match self {
&Operand::Copy(ref l) | &Operand::Move(ref l) => l.ty(local_decls, tcx).ty,
Operand::Constant(c) => c.const_.ty(),
}
}

pub fn span<D: ?Sized>(&self, local_decls: &D) -> Span
pub fn span<D>(&self, local_decls: &D) -> Span
where
D: HasLocalDecls<'tcx>,
D: ?Sized + HasLocalDecls<'tcx>,
{
match self {
&Operand::Copy(ref l) | &Operand::Move(ref l) => {
Expand Down Expand Up @@ -674,7 +674,7 @@ impl<'tcx> ConstOperand<'tcx> {
}

///////////////////////////////////////////////////////////////////////////
/// Rvalues
// Rvalues

pub enum RvalueInitializationState {
Shallow,
Expand Down Expand Up @@ -721,9 +721,9 @@ impl<'tcx> Rvalue<'tcx> {
}
}

pub fn ty<D: ?Sized>(&self, local_decls: &D, tcx: TyCtxt<'tcx>) -> Ty<'tcx>
pub fn ty<D>(&self, local_decls: &D, tcx: TyCtxt<'tcx>) -> Ty<'tcx>
where
D: HasLocalDecls<'tcx>,
D: ?Sized + HasLocalDecls<'tcx>,
{
match *self {
Rvalue::Use(ref operand) => operand.ty(local_decls, tcx),
Expand Down
10 changes: 2 additions & 8 deletions compiler/rustc_middle/src/ty/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,7 @@ impl<'tcx, E: TyEncoder<'tcx>> Encodable<E> for ty::ParamEnv<'tcx> {
#[inline]
fn decode_arena_allocable<'tcx, D: TyDecoder<'tcx>, T: ArenaAllocatable<'tcx> + Decodable<D>>(
decoder: &mut D,
) -> &'tcx T
where
D: TyDecoder<'tcx>,
{
) -> &'tcx T {
decoder.interner().arena.alloc(Decodable::decode(decoder))
}

Expand All @@ -230,10 +227,7 @@ fn decode_arena_allocable_slice<
T: ArenaAllocatable<'tcx> + Decodable<D>,
>(
decoder: &mut D,
) -> &'tcx [T]
where
D: TyDecoder<'tcx>,
{
) -> &'tcx [T] {
decoder.interner().arena.alloc_from_iter(<Vec<T> as Decodable<D>>::decode(decoder))
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_query_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<'tcx, C: QueryCache, const ANON: bool, const DEPTH_LIMIT: bool, const FEEDA
for DynamicConfig<'tcx, C, ANON, DEPTH_LIMIT, FEEDABLE>
{
fn clone(&self) -> Self {
DynamicConfig { dynamic: self.dynamic }
*self
}
}

Expand Down
Loading
Loading