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

Bitflags pollute error message with its version of ops::FnOnce #46619

Closed
EPashkin opened this issue Dec 10, 2017 · 2 comments
Closed

Bitflags pollute error message with its version of ops::FnOnce #46619

EPashkin opened this issue Dec 10, 2017 · 2 comments

Comments

@EPashkin
Copy link
Contributor

When I run this code on playground

extern crate bitflags;

fn foo<F: FnOnce() + Send + 'static>(f: F) -> Box<FnOnce() + Send + 'static> {
    Box::new(f)
}

fn main() {
    let f = foo(|| println!("meh"));
    f();
}

I see expected result only on stable

error[E0161]: cannot move a value of type std::ops::FnOnce() + std::marker::Send: the size of std::ops::FnOnce() + std::marker::Send cannot be statically determined
 --> src/main.rs:9:5
  |
9 |     f();
  |     ^

On beta and nighlty I see

error[E0161]: cannot move a value of type bitflags::<unnamed>::ops::FnOnce() + bitflags::<unnamed>::marker::Send: the size of bitflags::<unnamed>::ops::FnOnce() + bitflags::<unnamed>::marker::Send cannot be statically determined
 --> src/main.rs:9:5
  |
9 |     f();
  |     ^

This bug repeated on my local machine on both stable and nightly:
rustc 1.22.1 (05e2e1c 2017-11-22)
binary: rustc
commit-hash: 05e2e1c
commit-date: 2017-11-22
host: x86_64-pc-windows-gnu
release: 1.22.1
LLVM version: 4.0

rustc 1.24.0-nightly (0a2e9ad 2017-11-29)
binary: rustc
commit-hash: 0a2e9ad
commit-date: 2017-11-29
host: x86_64-pc-windows-gnu
release: 1.24.0-nightly
LLVM version: 4.0

@sinkuu
Copy link
Contributor

sinkuu commented Dec 10, 2017

#46112?

@EPashkin
Copy link
Contributor Author

Oh sorry, only difference that it also broken on 1.22.1

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