address review comments
This commit is contained in:
parent
74bc964e60
commit
2fcef6e9f7
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user