mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-29 21:34:50 +00:00
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
This commit is contained in:
parent
345da48a7e
commit
aa7360a91a
2 changed files with 30 additions and 3 deletions
|
@ -117,6 +117,32 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Test that one can't implement Unpin for pinned struct
|
||||
|
||||
This should work:
|
||||
|
||||
```
|
||||
#[derive(const_field_offset::FieldOffsets)]
|
||||
#[repr(C)]
|
||||
#[pin]
|
||||
struct MyStructPin { a: u32 }
|
||||
```
|
||||
|
||||
But this not:
|
||||
|
||||
```compile_fail
|
||||
#[derive(const_field_offset::FieldOffsets)]
|
||||
#[repr(C)]
|
||||
#[pin]
|
||||
struct MyStructPin { a: u32 }
|
||||
impl Unpin for MyStructPin {};
|
||||
```
|
||||
|
||||
*/
|
||||
#[cfg(doctest)]
|
||||
const NO_IMPL_UNPIN: u32 = 0;
|
||||
|
||||
#[doc(hidden)]
|
||||
#[cfg(feature = "field-offset-trait")]
|
||||
mod internal {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue