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

feat: require trait function calls (Foo::bar()) to have the trait in scope (imported) #6882

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

asterite
Copy link
Collaborator

@asterite asterite commented Dec 19, 2024

Description

Problem

Part of #6864

Summary

This PR is only about calls (Foo::bar()).

There are many more cases to handle (methods, but also calls on primitive types like Field::foo() and method calls on primitive types) but it might be better to do all of this across many PRs so they are easier to review.

Additional Context

  1. To avoid introducing a huge breaking change, if you call a trait function, you don't have it imported, and there's only one possible trait function to call, that's reported as a warning.
  2. We can document these new requirements in the final PR.

Documentation

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Contributor

github-actions bot commented Dec 19, 2024

Peak Memory Sample

Program Peak Memory
keccak256 78.48M
workspace 123.33M
regression_4709 422.91M
ram_blowup_regression 1.58G
private-kernel-tail 201.69M
private-kernel-reset 716.96M
private-kernel-inner 291.77M
parity-root 171.99M

Copy link
Contributor

github-actions bot commented Dec 19, 2024

Compilation Sample

Program Compilation Time %
sha256_regression 1.396s 3%
regression_4709 0.798s 1%
ram_blowup_regression 15.611s 1%
rollup-base-public 110.539s -7%
rollup-base-private 98.800s 0%
private-kernel-tail 1.075s 1%
private-kernel-reset 7.116s 0%
private-kernel-inner 2.077s -2%
parity-root 0.746s -1%
noir-contracts 89.919s 0%

Copy link
Contributor

github-actions bot commented Dec 19, 2024

Execution Sample

Program Execution Time %
sha256_regression 0.627s 1%
regression_4709 0.401s 3%
ram_blowup_regression 4.497s -1%
rollup-base-public 21.388s -2%
rollup-base-private 19.933s 0%
private-kernel-tail 0.719s 2%
private-kernel-reset 1.480s -2%
private-kernel-inner 0.968s -2%
parity-root 0.530s -3%

@asterite asterite changed the title feat: require trait methods to be in scope feat: require trait function calls (Foo::bar()) to be in scope Dec 19, 2024
@asterite asterite marked this pull request as ready for review December 19, 2024 19:30
@asterite asterite requested a review from a team December 19, 2024 19:33
@asterite asterite changed the title feat: require trait function calls (Foo::bar()) to be in scope feat: require trait function calls (Foo::bar()) to have the trait in scope (imported) Dec 19, 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.

1 participant