Revert "Fix an ICE in the vtable iteration for a trait reference"
The ICE fix appears to be unsound, causing a miscompilation involving
`dyn Trait` and `async {}` which induces segfaults in safe Rust code.
As the patch only hid an ICE, it does not seem worth the risk.
This reverts commit 8afd63610b, reversing
changes made to 19122c03c7.
This commit is contained in:
parent
3c9faa0d03
commit
18a707fc8e
8 changed files with 35 additions and 88 deletions
|
|
@ -12,7 +12,7 @@ use rustc_span::DUMMY_SP;
|
|||
use smallvec::{SmallVec, smallvec};
|
||||
use tracing::debug;
|
||||
|
||||
use crate::traits::is_vtable_safe_method;
|
||||
use crate::traits::{impossible_predicates, is_vtable_safe_method};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum VtblSegment<'tcx> {
|
||||
|
|
@ -271,7 +271,11 @@ fn vtable_entries<'tcx>(
|
|||
// do not hold for this particular set of type parameters.
|
||||
// Note that this method could then never be called, so we
|
||||
// do not want to try and codegen it, in that case (see #23435).
|
||||
if tcx.instantiate_and_check_impossible_predicates((def_id, args)) {
|
||||
let predicates = tcx.predicates_of(def_id).instantiate_own(tcx, args);
|
||||
if impossible_predicates(
|
||||
tcx,
|
||||
predicates.map(|(predicate, _)| predicate).collect(),
|
||||
) {
|
||||
debug!("vtable_entries: predicates do not hold");
|
||||
return VtblEntry::Vacant;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue