Skip to content

Commit b06d5b2

Browse files
committed
few more
1 parent aff6c74 commit b06d5b2

File tree

3 files changed

+1
-50
lines changed

3 files changed

+1
-50
lines changed

compiler/rustc_const_eval/src/transform/promote_consts.rs

-33
Original file line numberDiff line numberDiff line change
@@ -1023,36 +1023,3 @@ pub fn promote_candidates<'tcx>(
10231023

10241024
promotions
10251025
}
1026-
1027-
/// This function returns `true` if the function being called in the array
1028-
/// repeat expression is a `const` function.
1029-
pub fn is_const_fn_in_array_repeat_expression<'tcx>(
1030-
ccx: &ConstCx<'_, 'tcx>,
1031-
place: &Place<'tcx>,
1032-
body: &Body<'tcx>,
1033-
) -> bool {
1034-
match place.as_local() {
1035-
// rule out cases such as: `let my_var = some_fn(); [my_var; N]`
1036-
Some(local) if body.local_decls[local].is_user_variable() => return false,
1037-
None => return false,
1038-
_ => {}
1039-
}
1040-
1041-
for block in body.basic_blocks.iter() {
1042-
if let Some(Terminator { kind: TerminatorKind::Call { func, destination, .. }, .. }) =
1043-
&block.terminator
1044-
{
1045-
if let Operand::Constant(box ConstOperand { const_, .. }) = func {
1046-
if let ty::FnDef(def_id, _) = *const_.ty().kind() {
1047-
if destination == place {
1048-
if ccx.tcx.is_const_fn(def_id) {
1049-
return true;
1050-
}
1051-
}
1052-
}
1053-
}
1054-
}
1055-
}
1056-
1057-
false
1058-
}

compiler/rustc_middle/src/ty/mod.rs

-17
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ use rustc_errors::{DiagnosticBuilder, ErrorGuaranteed, StashKey};
4242
use rustc_hir as hir;
4343
use rustc_hir::def::{CtorKind, CtorOf, DefKind, DocLinkResMap, LifetimeRes, Res};
4444
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, LocalDefIdMap};
45-
use rustc_hir::Node;
4645
use rustc_index::IndexVec;
4746
use rustc_macros::HashStable;
4847
use rustc_query_system::ich::StableHashingContext;
@@ -2513,22 +2512,6 @@ impl<'tcx> TyCtxt<'tcx> {
25132512
}
25142513
}
25152514

2516-
/// Yields the parent function's `LocalDefId` if `def_id` is an `impl Trait` definition.
2517-
pub fn is_impl_trait_defn(tcx: TyCtxt<'_>, def_id: DefId) -> Option<LocalDefId> {
2518-
let def_id = def_id.as_local()?;
2519-
if let Node::Item(item) = tcx.hir().get_by_def_id(def_id) {
2520-
if let hir::ItemKind::OpaqueTy(opaque_ty) = item.kind {
2521-
return match opaque_ty.origin {
2522-
hir::OpaqueTyOrigin::FnReturn(parent) | hir::OpaqueTyOrigin::AsyncFn(parent) => {
2523-
Some(parent)
2524-
}
2525-
hir::OpaqueTyOrigin::TyAlias { .. } => None,
2526-
};
2527-
}
2528-
}
2529-
None
2530-
}
2531-
25322515
pub fn int_ty(ity: ast::IntTy) -> IntTy {
25332516
match ity {
25342517
ast::IntTy::Isize => IntTy::Isize,

compiler/rustc_trait_selection/src/traits/coherence.rs

+1
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ fn equate_impl_headers<'tcx>(
330330
impl1.self_ty,
331331
impl2.self_ty,
332332
),
333+
// FIXME: mk_eq_impl_headers fn not exist
333334
_ => bug!("mk_eq_impl_headers given mismatched impl kinds"),
334335
};
335336

0 commit comments

Comments
 (0)