Closed
Description
This compiles fine on stable, but fails on nightly and beta:
https://play.rust-lang.org/?gist=9504fbb631c253be8e43bcb872524e0e&version=nightly
#![deny(unused_results)]
fn main() {
let mut p = std::path::PathBuf::from("asdf");
p.set_extension("foo");
}
Nightly results:
Compiling playground v0.0.1 (file:///playground)
error: unused result
--> src/main.rs:5:4
|
5 | p.set_extension("foo");
| ^^^^^^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> src/main.rs:1:9
|
1 | #![deny(unused_results)]
| ^^^^^^^^^^^^^^
error: aborting due to previous error
Regardless of whether the change in behavior is an intentional backward compatibility break, it should be documented in the release notes.
See also #43806.