Stream: t-compiler

Topic: compile error after migration to 2018


Santiago Pastorino (Feb 11 2019 at 19:29, on Zulip):
error[E0520]: `super_fold_with` specializes an item from a parent `impl`, but that item is not marked `default`
    --> src/librustc/macros.rs:225:17
     |
225  | /                 fn super_fold_with<'gcx: $tcx, F: $crate::ty::fold::TypeFolder<'gcx, $tcx>>(
226  | |                     &self,
227  | |                     _: &mut F
228  | |                 ) -> $ty {
229  | |                     Clone::clone(self)
230  | |                 }
     | |_________________^ cannot specialize default item `super_fold_with`
     |
    ::: src/librustc/mir/mod.rs:2696:1
     |
2696 |   CloneTypeFoldableAndLiftImpls! { ProjectionKind<'tcx>, }
     |   -------------------------------------------------------- in this macro invocation
...
3529 | / impl<'tcx, V, T> TypeFoldable<'tcx> for ProjectionElem<'tcx, V, T>
3530 | | where
3531 | |     V: TypeFoldable<'tcx>,
3532 | |     T: TypeFoldable<'tcx>,
...    |
3551 | |     }
3552 | | }
     | |_- parent `impl` is here
     |
     = note: to specialize, `super_fold_with` in the parent `impl` must be marked `default`
Santiago Pastorino (Feb 11 2019 at 19:30, on Zulip):

getting this after migration in one of my PRs

Santiago Pastorino (Feb 11 2019 at 19:30, on Zulip):

not sure what needs to be marked as default

Santiago Pastorino (Feb 11 2019 at 19:32, on Zulip):

oh got it :)

Matthew Jasper (Feb 11 2019 at 19:32, on Zulip):
2696 |   CloneTypeFoldableAndLiftImpls! { ProjectionKind<'tcx>, }
     |   -------------------------------------------------------- in this macro invocation

This should just be removed

Santiago Pastorino (Feb 11 2019 at 20:01, on Zulip):

@Matthew Jasper ?

Santiago Pastorino (Feb 11 2019 at 20:02, on Zulip):

I've fixed the issue but was just by adding a default before the appropriate functions

Matthew Jasper (Feb 11 2019 at 20:30, on Zulip):

That will fix it, but the macro can just be removed, there's no need for specialization here.

Santiago Pastorino (Feb 11 2019 at 20:33, on Zulip):

:+1:, yeah, I wasn't paying that much attention to the code just fixing something that I didn't write and was failing because of the upgrade

Santiago Pastorino (Feb 11 2019 at 20:33, on Zulip):

but yeah, makes sense

Last update: Nov 16 2019 at 01:35UTC