fix: rename generator to coroutine also in dependencies
Follow the rename in nightly (see https://blog.rust-lang.org/inside-rust/2023/10/23/coroutines.html)
This commit is contained in:
parent
f937673ce2
commit
fe35447617
16
Cargo.lock
generated
16
Cargo.lock
generated
@ -160,9 +160,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "chalk-derive"
|
||||
version = "0.95.0"
|
||||
version = "0.96.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "329427f28cd2bddaacd47c4dcd3d7082d315c61fb164394c690fe98c1b6ee9d3"
|
||||
checksum = "5676cea088c32290fe65c82895be9d06dd21e0fa49bb97ca840529e9417ab71a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -172,9 +172,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "chalk-ir"
|
||||
version = "0.95.0"
|
||||
version = "0.96.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9e1e1659238bd598d0f7dbc5034cf1ff46010a3d6827704c9ed443c8359cb484"
|
||||
checksum = "ff550c2cdd63ff74394214dce03d06386928a641c0f08837535f04af573a966d"
|
||||
dependencies = [
|
||||
"bitflags 2.4.1",
|
||||
"chalk-derive",
|
||||
@ -183,9 +183,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "chalk-recursive"
|
||||
version = "0.95.0"
|
||||
version = "0.96.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b3e0bff0ba1bed11407384fcec0353aeb6888901e63cb47d04505ec47adad847"
|
||||
checksum = "4c4559e5c9b200240453b07d893f9c3c74413b53b0d33cbe272c68b0b77aa1c3"
|
||||
dependencies = [
|
||||
"chalk-derive",
|
||||
"chalk-ir",
|
||||
@ -196,9 +196,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "chalk-solve"
|
||||
version = "0.95.0"
|
||||
version = "0.96.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eb9c46d501cf83732a91056c0c846ae7a16d6b3c67a6a6bb5e9cc0a2e91563b6"
|
||||
checksum = "0882e68ce9eb5a0a2413806538494d19df6ee520ab17d1faf489e952f32e98b8"
|
||||
dependencies = [
|
||||
"chalk-derive",
|
||||
"chalk-ir",
|
||||
|
@ -23,10 +23,10 @@ oorandom = "11.1.3"
|
||||
tracing.workspace = true
|
||||
rustc-hash.workspace = true
|
||||
scoped-tls = "1.0.0"
|
||||
chalk-solve = { version = "0.95.0", default-features = false }
|
||||
chalk-ir = "0.95.0"
|
||||
chalk-recursive = { version = "0.95.0", default-features = false }
|
||||
chalk-derive = "0.95.0"
|
||||
chalk-solve = { version = "0.96.0", default-features = false }
|
||||
chalk-ir = "0.96.0"
|
||||
chalk-recursive = { version = "0.96.0", default-features = false }
|
||||
chalk-derive = "0.96.0"
|
||||
la-arena.workspace = true
|
||||
once_cell = "1.17.0"
|
||||
triomphe.workspace = true
|
||||
|
@ -424,10 +424,10 @@ fn opaque_type_name(&self, opaque_ty_id: chalk_ir::OpaqueTyId<Interner>) -> Stri
|
||||
fn fn_def_name(&self, fn_def_id: chalk_ir::FnDefId<Interner>) -> String {
|
||||
format!("fn_{}", fn_def_id.0)
|
||||
}
|
||||
fn generator_datum(
|
||||
fn coroutine_datum(
|
||||
&self,
|
||||
id: chalk_ir::GeneratorId<Interner>,
|
||||
) -> Arc<chalk_solve::rust_ir::GeneratorDatum<Interner>> {
|
||||
id: chalk_ir::CoroutineId<Interner>,
|
||||
) -> Arc<chalk_solve::rust_ir::CoroutineDatum<Interner>> {
|
||||
let (parent, expr) = self.db.lookup_intern_coroutine(id.into());
|
||||
|
||||
// We fill substitution with unknown type, because we only need to know whether the generic
|
||||
@ -435,7 +435,7 @@ fn generator_datum(
|
||||
// `resume_type`, `yield_type`, and `return_type` of the coroutine in question.
|
||||
let subst = TyBuilder::subst_for_coroutine(self.db, parent).fill_with_unknown().build();
|
||||
|
||||
let input_output = rust_ir::GeneratorInputOutputDatum {
|
||||
let input_output = rust_ir::CoroutineInputOutputDatum {
|
||||
resume_type: TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0))
|
||||
.intern(Interner),
|
||||
yield_type: TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 1))
|
||||
@ -463,25 +463,25 @@ fn generator_datum(
|
||||
Movability::Movable => rust_ir::Movability::Movable,
|
||||
};
|
||||
|
||||
Arc::new(rust_ir::GeneratorDatum { movability, input_output })
|
||||
Arc::new(rust_ir::CoroutineDatum { movability, input_output })
|
||||
}
|
||||
fn generator_witness_datum(
|
||||
fn coroutine_witness_datum(
|
||||
&self,
|
||||
id: chalk_ir::GeneratorId<Interner>,
|
||||
) -> Arc<chalk_solve::rust_ir::GeneratorWitnessDatum<Interner>> {
|
||||
id: chalk_ir::CoroutineId<Interner>,
|
||||
) -> Arc<chalk_solve::rust_ir::CoroutineWitnessDatum<Interner>> {
|
||||
// FIXME: calculate inner types
|
||||
let inner_types =
|
||||
rust_ir::GeneratorWitnessExistential { types: wrap_empty_binders(vec![]) };
|
||||
rust_ir::CoroutineWitnessExistential { types: wrap_empty_binders(vec![]) };
|
||||
|
||||
let (parent, _) = self.db.lookup_intern_coroutine(id.into());
|
||||
// See the comment in `generator_datum()` for unknown types.
|
||||
// See the comment in `coroutine_datum()` for unknown types.
|
||||
let subst = TyBuilder::subst_for_coroutine(self.db, parent).fill_with_unknown().build();
|
||||
let it = subst
|
||||
.iter(Interner)
|
||||
.map(|it| it.constant(Interner).map(|c| c.data(Interner).ty.clone()));
|
||||
let inner_types = crate::make_type_and_const_binders(it, inner_types);
|
||||
|
||||
Arc::new(rust_ir::GeneratorWitnessDatum { inner_types })
|
||||
Arc::new(rust_ir::CoroutineWitnessDatum { inner_types })
|
||||
}
|
||||
|
||||
fn unification_database(&self) -> &dyn chalk_ir::UnificationDatabase<Interner> {
|
||||
@ -617,7 +617,7 @@ fn well_known_trait_from_lang_item(item: LangItem) -> Option<WellKnownTrait> {
|
||||
LangItem::Fn => WellKnownTrait::Fn,
|
||||
LangItem::FnMut => WellKnownTrait::FnMut,
|
||||
LangItem::FnOnce => WellKnownTrait::FnOnce,
|
||||
LangItem::Coroutine => WellKnownTrait::Generator,
|
||||
LangItem::Coroutine => WellKnownTrait::Coroutine,
|
||||
LangItem::Sized => WellKnownTrait::Sized,
|
||||
LangItem::Unpin => WellKnownTrait::Unpin,
|
||||
LangItem::Unsize => WellKnownTrait::Unsize,
|
||||
@ -639,7 +639,7 @@ fn lang_item_from_well_known_trait(trait_: WellKnownTrait) -> LangItem {
|
||||
WellKnownTrait::Fn => LangItem::Fn,
|
||||
WellKnownTrait::FnMut => LangItem::FnMut,
|
||||
WellKnownTrait::FnOnce => LangItem::FnOnce,
|
||||
WellKnownTrait::Generator => LangItem::Coroutine,
|
||||
WellKnownTrait::Coroutine => LangItem::Coroutine,
|
||||
WellKnownTrait::Sized => LangItem::Sized,
|
||||
WellKnownTrait::Tuple => LangItem::Tuple,
|
||||
WellKnownTrait::Unpin => LangItem::Unpin,
|
||||
|
@ -659,8 +659,8 @@ fn render_const_scalar(
|
||||
}
|
||||
TyKind::Never => f.write_str("!"),
|
||||
TyKind::Closure(_, _) => f.write_str("<closure>"),
|
||||
TyKind::Generator(_, _) => f.write_str("<coroutine>"),
|
||||
TyKind::GeneratorWitness(_, _) => f.write_str("<coroutine-witness>"),
|
||||
TyKind::Coroutine(_, _) => f.write_str("<coroutine>"),
|
||||
TyKind::CoroutineWitness(_, _) => f.write_str("<coroutine-witness>"),
|
||||
// The below arms are unreachable, since const eval will bail out before here.
|
||||
TyKind::Foreign(_) => f.write_str("<extern-type>"),
|
||||
TyKind::Error
|
||||
@ -1205,7 +1205,7 @@ fn hir_fmt(
|
||||
write!(f, "{{unknown}}")?;
|
||||
}
|
||||
TyKind::InferenceVar(..) => write!(f, "_")?,
|
||||
TyKind::Generator(_, subst) => {
|
||||
TyKind::Coroutine(_, subst) => {
|
||||
if f.display_target.is_source_code() {
|
||||
return Err(HirDisplayError::DisplaySourceCodeError(
|
||||
DisplaySourceCodeError::Coroutine,
|
||||
@ -1232,7 +1232,7 @@ fn hir_fmt(
|
||||
write!(f, "{{coroutine}}")?;
|
||||
}
|
||||
}
|
||||
TyKind::GeneratorWitness(..) => write!(f, "{{coroutine witness}}")?,
|
||||
TyKind::CoroutineWitness(..) => write!(f, "{{coroutine witness}}")?,
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ pub(super) fn deduce_closure_type_from_expectations(
|
||||
let _ = self.coerce(Some(closure_expr), closure_ty, &expected_ty);
|
||||
|
||||
// Coroutines are not Fn* so return early.
|
||||
if matches!(closure_ty.kind(Interner), TyKind::Generator(..)) {
|
||||
if matches!(closure_ty.kind(Interner), TyKind::Coroutine(..)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,7 @@ fn infer_expr_inner(&mut self, tgt_expr: ExprId, expected: &Expectation) -> Ty {
|
||||
.build();
|
||||
|
||||
let coroutine_id = self.db.intern_coroutine((self.owner, tgt_expr)).into();
|
||||
let coroutine_ty = TyKind::Generator(coroutine_id, subst).intern(Interner);
|
||||
let coroutine_ty = TyKind::Coroutine(coroutine_id, subst).intern(Interner);
|
||||
|
||||
(None, coroutine_ty, Some((resume_ty, yield_ty)))
|
||||
}
|
||||
|
@ -408,7 +408,7 @@ pub fn layout_of_ty_query(
|
||||
cx.univariant(dl, &fields, &ReprOptions::default(), StructKind::AlwaysSized)
|
||||
.ok_or(LayoutError::Unknown)?
|
||||
}
|
||||
TyKind::Generator(_, _) | TyKind::GeneratorWitness(_, _) => {
|
||||
TyKind::Coroutine(_, _) | TyKind::CoroutineWitness(_, _) => {
|
||||
return Err(LayoutError::NotImplemented)
|
||||
}
|
||||
TyKind::Error => return Err(LayoutError::HasErrorType),
|
||||
|
@ -103,15 +103,15 @@ fn from(id: crate::db::InternedClosureId) -> Self {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<chalk_ir::GeneratorId<Interner>> for crate::db::InternedCoroutineId {
|
||||
fn from(id: chalk_ir::GeneratorId<Interner>) -> Self {
|
||||
impl From<chalk_ir::CoroutineId<Interner>> for crate::db::InternedCoroutineId {
|
||||
fn from(id: chalk_ir::CoroutineId<Interner>) -> Self {
|
||||
Self::from_intern_id(id.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<crate::db::InternedCoroutineId> for chalk_ir::GeneratorId<Interner> {
|
||||
impl From<crate::db::InternedCoroutineId> for chalk_ir::CoroutineId<Interner> {
|
||||
fn from(id: crate::db::InternedCoroutineId) -> Self {
|
||||
chalk_ir::GeneratorId(id.as_intern_id())
|
||||
chalk_ir::CoroutineId(id.as_intern_id())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,8 +96,8 @@ pub fn for_trait_impl(ty: &Ty) -> Option<TyFingerprint> {
|
||||
| TyKind::OpaqueType(_, _)
|
||||
| TyKind::FnDef(_, _)
|
||||
| TyKind::Closure(_, _)
|
||||
| TyKind::Generator(..)
|
||||
| TyKind::GeneratorWitness(..) => TyFingerprint::Unnameable,
|
||||
| TyKind::Coroutine(..)
|
||||
| TyKind::CoroutineWitness(..) => TyFingerprint::Unnameable,
|
||||
TyKind::Function(fn_ptr) => {
|
||||
TyFingerprint::Function(fn_ptr.substitution.0.len(Interner) as u32)
|
||||
}
|
||||
|
@ -2147,8 +2147,8 @@ fn patch_addresses<'vtable>(
|
||||
| TyKind::Str
|
||||
| TyKind::Never
|
||||
| TyKind::Closure(_, _)
|
||||
| TyKind::Generator(_, _)
|
||||
| TyKind::GeneratorWitness(_, _)
|
||||
| TyKind::Coroutine(_, _)
|
||||
| TyKind::CoroutineWitness(_, _)
|
||||
| TyKind::Foreign(_)
|
||||
| TyKind::Error
|
||||
| TyKind::Placeholder(_)
|
||||
@ -2635,8 +2635,8 @@ fn run_drop_glue_deep(
|
||||
| TyKind::Str
|
||||
| TyKind::Never
|
||||
| TyKind::Closure(_, _)
|
||||
| TyKind::Generator(_, _)
|
||||
| TyKind::GeneratorWitness(_, _)
|
||||
| TyKind::Coroutine(_, _)
|
||||
| TyKind::CoroutineWitness(_, _)
|
||||
| TyKind::Foreign(_)
|
||||
| TyKind::Error
|
||||
| TyKind::Placeholder(_)
|
||||
|
@ -4103,8 +4103,8 @@ fn go(ty: &Ty) -> bool {
|
||||
| TyKind::Function(_)
|
||||
| TyKind::Alias(_)
|
||||
| TyKind::Foreign(_)
|
||||
| TyKind::Generator(..)
|
||||
| TyKind::GeneratorWitness(..) => false,
|
||||
| TyKind::Coroutine(..)
|
||||
| TyKind::CoroutineWitness(..) => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user