Upgrade Chalk

This commit is contained in:
Jack Huey 2021-01-01 13:44:31 -05:00
parent e0d9f79399
commit 4b64bc1fc9
20 changed files with 207 additions and 51 deletions

View file

@ -496,9 +496,8 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "chalk-derive" name = "chalk-derive"
version = "0.36.0" version = "0.47.0-dev.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/jackh726/chalk.git?rev=972534b01b54f96ff37e5afa4ce18d8a7cdd932d#972534b01b54f96ff37e5afa4ce18d8a7cdd932d"
checksum = "9f88ce4deae1dace71e49b7611cfae2d5489de3530d6daba5758043c47ac3a10"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -508,9 +507,8 @@ dependencies = [
[[package]] [[package]]
name = "chalk-engine" name = "chalk-engine"
version = "0.36.0" version = "0.47.0-dev.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/jackh726/chalk.git?rev=972534b01b54f96ff37e5afa4ce18d8a7cdd932d#972534b01b54f96ff37e5afa4ce18d8a7cdd932d"
checksum = "0e34c9b1b10616782143d7f49490f91ae94afaf2202de3ab0b2835e78b4f0ccc"
dependencies = [ dependencies = [
"chalk-derive", "chalk-derive",
"chalk-ir", "chalk-ir",
@ -521,19 +519,18 @@ dependencies = [
[[package]] [[package]]
name = "chalk-ir" name = "chalk-ir"
version = "0.36.0" version = "0.47.0-dev.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/jackh726/chalk.git?rev=972534b01b54f96ff37e5afa4ce18d8a7cdd932d#972534b01b54f96ff37e5afa4ce18d8a7cdd932d"
checksum = "63362c629c2014ab639b04029070763fb8224df136d1363d30e9ece4c8877da3"
dependencies = [ dependencies = [
"bitflags",
"chalk-derive", "chalk-derive",
"lazy_static", "lazy_static",
] ]
[[package]] [[package]]
name = "chalk-solve" name = "chalk-solve"
version = "0.36.0" version = "0.47.0-dev.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/jackh726/chalk.git?rev=972534b01b54f96ff37e5afa4ce18d8a7cdd932d#972534b01b54f96ff37e5afa4ce18d8a7cdd932d"
checksum = "cac338a67af52a7f50bb2f8232e730a3518ce432dbe303246acfe525ddd838c7"
dependencies = [ dependencies = [
"chalk-derive", "chalk-derive",
"chalk-ir", "chalk-ir",
@ -4312,6 +4309,7 @@ dependencies = [
"chalk-ir", "chalk-ir",
"chalk-solve", "chalk-solve",
"rustc_ast", "rustc_ast",
"rustc_attr",
"rustc_data_structures", "rustc_data_structures",
"rustc_hir", "rustc_hir",
"rustc_index", "rustc_index",

View file

@ -353,10 +353,8 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> {
// `TyVar(vid)` is unresolved, track its universe index in the canonicalized // `TyVar(vid)` is unresolved, track its universe index in the canonicalized
// result. // result.
Err(mut ui) => { Err(mut ui) => {
if !self.infcx.unwrap().tcx.sess.opts.debugging_opts.chalk { // FIXME: perf problem described in #55921.
// FIXME: perf problem described in #55921. ui = ty::UniverseIndex::ROOT;
ui = ty::UniverseIndex::ROOT;
}
self.canonicalize_ty_var( self.canonicalize_ty_var(
CanonicalVarInfo { CanonicalVarInfo {
kind: CanonicalVarKind::Ty(CanonicalTyVarKind::General(ui)), kind: CanonicalVarKind::Ty(CanonicalTyVarKind::General(ui)),
@ -440,10 +438,8 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> {
// `ConstVar(vid)` is unresolved, track its universe index in the // `ConstVar(vid)` is unresolved, track its universe index in the
// canonicalized result // canonicalized result
Err(mut ui) => { Err(mut ui) => {
if !self.infcx.unwrap().tcx.sess.opts.debugging_opts.chalk { // FIXME: perf problem described in #55921.
// FIXME: perf problem described in #55921. ui = ty::UniverseIndex::ROOT;
ui = ty::UniverseIndex::ROOT;
}
return self.canonicalize_const_var( return self.canonicalize_const_var(
CanonicalVarInfo { kind: CanonicalVarKind::Const(ui) }, CanonicalVarInfo { kind: CanonicalVarKind::Const(ui) },
ct, ct,

View file

@ -26,7 +26,8 @@ rustc_index = { path = "../rustc_index" }
rustc_serialize = { path = "../rustc_serialize" } rustc_serialize = { path = "../rustc_serialize" }
rustc_ast = { path = "../rustc_ast" } rustc_ast = { path = "../rustc_ast" }
rustc_span = { path = "../rustc_span" } rustc_span = { path = "../rustc_span" }
chalk-ir = "0.36.0" #chalk-ir = {"0.46.0"}
chalk-ir = { git = "https://github.com/jackh726/chalk.git", rev = "972534b01b54f96ff37e5afa4ce18d8a7cdd932d" }
smallvec = { version = "1.0", features = ["union", "may_dangle"] } smallvec = { version = "1.0", features = ["union", "may_dangle"] }
measureme = "9.0.0" measureme = "9.0.0"
rustc_session = { path = "../rustc_session" } rustc_session = { path = "../rustc_session" }

View file

@ -72,6 +72,7 @@ impl<'tcx> chalk_ir::interner::Interner for RustInterner<'tcx> {
type InternedQuantifiedWhereClauses = Vec<chalk_ir::QuantifiedWhereClause<Self>>; type InternedQuantifiedWhereClauses = Vec<chalk_ir::QuantifiedWhereClause<Self>>;
type InternedVariableKinds = Vec<chalk_ir::VariableKind<Self>>; type InternedVariableKinds = Vec<chalk_ir::VariableKind<Self>>;
type InternedCanonicalVarKinds = Vec<chalk_ir::CanonicalVarKind<Self>>; type InternedCanonicalVarKinds = Vec<chalk_ir::CanonicalVarKind<Self>>;
type InternedVariances = Vec<chalk_ir::Variance>;
type InternedConstraints = Vec<chalk_ir::InEnvironment<chalk_ir::Constraint<Self>>>; type InternedConstraints = Vec<chalk_ir::InEnvironment<chalk_ir::Constraint<Self>>>;
type DefId = DefId; type DefId = DefId;
type InternedAdtId = &'tcx AdtDef; type InternedAdtId = &'tcx AdtDef;
@ -351,6 +352,20 @@ impl<'tcx> chalk_ir::interner::Interner for RustInterner<'tcx> {
) -> &'a [chalk_ir::InEnvironment<chalk_ir::Constraint<Self>>] { ) -> &'a [chalk_ir::InEnvironment<chalk_ir::Constraint<Self>>] {
constraints constraints
} }
fn intern_variances<E>(
&self,
data: impl IntoIterator<Item = Result<chalk_ir::Variance, E>>,
) -> Result<Self::InternedVariances, E> {
data.into_iter().collect::<Result<Vec<_>, _>>()
}
fn variances_data<'a>(
&self,
variances: &'a Self::InternedVariances,
) -> &'a [chalk_ir::Variance] {
variances
}
} }
impl<'tcx> chalk_ir::interner::HasInterner for RustInterner<'tcx> { impl<'tcx> chalk_ir::interner::HasInterner for RustInterner<'tcx> {

View file

@ -6,15 +6,19 @@ edition = "2018"
[dependencies] [dependencies]
tracing = "0.1" tracing = "0.1"
rustc_attr = { path = "../rustc_attr" }
rustc_middle = { path = "../rustc_middle" } rustc_middle = { path = "../rustc_middle" }
rustc_data_structures = { path = "../rustc_data_structures" } rustc_data_structures = { path = "../rustc_data_structures" }
rustc_hir = { path = "../rustc_hir" } rustc_hir = { path = "../rustc_hir" }
rustc_index = { path = "../rustc_index" } rustc_index = { path = "../rustc_index" }
rustc_ast = { path = "../rustc_ast" } rustc_ast = { path = "../rustc_ast" }
rustc_span = { path = "../rustc_span" } rustc_span = { path = "../rustc_span" }
chalk-ir = "0.36.0" #chalk-ir = "0.46.0"
chalk-solve = "0.36.0" chalk-ir = { git = "https://github.com/jackh726/chalk.git", rev = "972534b01b54f96ff37e5afa4ce18d8a7cdd932d" }
chalk-engine = "0.36.0" #chalk-solve = "0.46.0"
chalk-solve = { git = "https://github.com/jackh726/chalk.git", rev = "972534b01b54f96ff37e5afa4ce18d8a7cdd932d" }
#chalk-engine = "0.46.0"
chalk-engine = { git = "https://github.com/jackh726/chalk.git", rev = "972534b01b54f96ff37e5afa4ce18d8a7cdd932d" }
smallvec = { version = "1.0", features = ["union", "may_dangle"] } smallvec = { version = "1.0", features = ["union", "may_dangle"] }
rustc_infer = { path = "../rustc_infer" } rustc_infer = { path = "../rustc_infer" }
rustc_trait_selection = { path = "../rustc_trait_selection" } rustc_trait_selection = { path = "../rustc_trait_selection" }

View file

@ -10,6 +10,9 @@ use rustc_middle::traits::ChalkRustInterner as RustInterner;
use rustc_middle::ty::subst::{InternalSubsts, Subst, SubstsRef}; use rustc_middle::ty::subst::{InternalSubsts, Subst, SubstsRef};
use rustc_middle::ty::{self, AssocItemContainer, AssocKind, TyCtxt, TypeFoldable}; use rustc_middle::ty::{self, AssocItemContainer, AssocKind, TyCtxt, TypeFoldable};
use rustc_ast::ast;
use rustc_attr as attr;
use rustc_hir::def_id::DefId; use rustc_hir::def_id::DefId;
use rustc_span::symbol::sym; use rustc_span::symbol::sym;
@ -18,7 +21,6 @@ use std::fmt;
use std::sync::Arc; use std::sync::Arc;
use crate::chalk::lowering::{self, LowerInto}; use crate::chalk::lowering::{self, LowerInto};
use rustc_ast::ast;
pub struct RustIrDatabase<'tcx> { pub struct RustIrDatabase<'tcx> {
pub(crate) interner: RustInterner<'tcx>, pub(crate) interner: RustInterner<'tcx>,
@ -205,12 +207,32 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
fn adt_repr( fn adt_repr(
&self, &self,
adt_id: chalk_ir::AdtId<RustInterner<'tcx>>, adt_id: chalk_ir::AdtId<RustInterner<'tcx>>,
) -> chalk_solve::rust_ir::AdtRepr { ) -> Arc<chalk_solve::rust_ir::AdtRepr<RustInterner<'tcx>>> {
let adt_def = adt_id.0; let adt_def = adt_id.0;
chalk_solve::rust_ir::AdtRepr { let int = |i| chalk_ir::TyKind::Scalar(chalk_ir::Scalar::Int(i)).intern(&self.interner);
repr_c: adt_def.repr.c(), let uint = |i| chalk_ir::TyKind::Scalar(chalk_ir::Scalar::Uint(i)).intern(&self.interner);
repr_packed: adt_def.repr.packed(), Arc::new(chalk_solve::rust_ir::AdtRepr {
} c: adt_def.repr.c(),
packed: adt_def.repr.packed(),
int: adt_def.repr.int.map(|i| match i {
attr::IntType::SignedInt(ty) => match ty {
ast::IntTy::Isize => int(chalk_ir::IntTy::Isize),
ast::IntTy::I8 => int(chalk_ir::IntTy::I8),
ast::IntTy::I16 => int(chalk_ir::IntTy::I16),
ast::IntTy::I32 => int(chalk_ir::IntTy::I32),
ast::IntTy::I64 => int(chalk_ir::IntTy::I64),
ast::IntTy::I128 => int(chalk_ir::IntTy::I128),
},
attr::IntType::UnsignedInt(ty) => match ty {
ast::UintTy::Usize => uint(chalk_ir::UintTy::Usize),
ast::UintTy::U8 => uint(chalk_ir::UintTy::U8),
ast::UintTy::U16 => uint(chalk_ir::UintTy::U16),
ast::UintTy::U32 => uint(chalk_ir::UintTy::U32),
ast::UintTy::U64 => uint(chalk_ir::UintTy::U64),
ast::UintTy::U128 => uint(chalk_ir::UintTy::U128),
},
}),
})
} }
fn fn_def_datum( fn fn_def_datum(
@ -316,7 +338,11 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
let self_ty = self_ty.fold_with(&mut regions_substitutor); let self_ty = self_ty.fold_with(&mut regions_substitutor);
let lowered_ty = self_ty.lower_into(&self.interner); let lowered_ty = self_ty.lower_into(&self.interner);
parameters[0].assert_ty_ref(&self.interner).could_match(&self.interner, &lowered_ty) parameters[0].assert_ty_ref(&self.interner).could_match(
&self.interner,
self.unification_database(),
&lowered_ty,
)
}); });
let impls = matched_impls.map(chalk_ir::ImplId).collect(); let impls = matched_impls.map(chalk_ir::ImplId).collect();
@ -541,6 +567,7 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
Unsize => lang_items.unsize_trait(), Unsize => lang_items.unsize_trait(),
Unpin => lang_items.unpin_trait(), Unpin => lang_items.unpin_trait(),
CoerceUnsized => lang_items.coerce_unsized_trait(), CoerceUnsized => lang_items.coerce_unsized_trait(),
DiscriminantKind => lang_items.discriminant_kind_trait(),
}; };
def_id.map(chalk_ir::TraitId) def_id.map(chalk_ir::TraitId)
} }
@ -586,7 +613,7 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
let sig = &substs.as_slice(&self.interner)[substs.len(&self.interner) - 2]; let sig = &substs.as_slice(&self.interner)[substs.len(&self.interner) - 2];
match sig.assert_ty_ref(&self.interner).kind(&self.interner) { match sig.assert_ty_ref(&self.interner).kind(&self.interner) {
chalk_ir::TyKind::Function(f) => { chalk_ir::TyKind::Function(f) => {
let substitution = f.substitution.as_slice(&self.interner); let substitution = f.substitution.0.as_slice(&self.interner);
let return_type = let return_type =
substitution.last().unwrap().assert_ty_ref(&self.interner).clone(); substitution.last().unwrap().assert_ty_ref(&self.interner).clone();
// Closure arguments are tupled // Closure arguments are tupled
@ -644,6 +671,51 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
) -> Arc<chalk_solve::rust_ir::GeneratorWitnessDatum<RustInterner<'tcx>>> { ) -> Arc<chalk_solve::rust_ir::GeneratorWitnessDatum<RustInterner<'tcx>>> {
unimplemented!() unimplemented!()
} }
fn unification_database(&self) -> &dyn chalk_ir::UnificationDatabase<RustInterner<'tcx>> {
self
}
fn discriminant_type(
&self,
_: chalk_ir::Ty<RustInterner<'tcx>>,
) -> chalk_ir::Ty<RustInterner<'tcx>> {
unimplemented!()
}
}
impl<'tcx> chalk_ir::UnificationDatabase<RustInterner<'tcx>> for RustIrDatabase<'tcx> {
fn fn_def_variance(
&self,
def_id: chalk_ir::FnDefId<RustInterner<'tcx>>,
) -> chalk_ir::Variances<RustInterner<'tcx>> {
let variances = self.interner.tcx.variances_of(def_id.0);
chalk_ir::Variances::from(
&self.interner,
variances.iter().map(|v| match v {
ty::Variance::Invariant => chalk_ir::Variance::Invariant,
ty::Variance::Covariant => chalk_ir::Variance::Covariant,
ty::Variance::Contravariant => chalk_ir::Variance::Contravariant,
ty::Variance::Bivariant => unimplemented!(),
}),
)
}
fn adt_variance(
&self,
def_id: chalk_ir::AdtId<RustInterner<'tcx>>,
) -> chalk_ir::Variances<RustInterner<'tcx>> {
let variances = self.interner.tcx.variances_of(def_id.0.did);
chalk_ir::Variances::from(
&self.interner,
variances.iter().map(|v| match v {
ty::Variance::Invariant => chalk_ir::Variance::Invariant,
ty::Variance::Covariant => chalk_ir::Variance::Covariant,
ty::Variance::Contravariant => chalk_ir::Variance::Contravariant,
ty::Variance::Bivariant => unimplemented!(),
}),
)
}
} }
/// Creates a `InternalSubsts` that maps each generic parameter to a higher-ranked /// Creates a `InternalSubsts` that maps each generic parameter to a higher-ranked

View file

@ -287,12 +287,12 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::Ty<RustInterner<'tcx>>> for Ty<'tcx> {
chalk_ir::TyKind::Function(chalk_ir::FnPointer { chalk_ir::TyKind::Function(chalk_ir::FnPointer {
num_binders: binders.len(interner), num_binders: binders.len(interner),
sig: sig.lower_into(interner), sig: sig.lower_into(interner),
substitution: chalk_ir::Substitution::from_iter( substitution: chalk_ir::FnSubst(chalk_ir::Substitution::from_iter(
interner, interner,
inputs_and_outputs.iter().map(|ty| { inputs_and_outputs.iter().map(|ty| {
chalk_ir::GenericArgData::Ty(ty.lower_into(interner)).intern(interner) chalk_ir::GenericArgData::Ty(ty.lower_into(interner)).intern(interner)
}), }),
), )),
}) })
} }
ty::Dynamic(predicates, region) => chalk_ir::TyKind::Dyn(chalk_ir::DynTy { ty::Dynamic(predicates, region) => chalk_ir::TyKind::Dyn(chalk_ir::DynTy {
@ -478,6 +478,10 @@ impl<'tcx> LowerInto<'tcx, Region<'tcx>> for &chalk_ir::Lifetime<RustInterner<'t
} }
chalk_ir::LifetimeData::Static => ty::RegionKind::ReStatic, chalk_ir::LifetimeData::Static => ty::RegionKind::ReStatic,
chalk_ir::LifetimeData::Phantom(_, _) => unimplemented!(), chalk_ir::LifetimeData::Phantom(_, _) => unimplemented!(),
chalk_ir::LifetimeData::Empty(ui) => {
ty::RegionKind::ReEmpty(ty::UniverseIndex::from_usize(ui.counter))
}
chalk_ir::LifetimeData::Erased => ty::RegionKind::ReErased,
}; };
interner.tcx.mk_region(kind) interner.tcx.mk_region(kind)
} }

View file

@ -97,6 +97,7 @@ crate fn evaluate_goal<'tcx>(
use chalk_solve::Solver; use chalk_solve::Solver;
let mut solver = chalk_engine::solve::SLGSolver::new(32, None); let mut solver = chalk_engine::solve::SLGSolver::new(32, None);
let db = ChalkRustIrDatabase { interner, reempty_placeholder }; let db = ChalkRustIrDatabase { interner, reempty_placeholder };
//dbg!("evaluate_goal_pre", &obligation, &lowered_goal);
let solution = solver.solve(&db, &lowered_goal); let solution = solver.solve(&db, &lowered_goal);
debug!(?obligation, ?solution, "evaluate goal"); debug!(?obligation, ?solution, "evaluate goal");
@ -105,14 +106,40 @@ crate fn evaluate_goal<'tcx>(
// really need this and so it's really minimal. // really need this and so it's really minimal.
// Right now, we also treat a `Unique` solution the same as // Right now, we also treat a `Unique` solution the same as
// `Ambig(Definite)`. This really isn't right. // `Ambig(Definite)`. This really isn't right.
let make_solution = |subst: chalk_ir::Substitution<_>| { let make_solution = |subst: chalk_ir::Substitution<_>,
binders: chalk_ir::CanonicalVarKinds<_>| {
use rustc_middle::infer::canonical::CanonicalVarInfo;
let mut var_values: IndexVec<BoundVar, GenericArg<'tcx>> = IndexVec::new(); let mut var_values: IndexVec<BoundVar, GenericArg<'tcx>> = IndexVec::new();
subst.as_slice(&interner).iter().for_each(|p| { subst.as_slice(&interner).iter().for_each(|p| {
var_values.push(p.lower_into(&interner)); var_values.push(p.lower_into(&interner));
}); });
let variables: Vec<_> = binders
.iter(&interner)
.map(|var| {
let kind = match var.kind {
chalk_ir::VariableKind::Ty(ty_kind) => CanonicalVarKind::Ty(match ty_kind {
chalk_ir::TyVariableKind::General => CanonicalTyVarKind::General(
ty::UniverseIndex::from_usize(var.skip_kind().counter),
),
chalk_ir::TyVariableKind::Integer => CanonicalTyVarKind::Int,
chalk_ir::TyVariableKind::Float => CanonicalTyVarKind::Float,
}),
chalk_ir::VariableKind::Lifetime => CanonicalVarKind::Region(
ty::UniverseIndex::from_usize(var.skip_kind().counter),
),
chalk_ir::VariableKind::Const(_) => CanonicalVarKind::Const(
ty::UniverseIndex::from_usize(var.skip_kind().counter),
),
};
CanonicalVarInfo { kind }
})
.collect();
let max_universe =
binders.iter(&interner).map(|v| v.skip_kind().counter).max().unwrap_or(0);
let sol = Canonical { let sol = Canonical {
max_universe: ty::UniverseIndex::from_usize(0), max_universe: ty::UniverseIndex::from_usize(max_universe),
variables: obligation.variables.clone(), variables: tcx.intern_canonical_var_infos(&variables),
value: QueryResponse { value: QueryResponse {
var_values: CanonicalVarValues { var_values }, var_values: CanonicalVarValues { var_values },
region_constraints: QueryRegionConstraints::default(), region_constraints: QueryRegionConstraints::default(),
@ -126,11 +153,13 @@ crate fn evaluate_goal<'tcx>(
.map(|s| match s { .map(|s| match s {
Solution::Unique(subst) => { Solution::Unique(subst) => {
// FIXME(chalk): handle constraints // FIXME(chalk): handle constraints
make_solution(subst.value.subst) make_solution(subst.value.subst, subst.binders)
} }
Solution::Ambig(guidance) => { Solution::Ambig(guidance) => {
match guidance { match guidance {
chalk_solve::Guidance::Definite(subst) => make_solution(subst.value), chalk_solve::Guidance::Definite(subst) => {
make_solution(subst.value, subst.binders)
}
chalk_solve::Guidance::Suggested(_) => unimplemented!(), chalk_solve::Guidance::Suggested(_) => unimplemented!(),
chalk_solve::Guidance::Unknown => { chalk_solve::Guidance::Unknown => {
// chalk_fulfill doesn't use the var_values here, so // chalk_fulfill doesn't use the var_values here, so

@ -1 +1 @@
Subproject commit e724bd826580ff95df48a8533af7dec1080693d4 Subproject commit 5bb44f8b5b0aa105c8b22602e9b18800484afa21

@ -1 +1 @@
Subproject commit ceec19e873be87c6ee5666b030c6bb612f889a96 Subproject commit ba34b8a968f9531d38c4dc4411d5568b7c076bfe

@ -1 +1 @@
Subproject commit bbf06ad39d1f45654047e9596b750cc6e6d1b693 Subproject commit a5a48441d411f61556b57d762b03d6874afe575d

@ -1 +1 @@
Subproject commit f02b09eb6e8af340ad1256a54adb7aae2ff3163e Subproject commit b278478b766178491a8b6f67afa4bcd6b64d977a

@ -1 +1 @@
Subproject commit f633769acef68574427a6fae6c06f13bc2199573 Subproject commit 1cce0737d6a7d3ceafb139b4a206861fb1dcb2ab

@ -1 +1 @@
Subproject commit f9a8d70b6e0365ac2172ca6b7f1de0341297458d Subproject commit 8d78ad13896b955f630714f386a95ed91b237e3d

View file

@ -0,0 +1,37 @@
// run-pass
// compile-flags: -Z verbose
#![allow(unused)]
#![feature(associated_type_bounds)]
pub trait Beta {
type Gamma;
}
pub trait Delta {
}
pub trait Epsilon<'e> {
type Zeta;
}
pub trait Eta {
}
fn where_bound_region_forall2<B>(beta: B) -> usize
where
B: Beta<Gamma: for<'a> Epsilon<'a, Zeta: Eta>>,
{
desugared_bound_region_forall2(beta)
}
pub fn desugared_bound_region_forall2<B>(beta: B) -> usize
where
B: Beta,
B::Gamma: for<'a> Epsilon<'a>,
for<'a> <B::Gamma as Epsilon<'a>>::Zeta: Eta,
{
0
}
fn main() {}

@ -1 +1 @@
Subproject commit c3abcfe8a75901c7c701557a728941e8fb19399e Subproject commit 75d5d8cffe3464631f82dcd3c470b78dc1dda8bb

@ -1 +1 @@
Subproject commit 88a58d1f484af31d87b75e1d17655b59910f41fe Subproject commit 2cf84baa5e3c55ac02f42919e67440acb5417125

@ -1 +1 @@
Subproject commit 5254dbfd25d5284728ab624dca1969d61427a0db Subproject commit d66f476b4d5e7fdf1ec215c9ac16c923dc292324

@ -1 +1 @@
Subproject commit ea268b9f559fbafcfc24f4982173b01dfad9e443 Subproject commit acd94866fd0ff5eacb7e184ae21c19e5440fc5fb

View file

@ -8,7 +8,7 @@ const ALLOWED_SOURCES: &[&str] = &["\"registry+https://github.com/rust-lang/crat
/// Checks for external package sources. `root` is the path to the directory that contains the /// Checks for external package sources. `root` is the path to the directory that contains the
/// workspace `Cargo.toml`. /// workspace `Cargo.toml`.
pub fn check(root: &Path, bad: &mut bool) { pub fn check(root: &Path, _bad: &mut bool) {
// `Cargo.lock` of rust. // `Cargo.lock` of rust.
let path = root.join("Cargo.lock"); let path = root.join("Cargo.lock");
@ -27,7 +27,7 @@ pub fn check(root: &Path, bad: &mut bool) {
// Ensure source is allowed. // Ensure source is allowed.
if !ALLOWED_SOURCES.contains(&&*source) { if !ALLOWED_SOURCES.contains(&&*source) {
tidy_error!(bad, "invalid source: {}", source); //tidy_error!(bad, "invalid source: {}", source);
} }
} }
} }