Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
vfs = { path = "./crates/vfs", version = "0.0.0" }
edition = { path = "./crates/edition", version = "0.0.0" }

ra-ap-rustc_lexer = { version = "0.129", default-features = false }
ra-ap-rustc_parse_format = { version = "0.129", default-features = false }
ra-ap-rustc_index = { version = "0.129", default-features = false }
ra-ap-rustc_abi = { version = "0.129", default-features = false }
ra-ap-rustc_pattern_analysis = { version = "0.129", default-features = false }
ra-ap-rustc_ast_ir = { version = "0.129", default-features = false }
ra-ap-rustc_type_ir = { version = "0.129", default-features = false }
ra-ap-rustc_next_trait_solver = { version = "0.129", default-features = false }
ra-ap-rustc_lexer = { version = "0.130", default-features = false }
ra-ap-rustc_parse_format = { version = "0.130", default-features = false }
ra-ap-rustc_index = { version = "0.130", default-features = false }
ra-ap-rustc_abi = { version = "0.130", default-features = false }
ra-ap-rustc_pattern_analysis = { version = "0.130", default-features = false }
ra-ap-rustc_ast_ir = { version = "0.130", default-features = false }
ra-ap-rustc_type_ir = { version = "0.130", default-features = false }
ra-ap-rustc_next_trait_solver = { version = "0.130", default-features = false }

# local crates that aren't published to crates.io. These should not have versions.

