dtolnay / inventory

Typed distributed plugin registration
Apache License 2.0
948 stars 43 forks source link

Require inventory element type to be const constructed #43

Closed dtolnay closed 2 years ago

dtolnay commented 2 years ago

The Rust standard library is not yet properly initialized during life before main, so sticking things like the following in there is problematic and must not be allowed.

inventory::submit!({
    std::println!("???");
    std::thread::spawn(...);
    Thing {}
});