Open ahayzen-kdab opened 1 year ago
There are some new clippy lints that could be used to automate this conversion.
https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_alloc https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core https://rust-lang.github.io/rust-clippy/master/index.html#alloc_instead_of_core
Note that unlike core
, the alloc
crate isn't added by default in Rust.
We'd need to use extern crate alloc;
to get it into scope, so I think using core
and std
is good enough for now.
Also, do we care if cxx-qt-macro
is no_std
? As that only runs at compile-time :thinking:
Are there any use-cases where we'd want to compile on a platform that doesn't support std
?
Probably not...
Remove uses of
std::
in our generated Rust code and usecore
/alloc
etc (and where possible CXX-Qt's code itself?).This would bring us closer to being able to use
no_std
, note that CXX is alreadyno_std
https://github.com/dtolnay/cxx/blob/c7060d40361c4d955fc64adf35f67b28b5c75299/src/lib.rs#L366std::
to core/alloc as possible#![no_std]
(it might not be possible for all our crates?)