Skip to content

Conversation

compiler-errors
Copy link
Member

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

@rustbot
Copy link
Collaborator

rustbot commented Aug 27, 2023

r? @cjgillot

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 27, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor

r=me with tests blessed.

@cjgillot
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 31, 2023

📌 Commit bf66723 has been approved by cjgillot

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 31, 2023
@bors
Copy link
Collaborator

bors commented Aug 31, 2023

⌛ Testing commit bf66723 with merge 784916c...

@bors
Copy link
Collaborator

bors commented Aug 31, 2023

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 784916c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 31, 2023
@bors bors merged commit 784916c into rust-lang:master Aug 31, 2023
@rustbot rustbot added this to the 1.74.0 milestone Aug 31, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (784916c): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.8% [-3.1%, -0.7%] 4
Improvements ✅
(secondary)
-2.5% [-2.9%, -2.2%] 3
All ❌✅ (primary) -1.8% [-3.1%, -0.7%] 4

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 632.412s -> 631.374s (-0.16%)
Artifact size: 316.49 MiB -> 316.55 MiB (0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undefined behavior in safe rust using rustc_layout_scalar_valid_range_start
6 participants