Add support for Rust 2018 edition projects.

Authored by onelson on Dec 9 2018, 10:30 PM.

Description

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

  1. create a new cargo project based on the template
  2. update your toolchain to >= 1.31
  3. add edition = "2018" to the package section of your Cargo.toml
  4. 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

Details

Committed
vandenoeverDec 9 2018, 10:34 PM
Differential Revision
D17447: Add support for Rust 2018 edition projects.
Parents
R881:4acf7e3176c7: Resolve resource path relative to qrc path
Branches
Unknown
Tags
Unknown