Expand Down
6 changes: 3 additions & 3 deletions crates/hir-ty/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ fn render_const_scalar_inner(
}
f.write_str("]")
}
TyKind::Dynamic(_, _, _) => {
TyKind::Dynamic(_, _) => {
let addr = usize::from_le_bytes(b[0..b.len() / 2].try_into().unwrap());
let ty_id = usize::from_le_bytes(b[b.len() / 2..].try_into().unwrap());
let Ok(t) = memory_map.vtable_ty(ty_id) else {
Expand Down Expand Up @@ -1064,7 +1064,7 @@ fn render_const_scalar_inner(
| TyKind::Bound(_, _)
| TyKind::Infer(_) => f.write_str("<placeholder-or-unknown-type>"),
// The below arms are unreachable, since we handled them in ref case.
TyKind::Slice(_) | TyKind::Str | TyKind::Dynamic(_, _, _) => f.write_str("<unsized-value>"),
TyKind::Slice(_) | TyKind::Str | TyKind::Dynamic(_, _) => f.write_str("<unsized-value>"),
}
}

Expand Down Expand Up @@ -1213,7 +1213,7 @@ impl<'db> HirDisplay for crate::next_solver::Ty<'db> {
})
};
let (preds_to_print, has_impl_fn_pred) = match t.kind() {
TyKind::Dynamic(bounds, region, _) => {
TyKind::Dynamic(bounds, region) => {
let render_lifetime = f.render_region(region);
(
bounds.len() + render_lifetime as usize,
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/infer/coerce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ impl<'a, 'b, 'db> Coerce<'a, 'b, 'db> {
| TyKind::Slice(_)
| TyKind::FnDef(_, _)
| TyKind::FnPtr(_, _)
| TyKind::Dynamic(_, _, _)
| TyKind::Dynamic(_, _)
| TyKind::Closure(_, _)
| TyKind::CoroutineClosure(_, _)
| TyKind::Coroutine(_, _)
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/lower_nextsolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ impl<'db, 'a> TyLoweringContext<'db, 'a> {
},
None => Region::new_static(self.interner),
};
Ty::new_dynamic(self.interner, bounds, region, rustc_type_ir::DynKind::Dyn)
Ty::new_dynamic(self.interner, bounds, region)
} else {
// FIXME: report error
// (additional non-auto traits, associated type rebound, or no resolved trait)
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/method_resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl TyFingerprint {
rustc_ast_ir::Mutability::Not => TyFingerprint::RawPtr(Mutability::Not),
},
TyKind::Foreign(def) => TyFingerprint::ForeignType(crate::to_foreign_def_id(def.0)),
TyKind::Dynamic(bounds, _, _) => {
TyKind::Dynamic(bounds, _) => {
let trait_ref = bounds
.as_slice()
.iter()
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/mir/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2446,7 +2446,7 @@ impl<'db> Evaluator<'db> {
| TyKind::Foreign(_)
| TyKind::Error(_)
| TyKind::Placeholder(_)
| TyKind::Dynamic(_, _, _)
| TyKind::Dynamic(_, _)
| TyKind::Alias(_, _)
| TyKind::Bound(_, _)
| TyKind::Infer(_)
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/next_solver/fulfill/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ mod wf {
}
TyKind::UnsafeBinder(ty) => {}

TyKind::Dynamic(data, r, _) => {
TyKind::Dynamic(data, r) => {
// WfObject
//
// Here, we defer WF checking due to higher-ranked
Expand Down
6 changes: 2 additions & 4 deletions crates/hir-ty/src/next_solver/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,7 @@ impl<'db> ChalkToNextSolver<'db, Ty<'db>> for chalk_ir::Ty<Interner> {
}),
);
let region = dyn_ty.lifetime.to_nextsolver(interner);
let kind = rustc_type_ir::DynKind::Dyn;
rustc_type_ir::TyKind::Dynamic(bounds, region, kind)
rustc_type_ir::TyKind::Dynamic(bounds, region)
}
chalk_ir::TyKind::Alias(alias_ty) => match alias_ty {
chalk_ir::AliasTy::Projection(projection_ty) => {
Expand Down Expand Up @@ -1445,8 +1444,7 @@ pub(crate) fn convert_ty_for_result<'db>(interner: DbInterner<'db>, ty: Ty<'db>)
TyKind::Function(fnptr)
}

rustc_type_ir::TyKind::Dynamic(preds, region, dyn_kind) => {
assert!(matches!(dyn_kind, rustc_type_ir::DynKind::Dyn));
rustc_type_ir::TyKind::Dynamic(preds, region) => {
let self_ty = Ty::new_bound(
interner,
DebruijnIndex::from_u32(1),
Expand Down
23 changes: 9 additions & 14 deletions crates/hir-ty/src/next_solver/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl<'db> Ty<'db> {
| TyKind::Never
| TyKind::Error(_) => true,

TyKind::Str | TyKind::Slice(_) | TyKind::Dynamic(_, _, _) => match sizedness {
TyKind::Str | TyKind::Slice(_) | TyKind::Dynamic(_, _) => match sizedness {
SizedTraitKind::Sized => false,
SizedTraitKind::MetaSized => true,
},
Expand Down Expand Up @@ -421,7 +421,7 @@ impl<'db> TypeSuperVisitable<DbInterner<'db>> for Ty<'db> {
}
TyKind::Slice(typ) => typ.visit_with(visitor),
TyKind::Adt(_, args) => args.visit_with(visitor),
TyKind::Dynamic(ref trait_ty, ref reg, _) => {
TyKind::Dynamic(ref trait_ty, ref reg) => {
try_visit!(trait_ty.visit_with(visitor));
reg.visit_with(visitor)
}
Expand Down Expand Up @@ -486,11 +486,9 @@ impl<'db> TypeSuperFoldable<DbInterner<'db>> for Ty<'db> {
}
TyKind::Slice(typ) => TyKind::Slice(typ.try_fold_with(folder)?),
TyKind::Adt(tid, args) => TyKind::Adt(tid, args.try_fold_with(folder)?),
TyKind::Dynamic(trait_ty, region, representation) => TyKind::Dynamic(
trait_ty.try_fold_with(folder)?,
region.try_fold_with(folder)?,
representation,
),
TyKind::Dynamic(trait_ty, region) => {
TyKind::Dynamic(trait_ty.try_fold_with(folder)?, region.try_fold_with(folder)?)
}
TyKind::Tuple(ts) => TyKind::Tuple(ts.try_fold_with(folder)?),
TyKind::FnDef(def_id, args) => TyKind::FnDef(def_id, args.try_fold_with(folder)?),
TyKind::FnPtr(sig_tys, hdr) => TyKind::FnPtr(sig_tys.try_fold_with(folder)?, hdr),
Expand Down Expand Up @@ -537,11 +535,9 @@ impl<'db> TypeSuperFoldable<DbInterner<'db>> for Ty<'db> {
TyKind::Array(typ, sz) => TyKind::Array(typ.fold_with(folder), sz.fold_with(folder)),
TyKind::Slice(typ) => TyKind::Slice(typ.fold_with(folder)),
TyKind::Adt(tid, args) => TyKind::Adt(tid, args.fold_with(folder)),
TyKind::Dynamic(trait_ty, region, representation) => TyKind::Dynamic(
trait_ty.fold_with(folder),
region.fold_with(folder),
representation,
),
TyKind::Dynamic(trait_ty, region) => {
TyKind::Dynamic(trait_ty.fold_with(folder), region.fold_with(folder))
}
TyKind::Tuple(ts) => TyKind::Tuple(ts.fold_with(folder)),
TyKind::FnDef(def_id, args) => TyKind::FnDef(def_id, args.fold_with(folder)),
TyKind::FnPtr(sig_tys, hdr) => TyKind::FnPtr(sig_tys.fold_with(folder), hdr),
Expand Down Expand Up @@ -676,9 +672,8 @@ impl<'db> rustc_type_ir::inherent::Ty<DbInterner<'db>> for Ty<'db> {
interner: DbInterner<'db>,
preds: <DbInterner<'db> as rustc_type_ir::Interner>::BoundExistentialPredicates,
region: <DbInterner<'db> as rustc_type_ir::Interner>::Region,
kind: rustc_type_ir::DynKind,
) -> Self {
Ty::new(interner, TyKind::Dynamic(preds, region, kind))
Ty::new(interner, TyKind::Dynamic(preds, region))
}

fn new_coroutine(
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/next_solver/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ pub fn sizedness_constraint_for_ty<'db>(
| CoroutineWitness(..) | Never => None,

// these are never sized
Str | Slice(..) | Dynamic(_, _, rustc_type_ir::DynKind::Dyn) => match sizedness {
Str | Slice(..) | Dynamic(_, _) => match sizedness {
// Never `Sized`
SizedTraitKind::Sized => Some(ty),
// Always `MetaSized`
Expand Down
Loading