Update to chalk 0.31. Implement some unimplemented. Ignore some tests in compare mode chalk don't finish.

This commit is contained in:
Jack Huey 2020-10-03 20:45:12 -04:00
parent 08e2d46166
commit 23491084bc
44 changed files with 143 additions and 99 deletions

View File

@ -442,9 +442,9 @@ dependencies = [
[[package]]
name = "chalk-derive"
version = "0.29.0"
version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a7f257e3bcdc56d8877ae31c012bd69fba0be66929d588e603905f2632c0c59"
checksum = "ca40c97e20f43e4aac2282d342103d45fafad74ad9bfcbaaf0b5d386f9ce1f39"
dependencies = [
"proc-macro2",
"quote",
@ -454,9 +454,9 @@ dependencies = [
[[package]]
name = "chalk-engine"
version = "0.29.0"
version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c43fcc7edf4d51b42f44ed50e2337bd90ddc8e088d0cd78a71db92a6f780f782"
checksum = "88e3d545394fbc4f7d8fe203c6a78d2b73f82bb119f21af98de1f924c2518e34"
dependencies = [
"chalk-derive",
"chalk-ir",
@ -467,9 +467,9 @@ dependencies = [
[[package]]
name = "chalk-ir"
version = "0.29.0"
version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03a4050029ecb2b5a1ff3bfc64c39279179b294821ec2e8891a4a5c6e3a08db0"
checksum = "8c4183955e084fcc387b515f867ed0e17e9e7301f5eee29c0338d5e63315bb41"
dependencies = [
"chalk-derive",
"lazy_static",
@ -477,9 +477,9 @@ dependencies = [
[[package]]
name = "chalk-solve"
version = "0.29.0"
version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "828c1f80d4eaf681027cce02050c54a3c97370f81988d31bf2a56df54048746c"
checksum = "50e8407bba06d9e760011a28060e8f3b3f87b82ea53fb8bfaa43614c19c14dcc"
dependencies = [
"chalk-derive",
"chalk-ir",
@ -5121,9 +5121,9 @@ dependencies = [
[[package]]
name = "tracing-serde"
version = "0.1.1"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6ccba2f8f16e0ed268fc765d9b7ff22e965e7185d32f8f1ec8294fe17d86e79"
checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b"
dependencies = [
"serde",
"tracing-core",

View File

@ -26,7 +26,7 @@ rustc_index = { path = "../rustc_index" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_ast = { path = "../rustc_ast" }
rustc_span = { path = "../rustc_span" }
chalk-ir = "0.29.0"
chalk-ir = "0.31.0"
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
measureme = "0.7.1"
rustc_session = { path = "../rustc_session" }

View File

@ -12,9 +12,9 @@ rustc_hir = { path = "../rustc_hir" }
rustc_index = { path = "../rustc_index" }
rustc_ast = { path = "../rustc_ast" }
rustc_span = { path = "../rustc_span" }
chalk-ir = "0.29.0"
chalk-solve = "0.29.0"
chalk-engine = "0.29.0"
chalk-ir = "0.31.0"
chalk-solve = "0.31.0"
chalk-engine = "0.31.0"
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
rustc_infer = { path = "../rustc_infer" }
rustc_trait_selection = { path = "../rustc_trait_selection" }

View File

@ -22,7 +22,6 @@
pub struct RustIrDatabase<'tcx> {
pub(crate) interner: RustInterner<'tcx>,
pub(crate) restatic_placeholder: ty::Region<'tcx>,
pub(crate) reempty_placeholder: ty::Region<'tcx>,
}
@ -39,11 +38,8 @@ fn where_clauses_for(
bound_vars: SubstsRef<'tcx>,
) -> Vec<chalk_ir::QuantifiedWhereClause<RustInterner<'tcx>>> {
let predicates = self.interner.tcx.predicates_of(def_id).predicates;
let mut regions_substitutor = lowering::RegionsSubstitutor::new(
self.interner.tcx,
self.restatic_placeholder,
self.reempty_placeholder,
);
let mut regions_substitutor =
lowering::RegionsSubstitutor::new(self.interner.tcx, self.reempty_placeholder);
predicates
.iter()
.map(|(wc, _)| wc.subst(self.interner.tcx, bound_vars))
@ -274,11 +270,8 @@ fn impl_datum(
let trait_ref = self.interner.tcx.impl_trait_ref(def_id).expect("not an impl");
let trait_ref = trait_ref.subst(self.interner.tcx, bound_vars);
let mut regions_substitutor = lowering::RegionsSubstitutor::new(
self.interner.tcx,
self.restatic_placeholder,
self.reempty_placeholder,
);
let mut regions_substitutor =
lowering::RegionsSubstitutor::new(self.interner.tcx, self.reempty_placeholder);
let trait_ref = trait_ref.fold_with(&mut regions_substitutor);
let where_clauses = self.where_clauses_for(def_id, bound_vars);
@ -316,11 +309,8 @@ fn impls_for_trait(
let self_ty = trait_ref.self_ty();
let self_ty = self_ty.subst(self.interner.tcx, bound_vars);
let mut regions_substitutor = lowering::RegionsSubstitutor::new(
self.interner.tcx,
self.restatic_placeholder,
self.reempty_placeholder,
);
let mut regions_substitutor =
lowering::RegionsSubstitutor::new(self.interner.tcx, self.reempty_placeholder);
let self_ty = self_ty.fold_with(&mut regions_substitutor);
let lowered_ty = self_ty.lower_into(&self.interner);
@ -590,6 +580,20 @@ fn closure_fn_substitution(
let substitution = &substs.as_slice(&self.interner)[0..substs.len(&self.interner) - 3];
chalk_ir::Substitution::from_iter(&self.interner, substitution)
}
fn generator_datum(
&self,
_generator_id: chalk_ir::GeneratorId<RustInterner<'tcx>>,
) -> Arc<chalk_solve::rust_ir::GeneratorDatum<RustInterner<'tcx>>> {
unimplemented!()
}
fn generator_witness_datum(
&self,
_generator_id: chalk_ir::GeneratorId<RustInterner<'tcx>>,
) -> Arc<chalk_solve::rust_ir::GeneratorWitnessDatum<RustInterner<'tcx>>> {
unimplemented!()
}
}
/// Creates a `InternalSubsts` that maps each generic parameter to a higher-ranked

View File

@ -427,13 +427,20 @@ fn lower_into(self, interner: &RustInterner<'tcx>) -> Ty<'tcx> {
chalk_ir::FloatTy::F64 => ty::Float(ast::FloatTy::F64),
},
},
chalk_ir::TypeName::Array => unimplemented!(),
chalk_ir::TypeName::Array => {
let substs = application_ty.substitution.as_slice(interner);
let ty = substs[0].assert_ty_ref(interner).lower_into(interner);
let c = substs[1].assert_const_ref(interner).lower_into(interner);
ty::Array(ty, interner.tcx.mk_const(c))
}
chalk_ir::TypeName::FnDef(id) => {
ty::FnDef(id.0, application_ty.substitution.lower_into(interner))
}
chalk_ir::TypeName::Closure(closure) => {
ty::Closure(closure.0, application_ty.substitution.lower_into(interner))
}
chalk_ir::TypeName::Generator(_) => unimplemented!(),
chalk_ir::TypeName::GeneratorWitness(_) => unimplemented!(),
chalk_ir::TypeName::Never => ty::Never,
chalk_ir::TypeName::Tuple(_size) => {
ty::Tuple(application_ty.substitution.lower_into(interner))
@ -483,7 +490,15 @@ fn lower_into(self, interner: &RustInterner<'tcx>) -> Ty<'tcx> {
universe: ty::UniverseIndex::from_usize(placeholder.ui.counter),
name: ty::BoundVar::from_usize(placeholder.idx),
}),
TyData::Alias(_alias_ty) => unimplemented!(),
chalk_ir::TyData::Alias(alias_ty) => match alias_ty {
chalk_ir::AliasTy::Projection(projection) => ty::Projection(ty::ProjectionTy {
item_def_id: projection.associated_ty_id.0,
substs: projection.substitution.lower_into(interner),
}),
chalk_ir::AliasTy::Opaque(opaque) => {
ty::Opaque(opaque.opaque_ty_id.0, opaque.substitution.lower_into(interner))
}
},
TyData::Function(_quantified_ty) => unimplemented!(),
TyData::BoundVar(_bound) => ty::Bound(
ty::DebruijnIndex::from_usize(_bound.debruijn.depth() as usize),
@ -519,8 +534,7 @@ fn lower_into(self, interner: &RustInterner<'tcx>) -> chalk_ir::Lifetime<RustInt
ty::BrEnv => unimplemented!(),
},
ReFree(_) => unimplemented!(),
// FIXME(chalk): need to handle ReStatic
ReStatic => unimplemented!(),
ReStatic => chalk_ir::LifetimeData::Static.intern(interner),
ReVar(_) => unimplemented!(),
RePlaceholder(placeholder_region) => {
chalk_ir::LifetimeData::Placeholder(chalk_ir::PlaceholderIndex {
@ -550,6 +564,7 @@ fn lower_into(self, interner: &RustInterner<'tcx>) -> Region<'tcx> {
name: ty::BoundRegion::BrAnon(p.idx as u32),
})
}
chalk_ir::LifetimeData::Static => ty::RegionKind::ReStatic,
chalk_ir::LifetimeData::Phantom(_, _) => unimplemented!(),
};
interner.tcx.mk_region(kind)
@ -701,7 +716,16 @@ fn lower_into(
}),
)
}
ty::ExistentialPredicate::Projection(_predicate) => unimplemented!(),
ty::ExistentialPredicate::Projection(predicate) => chalk_ir::Binders::new(
chalk_ir::VariableKinds::empty(interner),
chalk_ir::WhereClause::AliasEq(chalk_ir::AliasEq {
alias: chalk_ir::AliasTy::Projection(chalk_ir::ProjectionTy {
associated_ty_id: chalk_ir::AssocTypeId(predicate.item_def_id),
substitution: predicate.substs.lower_into(interner),
}),
ty: predicate.ty.lower_into(interner),
}),
),
ty::ExistentialPredicate::AutoTrait(def_id) => chalk_ir::Binders::new(
chalk_ir::VariableKinds::empty(interner),
chalk_ir::WhereClause::Implemented(chalk_ir::TraitRef {
@ -1116,17 +1140,12 @@ fn visit_region(&mut self, r: Region<'tcx>) -> bool {
/// Used to substitute specific `Regions`s with placeholders.
crate struct RegionsSubstitutor<'tcx> {
tcx: TyCtxt<'tcx>,
restatic_placeholder: ty::Region<'tcx>,
reempty_placeholder: ty::Region<'tcx>,
}
impl<'tcx> RegionsSubstitutor<'tcx> {
crate fn new(
tcx: TyCtxt<'tcx>,
restatic_placeholder: ty::Region<'tcx>,
reempty_placeholder: ty::Region<'tcx>,
) -> Self {
RegionsSubstitutor { tcx, restatic_placeholder, reempty_placeholder }
crate fn new(tcx: TyCtxt<'tcx>, reempty_placeholder: ty::Region<'tcx>) -> Self {
RegionsSubstitutor { tcx, reempty_placeholder }
}
}
@ -1137,7 +1156,6 @@ fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
fn fold_region(&mut self, r: Region<'tcx>) -> Region<'tcx> {
match r {
ty::ReStatic => self.restatic_placeholder,
ty::ReEmpty(ui) => {
assert_eq!(ui.as_usize(), 0);
self.reempty_placeholder

View File

@ -42,10 +42,6 @@
let mut placeholders_collector = PlaceholdersCollector::new();
obligation.visit_with(&mut placeholders_collector);
let restatic_placeholder = tcx.mk_region(ty::RegionKind::RePlaceholder(ty::Placeholder {
universe: ty::UniverseIndex::ROOT,
name: ty::BoundRegion::BrAnon(placeholders_collector.next_anon_region_placeholder),
}));
let reempty_placeholder = tcx.mk_region(ty::RegionKind::RePlaceholder(ty::Placeholder {
universe: ty::UniverseIndex::ROOT,
name: ty::BoundRegion::BrAnon(placeholders_collector.next_anon_region_placeholder + 1),
@ -57,8 +53,7 @@
// FIXME(chalk): we really should be substituting these back in the solution
let _params: FxHashMap<usize, ParamTy> = params_substitutor.params;
let mut regions_substitutor =
RegionsSubstitutor::new(tcx, restatic_placeholder, reempty_placeholder);
let mut regions_substitutor = RegionsSubstitutor::new(tcx, reempty_placeholder);
let obligation = obligation.fold_with(&mut regions_substitutor);
let max_universe = obligation.max_universe.index();
@ -101,7 +96,7 @@
use chalk_solve::Solver;
let mut solver = chalk_engine::solve::SLGSolver::new(32, None);
let db = ChalkRustIrDatabase { interner, restatic_placeholder, reempty_placeholder };
let db = ChalkRustIrDatabase { interner, reempty_placeholder };
let solution = chalk_solve::logging::with_tracing_logs(|| solver.solve(&db, &lowered_goal));
// Ideally, the code to convert *back* to rustc types would live close to

View File

@ -1,5 +1,6 @@
// NOTE: rustc cannot currently handle bounds of the form `for<'a> <Foo as Bar<'a>>::Assoc: Baz`.
// This should hopefully be fixed with Chalk.
// ignore-compare-mode-chalk
#![feature(associated_type_bounds)]

View File

@ -1,5 +1,5 @@
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` is not an iterator
--> $DIR/bad-bounds-on-assoc-in-trait.rs:26:5
--> $DIR/bad-bounds-on-assoc-in-trait.rs:27:5
|
LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `<<Self as Case1>::C as Iterator>::Item` is not an iterator
@ -11,7 +11,7 @@ LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Iterator {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` cannot be sent between threads safely
--> $DIR/bad-bounds-on-assoc-in-trait.rs:26:36
--> $DIR/bad-bounds-on-assoc-in-trait.rs:27:36
|
LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be sent between threads safely
@ -28,7 +28,7 @@ LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Send {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely
--> $DIR/bad-bounds-on-assoc-in-trait.rs:26:93
--> $DIR/bad-bounds-on-assoc-in-trait.rs:27:93
|
LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely

View File

@ -1,4 +1,5 @@
// build-pass (FIXME(62277): could be check-pass?)
// ignore-compare-mode-chalk
#![feature(associated_type_bounds)]

View File

@ -1,4 +1,5 @@
// run-pass
// ignore-compare-mode-chalk
#![feature(associated_type_bounds)]
#![feature(untagged_unions)]

View File

@ -1,6 +1,7 @@
// run-pass
// Test references to the trait `Stream` in the bounds for associated
// types defined on `Stream`. Issue #20551.
// ignore-compare-mode-chalk
trait Stream {

View File

@ -1,3 +1,4 @@
// ignore-compare-mode-chalk
trait Z<'a, T: ?Sized>
where
T: Z<'a, u16>,

View File

@ -1,5 +1,5 @@
error[E0277]: the trait bound `for<'b> <u16 as Z<'b, u16>>::W: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-2.rs:3:8
--> $DIR/hr-associated-type-bound-param-2.rs:4:8
|
LL | trait Z<'a, T: ?Sized>
| - required by a bound in this
@ -15,7 +15,7 @@ LL | for<'b> <T as Z<'b, u16>>::W: Clone,
<&mut T as Clone>
error[E0277]: the trait bound `for<'b> <u16 as Z<'b, u16>>::W: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-2.rs:15:14
--> $DIR/hr-associated-type-bound-param-2.rs:16:14
|
LL | trait Z<'a, T: ?Sized>
| - required by a bound in this
@ -31,7 +31,7 @@ LL | type W = str;
<&mut T as Clone>
error[E0277]: the trait bound `for<'b> <u16 as Z<'b, u16>>::W: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-2.rs:3:8
--> $DIR/hr-associated-type-bound-param-2.rs:4:8
|
LL | trait Z<'a, T: ?Sized>
| - required by a bound in this

View File

@ -1,3 +1,4 @@
// ignore-compare-mode-chalk
trait Cycle: Sized {
type Next: Cycle<Next = Self>;
}

View File

@ -1,5 +1,5 @@
error[E0277]: the trait bound `for<'b> <Box<T> as X<'b, Box<T>>>::U: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-5.rs:26:14
--> $DIR/hr-associated-type-bound-param-5.rs:27:14
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this
@ -15,7 +15,7 @@ LL | type U = str;
<&mut T as Clone>
error[E0277]: the trait bound `for<'b> <Vec<T> as X<'b, Vec<T>>>::U: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-5.rs:26:14
--> $DIR/hr-associated-type-bound-param-5.rs:27:14
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this
@ -31,7 +31,7 @@ LL | type U = str;
<&mut T as Clone>
error[E0277]: the trait bound `for<'b> <Vec<T> as X<'b, Vec<T>>>::U: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-5.rs:32:14
--> $DIR/hr-associated-type-bound-param-5.rs:33:14
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this
@ -47,7 +47,7 @@ LL | type U = str;
<&mut T as Clone>
error[E0277]: the trait bound `for<'b> <Box<T> as X<'b, Box<T>>>::U: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-5.rs:32:14
--> $DIR/hr-associated-type-bound-param-5.rs:33:14
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this

View File

@ -1,4 +1,5 @@
// run-pass
// ignore-compare-mode-chalk
pub trait DeclaredTrait {
type Type;
}

View File

@ -1,3 +1,4 @@
// ignore-compare-mode-chalk
use std::fmt::Debug;
type Foo = impl Debug; //~ ERROR `impl Trait` in type aliases is unstable

View File

@ -1,5 +1,5 @@
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:3:12
--> $DIR/feature-gate-type_alias_impl_trait.rs:4:12
|
LL | type Foo = impl Debug;
| ^^^^^^^^^^
@ -8,7 +8,7 @@ LL | type Foo = impl Debug;
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:11:16
--> $DIR/feature-gate-type_alias_impl_trait.rs:12:16
|
LL | type Baa = impl Debug;
| ^^^^^^^^^^
@ -17,7 +17,7 @@ LL | type Baa = impl Debug;
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: associated type defaults are unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:22:5
--> $DIR/feature-gate-type_alias_impl_trait.rs:23:5
|
LL | type Assoc = impl Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -26,7 +26,7 @@ LL | type Assoc = impl Debug;
= help: add `#![feature(associated_type_defaults)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:22:18
--> $DIR/feature-gate-type_alias_impl_trait.rs:23:18
|
LL | type Assoc = impl Debug;
| ^^^^^^^^^^
@ -35,7 +35,7 @@ LL | type Assoc = impl Debug;
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:28:24
--> $DIR/feature-gate-type_alias_impl_trait.rs:29:24
|
LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^
@ -44,7 +44,7 @@ LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl D
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:28:37
--> $DIR/feature-gate-type_alias_impl_trait.rs:29:37
|
LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^
@ -53,7 +53,7 @@ LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl D
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:28:49
--> $DIR/feature-gate-type_alias_impl_trait.rs:29:49
|
LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -62,7 +62,7 @@ LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl D
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:28:70
--> $DIR/feature-gate-type_alias_impl_trait.rs:29:70
|
LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^
@ -71,7 +71,7 @@ LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl D
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:39:21
--> $DIR/feature-gate-type_alias_impl_trait.rs:40:21
|
LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug> + Debug);
| ^^^^^^^^^^
@ -80,7 +80,7 @@ LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debu
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:39:34
--> $DIR/feature-gate-type_alias_impl_trait.rs:40:34
|
LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug> + Debug);
| ^^^^^^^^^^
@ -89,7 +89,7 @@ LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debu
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:39:46
--> $DIR/feature-gate-type_alias_impl_trait.rs:40:46
|
LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug> + Debug);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -98,7 +98,7 @@ LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debu
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:39:67
--> $DIR/feature-gate-type_alias_impl_trait.rs:40:67
|
LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug> + Debug);
| ^^^^^^^^^^
@ -107,7 +107,7 @@ LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debu
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/feature-gate-type_alias_impl_trait.rs:22:18
--> $DIR/feature-gate-type_alias_impl_trait.rs:23:18
|
LL | type Assoc = impl Debug;
| ^^^^^^^^^^

View File

@ -1,4 +1,5 @@
// run-pass
// ignore-compare-mode-chalk
#![feature(fn_traits,
step_trait,

View File

@ -1,5 +1,6 @@
// edition:2018
// ignore-tidy-linelength
// ignore-compare-mode-chalk
#![feature(type_alias_impl_trait)]

View File

@ -1,11 +1,11 @@
error[E0277]: the trait bound `impl Future: Copy` is not satisfied
--> $DIR/issue-55872-2.rs:13:14
--> $DIR/issue-55872-2.rs:14:14
|
LL | type E = impl std::marker::Copy;
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future`
error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
--> $DIR/issue-55872-2.rs:15:28
--> $DIR/issue-55872-2.rs:16:28
|
LL | fn foo<T>() -> Self::E {
| ____________________________^

View File

@ -1,4 +1,5 @@
// ignore-tidy-linelength
// ignore-compare-mode-chalk
#![feature(type_alias_impl_trait)]
pub trait Bar {

View File

@ -1,5 +1,5 @@
error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
--> $DIR/issue-55872.rs:13:28
--> $DIR/issue-55872.rs:14:28
|
LL | fn foo<T>() -> Self::E {
| ____________________________^

View File

@ -1,3 +1,5 @@
// ignore-compare-mode-chalk
trait Next {
type Next: Next;
}

View File

@ -1,5 +1,5 @@
error[E0275]: overflow evaluating the requirement `<GetNext<T> as Next>::Next == _`
--> $DIR/issue-23122-1.rs:8:5
--> $DIR/issue-23122-1.rs:10:5
|
LL | type Next = <GetNext<T> as Next>::Next;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,3 +1,4 @@
// ignore-compare-mode-chalk
trait Next {
type Next: Next;
}

View File

@ -1,5 +1,5 @@
error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next: Sized`
--> $DIR/issue-23122-2.rs:8:5
--> $DIR/issue-23122-2.rs:9:5
|
LL | type Next = <GetNext<T::Next> as Next>::Next;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,4 +1,5 @@
// check-pass
// ignore-compare-mode-chalk
#[derive(Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct Array<T> {
f00: [T; 00],

View File

@ -1,4 +1,5 @@
// run-pass
// ignore-compare-mode-chalk
struct Foo<A: Repr>(<A as Repr>::Data);
impl<A> Copy for Foo<A> where <A as Repr>::Data: Copy { }

View File

@ -1,4 +1,5 @@
// check-pass
// ignore-compare-mode-chalk
#![feature(associated_type_defaults)]

View File

@ -1,5 +1,6 @@
// Tests that HRTBs are correctly accepted -- https://github.com/rust-lang/rust/issues/50301
// check-pass
// ignore-compare-mode-chalk
trait Trait
where
for<'a> &'a Self::IntoIter: IntoIterator<Item = u32>,

View File

@ -1,5 +1,5 @@
error: lifetime may not live long enough
--> $DIR/issue-55796.rs:16:9
--> $DIR/issue-55796.rs:18:9
|
LL | pub trait Graph<'a> {
| -- lifetime `'a` defined here
@ -10,7 +10,7 @@ LL | Box::new(self.out_edges(u).map(|e| e.target()))
= help: consider replacing `'a` with `'static`
error: lifetime may not live long enough
--> $DIR/issue-55796.rs:21:9
--> $DIR/issue-55796.rs:23:9
|
LL | pub trait Graph<'a> {
| -- lifetime `'a` defined here

View File

@ -1,3 +1,5 @@
// ignore-compare-mode-chalk
pub trait EdgeTrait<N> {
fn target(&self) -> N;
}

View File

@ -1,22 +1,22 @@
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> $DIR/issue-55796.rs:16:9
--> $DIR/issue-55796.rs:18:9
|
LL | Box::new(self.out_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the trait at 5:17...
--> $DIR/issue-55796.rs:5:17
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the trait at 7:17...
--> $DIR/issue-55796.rs:7:17
|
LL | pub trait Graph<'a> {
| ^^
note: ...so that the type `Map<<Self as Graph<'a>>::EdgesIter, [closure@$DIR/issue-55796.rs:16:40: 16:54]>` will meet its required lifetime bounds
--> $DIR/issue-55796.rs:16:9
note: ...so that the type `Map<<Self as Graph<'a>>::EdgesIter, [closure@$DIR/issue-55796.rs:18:40: 18:54]>` will meet its required lifetime bounds
--> $DIR/issue-55796.rs:18:9
|
LL | Box::new(self.out_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: but, the lifetime must be valid for the static lifetime...
note: ...so that the expression is assignable
--> $DIR/issue-55796.rs:16:9
--> $DIR/issue-55796.rs:18:9
|
LL | Box::new(self.out_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -24,24 +24,24 @@ LL | Box::new(self.out_edges(u).map(|e| e.target()))
found `Box<dyn Iterator<Item = <Self as Graph<'a>>::Node>>`
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> $DIR/issue-55796.rs:21:9
--> $DIR/issue-55796.rs:23:9
|
LL | Box::new(self.in_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the trait at 5:17...
--> $DIR/issue-55796.rs:5:17
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the trait at 7:17...
--> $DIR/issue-55796.rs:7:17
|
LL | pub trait Graph<'a> {
| ^^
note: ...so that the type `Map<<Self as Graph<'a>>::EdgesIter, [closure@$DIR/issue-55796.rs:21:39: 21:53]>` will meet its required lifetime bounds
--> $DIR/issue-55796.rs:21:9
note: ...so that the type `Map<<Self as Graph<'a>>::EdgesIter, [closure@$DIR/issue-55796.rs:23:39: 23:53]>` will meet its required lifetime bounds
--> $DIR/issue-55796.rs:23:9
|
LL | Box::new(self.in_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: but, the lifetime must be valid for the static lifetime...
note: ...so that the expression is assignable
--> $DIR/issue-55796.rs:21:9
--> $DIR/issue-55796.rs:23:9
|
LL | Box::new(self.in_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,6 @@
// build-pass
// ignore-tidy-filelength
// ignore-compare-mode-chalk
#![crate_type = "rlib"]
fn banana(v: &str) -> u32 {

View File

@ -1,6 +1,7 @@
// Regression test for #53789.
//
// check-pass
// ignore-compare-mode-chalk
use std::collections::BTreeMap;
use std::ops::Range;

View File

@ -1,5 +1,6 @@
// Check that we check that default associated types satisfy the required
// bounds on them.
// ignore-compare-mode-chalk
#![feature(specialization)]
//~^ WARNING `specialization` is incomplete

View File

@ -1,5 +1,5 @@
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/deafult-associated-type-bound-1.rs:4:12
--> $DIR/deafult-associated-type-bound-1.rs:5:12
|
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
@ -8,7 +8,7 @@ LL | #![feature(specialization)]
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/deafult-associated-type-bound-1.rs:18:5
--> $DIR/deafult-associated-type-bound-1.rs:19:5
|
LL | type U: Clone;
| ----- required by this bound in `X::U`

View File

@ -1,4 +1,5 @@
// ignore-tidy-linelength
// ignore-compare-mode-chalk
#![feature(type_alias_impl_trait)]
use std::fmt::Debug;

View File

@ -1,5 +1,5 @@
error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
--> $DIR/issue-53598.rs:20:42
--> $DIR/issue-53598.rs:21:42
|
LL | fn foo<T: Debug>(_: T) -> Self::Item {
| __________________________________________^

View File

@ -1,4 +1,5 @@
// ignore-tidy-linelength
// ignore-compare-mode-chalk
#![feature(arbitrary_self_types)]
#![feature(type_alias_impl_trait)]

View File

@ -1,5 +1,5 @@
error: type parameter `impl Deref<Target = Self>` is part of concrete type but not used in parameter list for the `impl Trait` type alias
--> $DIR/issue-57700.rs:16:58
--> $DIR/issue-57700.rs:17:58
|
LL | fn foo(self: impl Deref<Target = Self>) -> Self::Bar {
| __________________________________________________________^

View File

@ -1,3 +1,5 @@
// ignore-compare-mode-chalk
trait Bug {
type Item: Bug;

View File

@ -1,5 +1,5 @@
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/issue-60371.rs:8:17
--> $DIR/issue-60371.rs:10:17
|
LL | type Item = impl Bug;
| ^^^^^^^^
@ -8,7 +8,7 @@ LL | type Item = impl Bug;
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0277]: the trait bound `(): Bug` is not satisfied
--> $DIR/issue-60371.rs:8:17
--> $DIR/issue-60371.rs:10:17
|
LL | type Item = impl Bug;
| ^^^^^^^^ the trait `Bug` is not implemented for `()`
@ -17,7 +17,7 @@ LL | type Item = impl Bug;
<&() as Bug>
error: could not find defining uses
--> $DIR/issue-60371.rs:8:17
--> $DIR/issue-60371.rs:10:17
|
LL | type Item = impl Bug;
| ^^^^^^^^