Rollup merge of #88963 - fee1-dead:const-iterator, r=oli-obk

Coerce const FnDefs to implement const Fn traits

You can now pass a FnDef to a function expecting `F` where `F: ~const FnTrait`.

r? ``@oli-obk``

``@rustbot`` label T-compiler F-const_trait_impl
This commit is contained in:
Manish Goregaokar 2021-10-01 14:46:48 -07:00 committed by GitHub
commit 743e842afb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 79 additions and 37 deletions

View file

@ -92,7 +92,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
Ok(ImplSource::Generator(vtable_generator))
}
FnPointerCandidate => {
FnPointerCandidate { .. } => {
let data = self.confirm_fn_pointer_candidate(obligation)?;
Ok(ImplSource::FnPointer(data))
}