Comments (3)
This is incidentally fixed by #122493 by making unions always sized.
from rust.
from rust.
smaller:
union Union {
val: [u8],
}
fn cast(ptr: *const ()) -> *const Union {
ptr as _
}
The union is currently in fact not sized, but this code assumes that non-struct ADTs must be sized:
rust/compiler/rustc_hir_typeck/src/cast.rs
Lines 101 to 144 in 7aa1de7
from rust.
Related Issues (20)
- ICE: cfi: `encode_ty: unexpected 'CoroutineWitness'` HOT 6
- "command did not execute successfully" message is too verbose when tool fails to compile
- Cannot call method that requires a non-array unsized coercion, contrary to the reference HOT 1
- ICE: error performing ParamEnvAnd HOT 1
- suggested fix for undeclared hrtb lifetimes in where clauses in produces error "[E0316] nested quantification of lifetimes" when specified just before the trait HOT 4
- rustc stackoverflow (SIGSEGV) HOT 5
- offset_of docs examples use assert! instead of assert_eq! HOT 3
- ICE: `rustdoc`'s `--test` option may call `rustc` with too many arguments HOT 2
- Have a separate `Constructors` section in rustdoc for each type that shows functions that can be used to construct the type. HOT 1
- match generates more branch instructions HOT 5
- Any handy runtime reflection lib? HOT 1
- Match on two-variant enum optimizes poorly HOT 10
- ICE: rustc_privacy `None` HOT 1
- ICE: coverage: `attempt to add a 'Counter' to a BCB target with existing incoming edge counters` HOT 5
- Tracking Issue for `Vec::pop_if`
- Tracking Issue for `Vec::peek_mut` HOT 1
- String::from_raw_parts example is potentially problematic HOT 3
- Unable to see through associated type with where clause on GAT HOT 2
- rustc shouldn't suggest returning `Option<&Option<T>>` in `filter_map`
- Compiler doesn't recognize existing `#[derive(Clone)]` and suggests to add it 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.