Bug 401913

Summary: Add support for Rust 2018 edition projects.
Product: [Unmaintained] rust-qt-binding-generator Reporter: Owen Nelson <onelson>
Component: generalAssignee: Jos van den Oever <jos>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Owen Nelson 2018-12-09 05:21:25 UTC
SUMMARY

Currently, use statements in the generated modules are not compatible with Rust 2018 edition.

I worked up a patch for this as a pull request (which was... closed immediately).

The pull request I prepared earlier:
https://github.com/KDE/rust-qt-binding-generator/pull/1

and the associated patch:
https://patch-diff.githubusercontent.com/raw/KDE/rust-qt-binding-generator/pull/1.patch

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.

ADDITIONAL INFORMATION

Just as an aside, I'm wondering if there isn't another way to handle questions, comments, feedback, or patches for this project. Feels a little heavy to report in this fashion just to get some discussion going, but I understand if this is just the way it has to be.

Cheers,
Owen
Comment 1 Owen Nelson 2018-12-09 06:11:01 UTC
Sorry, I'm catching up trying to navigate the KDE process. I signed up at identity.kde.org and got a diff up on phabricator now:

https://phabricator.kde.org/D17447
Comment 2 Jos van den Oever 2018-12-09 22:37:22 UTC
The solution by Owen Nelson was committed.