1
Fork 0

Rollup merge of #106917 - compiler-errors:const-closure-foreign, r=tmiasko

Encode const mir for closures if they're const

Fixes #106913
This commit is contained in:
Michael Goulet 2023-01-18 18:00:29 -05:00 committed by GitHub
commit a637e2a950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 11 deletions

View file

@ -0,0 +1,8 @@
#![crate_type = "lib"]
#![feature(const_closures, const_trait_impl)]
#![allow(incomplete_features)]
pub const fn test() {
let cl = const || {};
cl();
}

View file

@ -0,0 +1,8 @@
// aux-build:closure-in-foreign-crate.rs
// build-pass
extern crate closure_in_foreign_crate;
const _: () = closure_in_foreign_crate::test();
fn main() {}