Open augustfengd opened 2 years ago
This works on rustc 1.64.0 (a55dd71d5 2022-09-19)
.
I also tried going back to 1.63.0 and was unable to reproduce the issue in that version either.
@augustfengd can you re-check and also specify further details (e.g. which O/S are you using)?
Hey @Spoonbender, sorry for the (super) late reply. I'm on a new machine now with rustc 1.67.0 (fc594f156 2023-01-24)
+ WSL2 and I confirm the issue persists.
However, it's fine when invoking with cargo run
.
Update: rustc --edition 2021 <file>
works!
I was running into the same thing and can confirm that rustc --edition 2021 <file>
works for me too. Thanks!
I also ran into the same problem. My rustc --version
is rustc 1.78.0 (9b00956e5 2024-04-29)
. Error message:
error[E0277]: can't compare `&{integer}` with `{integer}`
--> 9_closures_in_std.rs:25:60
|
25 | println!("2 in array2: {}", array2.into_iter().any(|x | x == 2));
| ^^ no implementation for `&{integer} == {integer}`
|
= help: the trait `PartialEq<{integer}>` is not implemented for `&{integer}`
help: consider dereferencing here
|
25 | println!("2 in array2: {}", array2.into_iter().any(|x | *x == 2));
| +
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
I can confirm that rustc --edition 2021 <file>
works fine.
Hello!
When I copy the snippet in the section 9.2.6.1 and try compile locally, I get an error:
My rust compiler version:
The web application is still compiling it correctly though!