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

Do not emit warnings from in-language unit tests when compiling with forc build #3586

Closed
mohammadfawaz opened this issue Dec 13, 2022 · 0 comments · Fixed by #3684
Closed
Assignees
Labels
bug Something isn't working compiler: ui Mostly compiler messages lib: std Standard library

Comments

@mohammadfawaz
Copy link
Contributor

mohammadfawaz commented Dec 13, 2022

Compiler the standard library emits the following warnings now:

warning
   --> /Users/mohammad/Desktop/fuel/sway/sway-lib-std/src/bytes.sw:664:5
    |
662 |
663 |     assert(bytes.len() == 9);
664 |     bytes.pop();
    |     ----------- This returns a value of type Option<u8>, which is not assigned to anything and is ignored.
665 |     bytes.pop();
666 |     bytes.pop();
    |
____

warning
   --> /Users/mohammad/Desktop/fuel/sway/sway-lib-std/src/bytes.sw:665:5
    |
663 |
664 |     bytes.pop();
665 |     bytes.pop();
    |     ----------- This returns a value of type Option<u8>, which is not assigned to anything and is ignored.
666 |     bytes.pop();
667 |     bytes.pop();
    |
____

warning
   --> /Users/mohammad/Desktop/fuel/sway/sway-lib-std/src/bytes.sw:666:5
    |
664 |
665 |     bytes.pop();
666 |     bytes.pop();
    |     ----------- This returns a value of type Option<u8>, which is not assigned to anything and is ignored.
667 |     bytes.pop();
668 |     bytes.pop();
    |
____

warning
   --> /Users/mohammad/Desktop/fuel/sway/sway-lib-std/src/bytes.sw:667:5
    |
665 |
666 |     bytes.pop();
667 |     bytes.pop();
    |     ----------- This returns a value of type Option<u8>, which is not assigned to anything and is ignored.
668 |     bytes.pop();
669 |     bytes.pop();
    |
____

warning
   --> /Users/mohammad/Desktop/fuel/sway/sway-lib-std/src/bytes.sw:668:5
    |
666 |
667 |     bytes.pop();
668 |     bytes.pop();
    |     ----------- This returns a value of type Option<u8>, which is not assigned to anything and is ignored.
669 |     bytes.pop();
670 |     assert(bytes.len() == 3);
    |
____

warning
   --> /Users/mohammad/Desktop/fuel/sway/sway-lib-std/src/bytes.sw:669:5
    |
667 |
668 |     bytes.pop();
669 |     bytes.pop();
    |     ----------- This returns a value of type Option<u8>, which is not assigned to anything and is ignored.
670 |     assert(bytes.len() == 3);
671 |     assert(bytes.pop().unwrap() == c);
    |
____

  Compiled library "std" with 6 warnings.
  Bytecode size is 28 bytes.

I'm getting rid of the warning in #3587 but we should not be emitting warnings from tests when compiling with forc build.

@mohammadfawaz mohammadfawaz added bug Something isn't working P: critical Should be looked at before anything else compiler: ui Mostly compiler messages labels Dec 13, 2022
@mohammadfawaz mohammadfawaz added the lib: std Standard library label Dec 13, 2022
@mohammadfawaz mohammadfawaz changed the title Warnings emitted from the standard library Do not emit warnings from in-language unit tests when compiling with forc build Dec 13, 2022
mohammadfawaz added a commit that referenced this issue Dec 13, 2022
Ref #3586

That being said, warning from tests should not be emitted when compiling
with `forc build`.
@mohammadfawaz mohammadfawaz removed the P: critical Should be looked at before anything else label Dec 14, 2022
sdankel pushed a commit that referenced this issue Dec 14, 2022
Ref #3586

That being said, warning from tests should not be emitted when compiling
with `forc build`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler: ui Mostly compiler messages lib: std Standard library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants