Movability doesn't need to be a query anymore
This commit is contained in:
parent
15ccf2e7bd
commit
e24da8ea19
21 changed files with 29 additions and 56 deletions
|
@ -193,7 +193,7 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>(
|
|||
|
||||
ty::Closure(_, args) => Ok(vec![args.as_closure().tupled_upvars_ty()]),
|
||||
|
||||
ty::Coroutine(def_id, args) => match ecx.tcx().movability(def_id) {
|
||||
ty::Coroutine(def_id, args) => match ecx.tcx().coroutine_movability(def_id) {
|
||||
Movability::Static => Err(NoSolution),
|
||||
Movability::Movable => {
|
||||
if ecx.tcx().features().coroutine_clone {
|
||||
|
|
|
@ -930,7 +930,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
|
|||
ty::Coroutine(def_id, _)
|
||||
if Some(goal.predicate.def_id()) == self.tcx().lang_items().unpin_trait() =>
|
||||
{
|
||||
match self.tcx().movability(def_id) {
|
||||
match self.tcx().coroutine_movability(def_id) {
|
||||
Movability::Static => Some(Err(NoSolution)),
|
||||
Movability::Movable => {
|
||||
Some(self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
|
||||
|
|
|
@ -567,7 +567,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
ty::Coroutine(coroutine_def_id, _)
|
||||
if self.tcx().lang_items().unpin_trait() == Some(def_id) =>
|
||||
{
|
||||
match self.tcx().movability(coroutine_def_id) {
|
||||
match self.tcx().coroutine_movability(coroutine_def_id) {
|
||||
hir::Movability::Static => {
|
||||
// Immovable coroutines are never `Unpin`, so
|
||||
// suppress the normal auto-impl candidate for it.
|
||||
|
|
|
@ -2185,7 +2185,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
|
|||
}
|
||||
|
||||
ty::Coroutine(coroutine_def_id, args) => {
|
||||
match self.tcx().movability(coroutine_def_id) {
|
||||
match self.tcx().coroutine_movability(coroutine_def_id) {
|
||||
hir::Movability::Static => None,
|
||||
hir::Movability::Movable => {
|
||||
if self.tcx().features().coroutine_clone {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue