Skip to content
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

Fixes missing error when using trait constraint. #5882

Merged
merged 2 commits into from
Apr 22, 2024
Merged

Conversation

esdrubal
Copy link
Contributor

Description

When using trait constraints a blanket implementation is added for the trait constraint generic parameter.

This changes avoid the generation of other implementations from the type parameter generic implementation.

Fixes #5873

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

When using trait constraints a blanket implementation is added for the trait constraint generic parameter.

This changes avoid the generation of other implementations from the type parameter generic implementation.

Fixes #5873
Copy link

Benchmark for bf0d0f4

Click to view benchmark
Test Base PR %
code_action 5.3±0.03ms 5.4±0.15ms +1.89%
code_lens 299.0±9.33ns 331.7±18.66ns +10.94%
compile 6.3±0.05s 6.3±0.05s 0.00%
completion 4.9±0.09ms 4.8±0.07ms -2.04%
did_change_with_caching 6.3±0.09s 6.2±0.10s -1.59%
document_symbol 944.9±24.05µs 991.3±53.71µs +4.91%
format 74.3±0.75ms 77.1±1.73ms +3.77%
goto_definition 360.7±8.47µs 370.9±5.37µs +2.83%
highlight 8.8±0.08ms 8.7±0.26ms -1.14%
hover 608.8±20.42µs 682.4±20.71µs +12.09%
idents_at_position 171.1±8.97µs 124.5±2.47µs -27.24%
inlay_hints 652.8±22.34µs 661.6±31.01µs +1.35%
on_enter 518.5±24.85ns 477.2±13.45ns -7.97%
parent_decl_at_position 3.6±0.04ms 3.6±0.08ms 0.00%
prepare_rename 360.3±5.85µs 372.6±5.46µs +3.41%
rename 9.3±0.19ms 9.4±0.36ms +1.08%
semantic_tokens 1026.8±49.66µs 1045.7±32.69µs +1.84%
token_at_position 446.2±4.27µs 365.1±3.90µs -18.18%
tokens_at_position 3.7±0.05ms 3.6±0.04ms -2.70%
tokens_for_file 441.5±3.68µs 429.5±3.77µs -2.72%
traverse 51.6±2.04ms 51.7±1.49ms +0.19%

@xunilrj xunilrj marked this pull request as ready for review April 22, 2024 08:51
@xunilrj xunilrj requested a review from a team April 22, 2024 08:51
@IGI-111 IGI-111 enabled auto-merge (squash) April 22, 2024 08:58
Copy link

Benchmark for 7880f54

Click to view benchmark
Test Base PR %
code_action 5.4±0.10ms 5.5±0.24ms +1.85%
code_lens 293.7±7.55ns 325.2±8.91ns +10.73%
compile 6.4±0.07s 6.3±0.05s -1.56%
completion 5.0±0.22ms 5.1±0.22ms +2.00%
did_change_with_caching 6.3±0.05s 6.3±0.11s 0.00%
document_symbol 943.0±24.31µs 944.0±21.77µs +0.11%
format 74.7±1.01ms 74.4±1.39ms -0.40%
goto_definition 366.1±6.68µs 361.5±6.24µs -1.26%
highlight 8.8±0.25ms 9.0±0.31ms +2.27%
hover 610.2±21.13µs 618.9±9.83µs +1.43%
idents_at_position 121.7±0.66µs 122.0±1.72µs +0.25%
inlay_hints 651.3±26.80µs 649.4±17.63µs -0.29%
on_enter 489.9±16.94ns 516.6±18.33ns +5.45%
parent_decl_at_position 3.6±0.04ms 3.6±0.05ms 0.00%
prepare_rename 357.5±7.08µs 360.8±5.88µs +0.92%
rename 9.4±0.17ms 9.5±0.33ms +1.06%
semantic_tokens 1033.9±16.89µs 1046.8±23.22µs +1.25%
token_at_position 353.9±2.97µs 357.4±3.37µs +0.99%
tokens_at_position 3.6±0.05ms 3.6±0.05ms 0.00%
tokens_for_file 424.0±2.68µs 424.9±2.81µs +0.21%
traverse 51.4±2.22ms 53.0±1.17ms +3.11%

@IGI-111 IGI-111 merged commit d092929 into master Apr 22, 2024
68 checks passed
@IGI-111 IGI-111 deleted the esdrubal/5873 branch April 22, 2024 10:10
@esdrubal esdrubal self-assigned this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with impl traits with constraints
3 participants