-
Notifications
You must be signed in to change notification settings - Fork 13k
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
WF-check struct field types at construction site #128714
Conversation
Note that the test output is currently *incorrect*. We should be emitting an error at the use site too, not just at the definition. This is partly for UI reasons, but mainly to fix a related ICE where a const generic body is not tainted with an error since no usage error is reported.
Rustc of course already WF-checked the field types at the definition site, but for error tainting of consts to work properly, there needs to be an error emitted at the use site. Previously, with no use-site error, we proceeded with CTFE and ran into ICEs since we are running code with type errors. Emitting use-site errors also brings struct-like constructors more in line with fn-like constructors since they already emit use-site errors for WF issues.
| ---- unsatisfied trait bound introduced in this `derive` macro | ||
| ^^^^ required by this bound in `Vector2` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new version of this label actually makes more sense.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
@bors try |
WF-check struct field types at construction site Fixes rust-lang#126272. Fixes rust-lang#127299. Rustc of course already WF-checked the field types at the definition site, but for error tainting of consts to work properly, there needs to be an error emitted at the use site. Previously, with no use-site error, we proceeded with CTFE and ran into ICEs since we are running code with type errors. Emitting use-site errors also brings struct-like constructors more in line with fn-like constructors since they already emit use-site errors for WF issues. r? `@BoxyUwU`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (d0df6ac): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary -2.4%)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.
CyclesResults (secondary -6.5%)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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 761.437s -> 760.375s (-0.14%) |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (19469cb): comparison URL. Overall result: ❌✅ regressions and 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)This benchmark run did not return any relevant results for this metric. CyclesResults (secondary -4.1%)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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 763.399s -> 762.097s (-0.17%) |
Fixes #126272.
Fixes #127299.
Rustc of course already WF-checked the field types at the definition
site, but for error tainting of consts to work properly, there needs to
be an error emitted at the use site. Previously, with no use-site error,
we proceeded with CTFE and ran into ICEs since we are running code with
type errors.
Emitting use-site errors also brings struct-like constructors more in
line with fn-like constructors since they already emit use-site errors
for WF issues.
r? @BoxyUwU