Add #[define_opaques] attribute and require it for all type-alias-impl-trait sites that register a hidden type#128440
Conversation
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #128481) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
…ler-errors Avoid `opaque type not constrained` errors in the presence of other errors pulled out of rust-lang#128440 These errors carry no new information if the opaque type was actually used in a constraining (but erroneous) way somewhere.
Rollup merge of rust-lang#133850 - oli-obk:push-xryukktpyooq, r=compiler-errors Avoid `opaque type not constrained` errors in the presence of other errors pulled out of rust-lang#128440 These errors carry no new information if the opaque type was actually used in a constraining (but erroneous) way somewhere.
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (b4867ea): comparison URL. Overall result: ✅ improvements - 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 is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 1.4%, secondary -3.7%)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 (primary -1.1%, secondary -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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 782.387s -> 780.697s (-0.22%) |
|
Yay |
|
@bors r=lcnr |
|
☀️ Test successful - checks-actions |
|
Post-merge analysis result Test differences
(and 19 additional diffs) |
|
Finished benchmarking commit (6650252): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -1.9%, secondary 2.8%)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 (primary -1.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: 781.59s -> 780.09s (-0.19%) |
Instead of relying on the signature of items to decide whether they are constraining an opaque type, the opaque types that the item constrains must be explicitly listed.
A previous version of this PR used an actual attribute, but had to keep the resolved
DefIds in a side table.Now we just lower to fields in the AST that have no surface syntax, instead a builtin attribute macro fills in those fields where applicable.
Note that for convenience referencing opaque types in associated types from associated methods on the same impl will not require an attribute. If that causes problems
#[defines()]can be used to overwrite the default of searching for opaques in the signature.One wart of this design is that closures and static items do not have generics. So since I stored the opaques in the generics of functions, consts and methods, I would need to add a custom field to closures and statics to track this information. During a T-types discussion we decided to just not do this for now.
fixes #131298