address review comments

This commit is contained in:
Deadbeef 2024-06-26 16:36:42 +00:00
parent 74bc964e60
commit 2fcef6e9f7
2 changed files with 9 additions and 1 deletions

View File

@ -104,15 +104,18 @@ fn main() {}
struct D;
/* FIXME(effects)
impl const Drop for D {
fn drop(&mut self) {
todo!();
}
}
*/
// Lint this, since it can be dropped in const contexts
// FIXME(effects)
fn d(this: D) {}
const fn d(this: D) {}
//~^ ERROR: this could be a `const fn`
mod msrv {
struct Foo(*const u8, &'static u8);

View File

@ -161,6 +161,11 @@ error: this could be a `const fn`
|
LL | fn d(this: D) {}
| ^^^^^^^^^^^^^^^^
|
help: make the function `const`
|
LL | const fn d(this: D) {}
| +++++
error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:125:9