Commit graph

223 commits

Author SHA1 Message Date
David Faure
41be30ee6a Port from vec![] to Vec::new()
Some checks are pending
autofix.ci / format_fix (push) Waiting to run
autofix.ci / lint_typecheck (push) Waiting to run
autofix.ci / ci (push) Blocked by required conditions
vec![] expands to Vec::new(), but expanding macros takes a bit of
time and takes memory in rust-analyzer. Also, the code was using a mix
of vec![] and Vec::new(), so this is more consistent.
2025-12-05 16:53:45 +01:00
Olivier Goffart
88697c68bb Remove license header from .md/.mdx files
They should be in the lines, but the problem is that this causes issues
in the .mdx files.

License header doesn't really make sense for .md files anyway
2025-12-04 21:58:09 +01:00
Olivier Goffart
b3470206ff Reformat after edition change 2025-11-27 17:07:35 +01:00
Simon Hausmann
7e2c4f37af const-field-offset: Switch to edition 2024
(no changes necessary)
2025-11-13 15:59:32 +01:00
Simon Hausmann
a6f94862cf vtable: Upgrade to edition 2024 2025-11-13 15:59:32 +01:00
Olivier Goffart
ac24e0274e Rust: fix compilation if the slint code declares struct named core 2025-06-30 13:36:01 +02:00
Olivier Goffart
af573e6401 vtable: Don't automatically add extern C
Some checks are pending
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.82) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
2025-06-06 14:47:46 +02:00
Olivier Goffart
f91b61c8ee corelib: Remove the extern call in the vtable for wasm
In fact, remove it for non-C++

Because wasm doesn't support C-unwind. And actually warns about
incompatible ABI for the rest

Fixes #8449
2025-06-06 14:47:46 +02:00
Olivier Goffart
f39b3ab888 Use "C-unwind" API in our vtable
When using rust, allow panics to cross the boundaries of our vtable traits.
This avoids panic producing two backtrace with panic=unwind

This patch doesn't touch the ABI of out FFI interface, they stay extern "C", because
if a panic or exception crosses these boundaries, we are in trouble.
(Also, we have a panic=abort in our Cargo.toml anyway)
2025-06-06 14:47:46 +02:00
Simon Hausmann
43ecb0ffb9 CI: Fix lifetime annotation warnings in vtable/vrc crates
Amends de81fa1dba
2025-06-06 11:59:43 +02:00
Yuri Astrakhan
9621cae218 Auto-fixed clippy::needless_lifetimes
`__CARGO_FIX_YOLO=1` is a hack, but it does help a lot with the tedious fixes where the result is fairly clear.

See https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes

```
__CARGO_FIX_YOLO=1 cargo clippy --fix --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::needless_lifetimes

cargo fmt --all
```
2025-02-07 09:20:49 +01:00
Yuri Astrakhan
4ae2627ade A few more format arg inlining
Used these commands and some manual searching

```
cargo clippy --fix  --all-targets --workspace --exclude gstreamer-player --exclude i-slint-backend-linuxkms --exclude uefi-demo --exclude ffmpeg -- -A clippy::all -W clippy::uninlined_format_args
cargo clippy --all-targets -- -A clippy::all -W clippy::uninlined_format_args
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2025-02-07 06:43:19 +01:00
Olivier Goffart
1ebf51e67c Bump vtable version 2024-12-18 10:04:41 +01:00
Olivier Goffart
63785fd262
vtable: fix for warning with the nightly rust compiler
```
warning: non-local `macro_rules!` definition, `#[macro_export]` macro should be written at top level module
   --> helper_crates/vtable/tests/test_vtable.rs:159:5
    |
159 |     #[vtable]
    |     ^^^^^^^^^ in this procedural macro expansion
    |
    = help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current function `test3`
```

Put the macro in the module with everything else, so it is re-exported
with the same visibility
2024-09-26 09:35:12 +02:00
Tobias Hunger
e0ac115edd janitor: vtable: Fix struct SelfInfo is never constructed
Fix a build time warning.
2024-07-01 12:38:34 +02:00
Tobias Hunger
18e7ed2626 janitor: Fix clippy "doc list item missing indentation" 2024-06-24 14:59:47 +02:00
Tobias Hunger
2e3b00e38e janitor: Fix some clippy warnings pre-release
Nothing that should be controversial, but the
`internal/compiler/builtin_macros.rs` could point to a thinko in the original
commit.
2024-05-06 16:47:14 +02:00
Olivier Goffart
e34d5f61a5 Prepare for release of helper crates 2024-03-14 08:52:09 +01:00
Olivier Goffart
aa7360a91a const-field-offset: Fix warnings on nightly rust
```
warning: non-local impl definition, they should be avoided as they go against expectation
```

Part of  #4706
2024-02-28 11:19:26 +01:00
Olivier Goffart
8bc4c4e053 vtable: increase version number to account for breaking change in vtable::Dyn 2024-02-26 14:45:47 +01:00
Olivier Goffart
8888e547a5 vtable: Fix soundess issue of VRc::into_dyn for !Send types
Dyn is currently Send+Sync, so `VRc<WhateverVTable, Dyn>` is also
Send+Sync. So we shouldn't really allow conversion between
`VRc<WhateverVTable, SomeThingNotSend>` to `VRc<_, Dyn>` that can be
sent between threads

This is a breaking change of the vtable crate, but also a soundness fix

Also VRc shouldn't be shared between thread if the vtable itself can't
be shared between threads
2024-02-26 14:45:47 +01:00
Olivier Goffart
fa05f1091e vtable: fix clippy warnings
```
warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> helper_crates/vtable/src/vrc.rs:109:56
    |
