-
Notifications
You must be signed in to change notification settings - Fork 11
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
issue: nargo is complaining about trait visibility not matching the import #92
base: main
Are you sure you want to change the base?
Conversation
@@ -18,6 +18,6 @@ pub(crate) mod utils; | |||
pub use bignum::BigNum; | |||
pub use bignum::BigNumTrait; // So that external code can operate on a generic BigNum, `where BigNum: BigNumTrait`. | |||
pub use runtime_bignum::RuntimeBigNum; | |||
|
|||
pub use runtime_bignum::RuntimeBigNumTrait; |
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.
I've imported the trait here. but the I'm getting an error.
the BignumTrait
is imported here as well.
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.
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.
pub use
is saying that you want to reexport RuntimeBigNumTrait
so it's visible outside of the crate. As runtime_bignum::RuntimeBigNumTraitis
pub(crate)` then you're increasing the visibility of this trait, which isn't allowed.
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.
changed the trait
to a pub
instead of pub(crate)
. The error disappeared but the warning is still around.
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.
You mean?
warning: Visibility is ignored on a trait method
┌─ src/runtime_bignum.nr:69:5
│
69 │ pub fn __udiv_mod(self, divisor: Self) -> (Self, Self);
│ ---
│
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.
This is expected as those modifiers don't mean anything on trait methods.
Description
I'm trying to fix the trait visibility warnings in bignum.
For the
RuntimeBignumTrait
I'm getting an error when importing the trait inlib.nr
Problem*
Resolves
Summary*
Additional Context
PR Checklist*
cargo fmt
on default settings.