Comments (1)
I think this is expected behavior. E.g. Vec<T>
or slices &[T]
assume that elements are mem::size_of<T>()
bytes apart. If the size wasn't changed for the struct, this couldn't be guaranteed.
See also
struct A {
x: u64,
y: u8,
}
This has size 8, even though it wouldn't need to have that just for the alignment. Size is rounded up to the next multiple of the alignment.
from rust.
Related Issues (20)
- fixed-by-polonius loops/functions have very bad diagnostics HOT 1
- `rustc unexpectedly overflowed its stack! this is a bug` HOT 7
- `f16`/`f128` fallback code is not getting inlined HOT 4
- #[diagnostic::on_unimplemented] hint not shown for associated type mismatch HOT 4
- Unexpected trait bound not satisfied related to `std::io::Write` HOT 1
- Different behavior for macro by example and procedural macro HOT 1
- Unexpected comment position after macro expansion HOT 1
- Empty where clauses don't have an unused warning HOT 5
- Vec<T> implements PartialEq<[T; N]> but the other way round doesn't work HOT 1
- rustc can't find the linker when `--sysroot` is set to a local build of the sysroot HOT 14
- `async closure does not implement `FnMut` because it captures state from its environment` for async closures, while closure returning async block works fine HOT 1
- ICE: `assertion failed: unique` HOT 1
- Suboptimal interaction between lifetime oriented and value oriented type system in the presence of closures. HOT 1
- rustc should magically detect repeating refactoring errors and compress them
- Tracking Issue for `push_str` returning `self` HOT 3
- Exponential time complexity when type checking code with equality constraints HOT 1
- Suggest `Some(&v)` rather than `Some(v.clone())` when calling generic owning methods HOT 2
- endless loop by running `cargo test` with toolchain 2024-05-14 HOT 4
- Call to function broken by unrelated constraint on generic function containing the call HOT 1
- It's not clear from the documentation when particular features were inctoduces or deprecated HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.