-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc_layout_scalar_valid_range
makes ctors unsafe
#115290
Conversation
r? @cjgillot (rustbot has picked a reviewer for you, use r? to override) |
79f3e4c
to
dbb61eb
Compare
This comment has been minimized.
This comment has been minimized.
f068935
to
f6ba980
Compare
This comment has been minimized.
This comment has been minimized.
r=me with tests blessed. |
Also remove a note that I don't consider to be very useful in context.
f6ba980
to
bf66723
Compare
@bors r+ rollup |
☀️ Test successful - checks-actions |
Finished benchmarking commit (784916c): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 632.412s -> 631.374s (-0.16%) |
We already validate this when we use the ctor in a call, e.g.
Variant(1)
, but not if we use the ctor as a fn ptr, e.g..map(Variant)
. The easiest way to fix the latter is (afaict) is by marking the ctor as unsafe itself.Fixes #115284