Add support for Rust 2018 edition projects.
Summary:
After enabling 2018 edition on my cargo project, the use statements
generated in the interface module no longer resolve.
Prefixing module paths with crate:: brings things back into alignment.
Unsure if this is how you'd like to approach the issue, but I'm happy to revise the patch based on your feedback.
Test Plan:
STEPS TO REPRODUCE
- create a new cargo project based on the template
- update your toolchain to >= 1.31
- add edition = "2018" to the package section of your Cargo.toml
- run cargo build
OBSERVED RESULT
Build fails since generated code tries to import crate-local modules as if they are top level crates.
EXPECTED RESULT
Build completes successfully.
Reviewers: vandenoever
Differential Revision: https://phabricator.kde.org/D17447