109 |                 let mut layout = VTable::drop_in_place(&*vtable, data);
    |                                                        ^^^^^^^^ help: change this to: `*vtable`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> helper_crates/vtable/src/vrc.rs:124:37
    |
124 |                     VTable::dealloc(&*vtable, self.inner.cast().as_ptr(), layout);
    |                                     ^^^^^^^^ help: change this to: `*vtable`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
```
2024-02-26 12:30:16 +01:00
Olivier Goffart
73187356b9 vtable: prepare for 0.1.12 release 2024-02-26 12:26:20 +01:00
Olivier Goffart
5605c606ca vtable: fix UB detected as miri errors
We can't create references for things that aren't represented by the
reference. Even if we never dereference that reference.

Also add a miri test in the CI that runs the test on crate which are
error free.
2024-02-21 08:12:18 +01:00
Olivier Goffart
bd86c93ffa const-field-offset: Prepare for release
Just some warning fixes and update the domain in the Cargo.toml
2024-02-20 15:12:37 +01:00
Tobias Hunger
a8f912900b janitor: Fix warnings in nightly about redandant use 2024-02-19 17:05:21 +01:00
Tobias Hunger
9faffc75bb janitor: Fix warnings about unused members
I get warnings about unused members using the nightly compiler, one for
each member in all structs that derive the `FieldOffsets` macro. That is
a lot.

This fixes that as well as the one occurrence of that same warning in
unrelated code.
2024-01-09 10:48:19 +01:00
Tobias Hunger
783083868a janitor: Fix clippy errors about wrong clone implementations
... for Copy types.
2023-09-20 20:23:38 +02:00
Simon Hausmann
3a55dae0af Bump vtable version 2023-09-04 10:30:10 +02:00
Tobias Hunger
2aecba2e90 xtask: Fix license symlinks after the latest license header changes 2023-08-17 08:55:28 +02:00
Tobias Hunger
0139eea4f9 xtask: Fix up license headers
* Keep project related .md files triple licensed as the rest of the
  crate
* Make vtable MIT OR Apache 2.0 (as suggested by @ogoffart)
2023-08-17 08:55:28 +02:00
Simon Hausmann
96d7bb132c reuse: remove glob for markdown files
Instead, place the copyright and license right into the source.

To satisfy reuse, this also removes the unnecessary MIT.txt
symlinks.
2023-08-17 08:55:28 +02:00
Tobias Hunger
09d3eaf00a Update license symlinks
run `cargo xtask check_reuse_compliance --fix-symlinks`
2023-08-16 11:46:15 +02:00
Olivier Goffart
7f0ba774ec Use portable_atomic instead of deprecated atomic_polyfill 2023-08-10 13:12:04 +02:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 (#2994) 2023-07-10 10:12:11 +02:00
Tobias Hunger
e02c360000 Clippy polish 2023-06-28 14:22:30 +02:00
Olivier Goffart
9b59036816 Add licenses symlinks 2023-06-26 13:12:29 +02:00
Olivier Goffart
31fc7cdd08 Janitor: Some dependencies update 2023-06-21 17:24:57 +02:00
Olivier Goffart
11dea135f7 Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Tobias Hunger
04d1229685 Fix licnese information using xtask 2023-06-16 09:14:20 +02:00
Aurindam Jana
039e54a5de
Add royalty free license to files except examples and docs (#2888) 2023-06-15 11:20:50 +02:00
Olivier Goffart
cae1ef1238 Date in Changelog for the release 2023-04-03 07:29:02 +02:00
Olivier Goffart
8cefde7c3a Remove space before => in quote_spanned
That's the style encouraged by the documentation
2023-03-24 11:14:48 +01:00
Olivier Goffart
8169b5629e const-field-offset: update to syn 2 2023-03-22 09:49:54 +01:00
Olivier Goffart
a2a29862a2 vtable: update syn 2023-03-22 09:49:54 +01:00
Olivier Goffart
00de1867ae Janitor: deps upgrade 2023-01-16 10:47:55 +01:00
Tobias Hunger
9b30cacd0c vtable-macro: Fix syntax error in Cargo.toml 2022-10-26 08:59:36 +02:00
Olivier Goffart
cd30599ac3 Upgrade memoffset used as a dev-dependencies 2022-10-17 16:50:14 +02:00
Simon Hausmann
27fea8b9f3 Fix rustdoc warnings with nightly
Use backticks as recommended by rustdoc for items that could be interpreted as HTML tags.
2022-10-12 17:29:46 +02:00
Olivier Goffart
9cab0747b5 Ensure vtable and vtable-macro have the same version 2022-09-14 14:41:04 +02:00