`Sized` shadowed the marker trait, so a `?Sized` bound in any crate that imports the prelude failed to resolve -- a compile error in someone else's code that nothing here would have caught. It was already biting inside iris: `default/mod.rs`, `widget/ptr.rs` and `widget/text/build.rs` all imported `std::marker::Sized` explicitly to get out from under it, which they no longer need.
`SetSize` rather than `FixedSize` because the size it sets need not be fixed -- `width(rest(2))` (a flex weight) and `width(rel(0.5))` (half the parent) build the same widget, and both are more common than `sized((100, 100))`. It also pairs with the `MaxSize` beside it in that module: one sets a length, the other caps it. The builders are unchanged.
`tests/prelude_bounds.rs` is a compile-level guard -- it fails to build if the prelude shadows `Sized` again, which I checked by reverting `src/` under it:
```
error[E0404]: expected trait, found struct `Sized`
--> tests/prelude_bounds.rs:8:22
|
8 | fn takes_unsized<T: ?Sized>(_: &T) {}
| ^^^^^ not a trait
```
The pad tab of the tabs example -- the one built out of `sized` and the flexible widths -- renders pixel-identical to before the rename.
---------
Co-authored-by: iris <2+iris@noreply.localhost>
Reviewed-on: iris/iris#14
Co-authored-by: AIris <4+iris-ai@noreply.localhost>
20 lines
272 B
Rust
20 lines
272 B
Rust
mod align;
|
|
mod layer;
|
|
mod max_size;
|
|
mod offset;
|
|
mod pad;
|
|
mod scroll;
|
|
mod set_size;
|
|
mod span;
|
|
mod stack;
|
|
|
|
pub use align::*;
|
|
pub use layer::*;
|
|
pub use max_size::*;
|
|
pub use offset::*;
|
|
pub use pad::*;
|
|
pub use scroll::*;
|
|
pub use set_size::*;
|
|
pub use span::*;
|
|
pub use stack::*;
|