Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.2.1 闭包的基本用法 相同写法的空闭包可以放在vec中 #326

Open
kingeasternsun opened this issue Oct 18, 2021 · 1 comment
Milestone

Comments

@kingeasternsun
Copy link

kingeasternsun commented Oct 18, 2021

页码与行数

  • 微信读书第580页 代码清单6-23

文本或排版错误

暂无


代码错误

代码清单6-23

fn main() {
    let c1 = ||{};
    let c2 = ||{};
    let v = [c1,c2];
    for f in v{
        f();
    }
}

这里不会报错,对应playground https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a8c70304c489386598b33b017cbc4913

image

Rust版本

$ rustc -V
rustc 1.57.0-nightly (8f8092cc3 2021-09-28)

错误信息

@kingeasternsun kingeasternsun changed the title 6.2.1 闭包的基本用法 6.2.1 闭包的基本用法 相同写法的空闭包可以放在vec中 Oct 18, 2021
@ZhangHanDong ZhangHanDong added this to the 第二版 milestone Oct 18, 2021
@ZhangHanDong
Copy link
Owner

@kingeasternsun 感谢反馈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants