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

Spell check with typos. Add spell-check CI job #621

Merged
merged 3 commits into from Jul 19, 2023

Conversation

vvv
Copy link
Contributor

@vvv vvv commented Jul 2, 2023

Other changes

Fix the unit tests

Update length_expr_parentheses.stderr to let tests/compile-fail/length_expr_parentheses.rs pass.

Console output (before this patch is applied):

test tests/compile-fail/length_expr_parentheses.rs [should fail to compile] ... mismatch

EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: this file contains an unclosed delimiter
  --> tests/compile-fail/length_expr_parentheses.rs:15:1
   |
15 | #[packet]
   | ^^^^^^^^^ unclosed delimiter
   |
   = note: this error originates in the derive macro `::pnet_macros::Packet` (in Nightly builds, run with -Z macro-backtrace for more info)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: this file contains an unclosed delimiter
  --> tests/compile-fail/length_expr_parentheses.rs:15:1
   |
15 | #[packet]
   | ^^^^^^^^^ unclosed delimiter
   |
   = note: this error originates in the derive macro `::pnet_macros::Packet` (in Nightly builds, run with -Z macro-backtrace for more info)

error: proc-macro derive panicked
  --> tests/compile-fail/length_expr_parentheses.rs:15:1
   |
15 | #[packet]
   | ^^^^^^^^^
   |
   = help: message: compiler/fallback mismatch
   = note: this error originates in the attribute macro `packet` (in Nightly builds, run with -Z macro-backtrace for more info)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite

Fix "irrefutable while let pattern" warning

warning: irrefutable `while let` pattern
  --> examples/arp_packet.rs:61:11
   |
61 |     while let buf = receiver.next().unwrap() {
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this pattern will always match, so the loop will never exit
   = help: consider instead using a `loop { ... }` with a `let` inside it
   = note: `#[warn(irrefutable_let_patterns)]` on by default

vvv added 2 commits July 2, 2023 15:02
Let `tests/compile-fail/length_expr_parentheses.rs` pass.

Console output:

```
test tests/compile-fail/length_expr_parentheses.rs [should fail to compile] ... mismatch

EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: this file contains an unclosed delimiter
  --> tests/compile-fail/length_expr_parentheses.rs:15:1
   |
15 | #[packet]
   | ^^^^^^^^^ unclosed delimiter
   |
   = note: this error originates in the derive macro `::pnet_macros::Packet` (in Nightly builds, run with -Z macro-backtrace for more info)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: this file contains an unclosed delimiter
  --> tests/compile-fail/length_expr_parentheses.rs:15:1
   |
15 | #[packet]
   | ^^^^^^^^^ unclosed delimiter
   |
   = note: this error originates in the derive macro `::pnet_macros::Packet` (in Nightly builds, run with -Z macro-backtrace for more info)

error: proc-macro derive panicked
  --> tests/compile-fail/length_expr_parentheses.rs:15:1
   |
15 | #[packet]
   | ^^^^^^^^^
   |
   = help: message: compiler/fallback mismatch
   = note: this error originates in the attribute macro `packet` (in Nightly builds, run with -Z macro-backtrace for more info)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite
```
```
warning: irrefutable `while let` pattern
  --> examples/arp_packet.rs:61:11
   |
61 |     while let buf = receiver.next().unwrap() {
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this pattern will always match, so the loop will never exit
   = help: consider instead using a `loop { ... }` with a `let` inside it
   = note: `#[warn(irrefutable_let_patterns)]` on by default
```
@mrmonday mrmonday merged commit 12636de into libpnet:master Jul 19, 2023
4 checks passed
@mrmonday
Copy link
Contributor

Looks good, thanks!

@vvv vvv deleted the spell-check branch July 20, 2023 09:18
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.

None yet

2 participants