You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected to see this happen: The code should output Bar("hi") with no compiler warnings.
Instead, this happened: The code does output Bar("hi"), but there is the following compiler warning:
warning: field `0` is never read
--> src/main.rs:3:9
|
3 | Bar(String)
| --- ^^^^^^
| |
| field in this variant
|
= note: `Foo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
3 | Bar(())
| ~~
warning: `playground` (bin "playground") generated 1 warning
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.83s
Running `target/debug/playground`
I tried this code:
I expected to see this happen: The code should output
Bar("hi")
with no compiler warnings.Instead, this happened: The code does output
Bar("hi")
, but there is the following compiler warning:Meta
Heres a playground link: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=9b6d2f66e6c8037781a45025529fdb14
At the current moment of testing, playground is using:
1.86.0-nightly (2025-01-11 eb54a50)
The text was updated successfully, but these errors were encountered: