We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This program prints dropped as the constant is copied and dropped.
dropped
struct S; impl Drop for S { fn drop(&mut self) { println!("dropped") } } const C: S = S; fn main() { C; }
That means that the statement C; does have an effect: it prints dropped. But the compiler warns that the statement has no effect:
C;
warning: path statement with no effect --> src/main.rs:9:5 | 9 | C; | ^^ | = note: `#[warn(path_statements)]` on by default
(Reproduced on stable 1.43.0 and nightly 2020-05-02.)
The text was updated successfully, but these errors were encountered:
Duplicate of #48852
Sorry, something went wrong.
No branches or pull requests
This program prints
dropped
as the constant is copied and dropped.That means that the statement
C;
does have an effect: it printsdropped
. But the compiler warns that the statement has no effect:(Reproduced on stable 1.43.0 and nightly 2020-05-02.)
The text was updated successfully, but these errors were encountered: