Remove dead/useless code
This commit is contained in:
parent
8e93a48c32
commit
801be21d11
2 changed files with 0 additions and 58 deletions
|
@ -230,8 +230,6 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.check_item_predicates();
|
|
||||||
|
|
||||||
for (idx, local) in body.local_decls.iter_enumerated() {
|
for (idx, local) in body.local_decls.iter_enumerated() {
|
||||||
// Handle the return place below.
|
// Handle the return place below.
|
||||||
if idx == RETURN_PLACE || local.internal {
|
if idx == RETURN_PLACE || local.internal {
|
||||||
|
@ -364,40 +362,6 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_item_predicates(&mut self) {
|
|
||||||
let ConstCx { tcx, .. } = *self.ccx;
|
|
||||||
|
|
||||||
let mut current = self.def_id().to_def_id();
|
|
||||||
loop {
|
|
||||||
let predicates = tcx.predicates_of(current);
|
|
||||||
for (predicate, _) in predicates.predicates {
|
|
||||||
match predicate.kind().skip_binder() {
|
|
||||||
ty::PredicateKind::RegionOutlives(_)
|
|
||||||
| ty::PredicateKind::TypeOutlives(_)
|
|
||||||
| ty::PredicateKind::WellFormed(_)
|
|
||||||
| ty::PredicateKind::Projection(_)
|
|
||||||
| ty::PredicateKind::ConstEvaluatable(..)
|
|
||||||
| ty::PredicateKind::ConstEquate(..)
|
|
||||||
| ty::PredicateKind::Trait(..)
|
|
||||||
| ty::PredicateKind::TypeWellFormedFromEnv(..) => continue,
|
|
||||||
ty::PredicateKind::ObjectSafe(_) => {
|
|
||||||
bug!("object safe predicate on function: {:#?}", predicate)
|
|
||||||
}
|
|
||||||
ty::PredicateKind::ClosureKind(..) => {
|
|
||||||
bug!("closure kind predicate on function: {:#?}", predicate)
|
|
||||||
}
|
|
||||||
ty::PredicateKind::Subtype(_) | ty::PredicateKind::Coerce(_) => {
|
|
||||||
bug!("subtype/coerce predicate on function: {:#?}", predicate)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
match predicates.parent {
|
|
||||||
Some(parent) => current = parent,
|
|
||||||
None => break,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn check_mut_borrow(&mut self, local: Local, kind: hir::BorrowKind) {
|
fn check_mut_borrow(&mut self, local: Local, kind: hir::BorrowKind) {
|
||||||
match self.const_kind() {
|
match self.const_kind() {
|
||||||
// In a const fn all borrows are transient or point to the places given via
|
// In a const fn all borrows are transient or point to the places given via
|
||||||
|
|
|
@ -816,26 +816,4 @@ pub mod ty {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A trait bound with the `?const Trait` opt-out
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct TraitBoundNotConst;
|
|
||||||
impl<'tcx> NonConstOp<'tcx> for TraitBoundNotConst {
|
|
||||||
fn status_in_item(&self, _: &ConstCx<'_, 'tcx>) -> Status {
|
|
||||||
Status::Unstable(sym::const_trait_bound_opt_out)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn build_error(
|
|
||||||
&self,
|
|
||||||
ccx: &ConstCx<'_, 'tcx>,
|
|
||||||
span: Span,
|
|
||||||
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
|
|
||||||
feature_err(
|
|
||||||
&ccx.tcx.sess.parse_sess,
|
|
||||||
sym::const_trait_bound_opt_out,
|
|
||||||
span,
|
|
||||||
"`?const Trait` syntax is unstable",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue