Commit Graph

15 Commits (10ddeda5cbc531e6b6ad260b8b131265ed34749b)

Author SHA1 Message Date
Jos van den Oever 10ddeda5cb Add placeholder variable name in generated code 2019-02-13 07:57:25 +01:00
Jos van den Oever ad94fb1036 cargo fmt 2019-01-22 00:03:50 +01:00
Jos van den Oever b41b1be336 Add anonymous parameter placeholders to generated code
As of Rust 1.31, missing parameter placeholders in functions
give a compile error. This commit adds more of them.
2018-12-10 00:12:49 +01:00
Jos van den Oever 319991e77f Add anonymous parameter placeholders to generated code
As of Rust 1.31, missing parameter placeholders in functions
give a compile error. This commit adds them.
2018-12-09 23:45:46 +01:00
Owen Nelson 325ffc2a2c 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
2018-12-09 23:34:40 +01:00
Carl Schwan ec81047ac1
Use pattern matching instead of if and else that return true and false
Differential Revision: https://phabricator.kde.org/D16576
2018-11-01 10:30:05 +01:00
Jos van den Oever 385ae17bb7 Pass the emitter as mutable. It is pointless otherwise. 2018-10-26 00:32:02 +02:00
Jos van den Oever b603a2262b Only allow mutable objects to call back into C++
When an object calls into C++, that C++ code may again call into Rust.
The original call might have an immutable reference and the nested
call could receive a mutable reference. That is not allowed and
undefined behaviour. For this reason, calling into C++ is only allowed
from mutable objects.
2018-10-25 18:06:19 +02:00
Jos van den Oever fac04fd6d4 Remove unneeded annotations 2018-09-29 23:47:23 +02:00
Jos van den Oever 13d8d1cf1d Use AtomicPtr instead of Mutex 2018-09-29 23:28:24 +02:00
Jos van den Oever 6ee8ca626d Add function to create bindings from runtime Config object 2018-09-28 23:38:44 +02:00
Jos van den Oever d7860d9031 Also check for module directory 2018-09-28 18:40:01 +02:00
Jos van den Oever 034e5526cf Add missing ? 2018-09-28 18:08:19 +02:00
Jos van den Oever b3e43ae1d2 Handle result of write! and writeln!
This is probably the patch with the largest amount of question marks added to code ever.
2018-09-28 18:05:10 +02:00
Jos van den Oever d7e4f1362d Port rust_qt_binding_generator from C++ to Rust 2018-09-28 12:11:57 +02:00