rust/tests/ui/self/invalid-self-argument.stderr
reddevilmidzy a4a79500b5 Cleaned up some tests
fix explicit-call-to-dtor.rs
fix explicit-call-to-supertrait-dtor.rs
merge issues/issue-17740.rs with lifetimes/explicit-self-lifetime-mismatch.rs
merge bare-fn-start.rs and trait-fn.rs into invalid-self-argument.rs
add comment tests/ui/traits/catch-unwind-cell-interior-mut
2025-12-01 19:51:20 +09:00

22 lines
736 B
Text

error: unexpected `self` parameter in function
--> $DIR/invalid-self-argument.rs:8:16
|
LL | fn b(foo: u32, &mut self) {}
| ^^^^^^^^^ must be the first parameter of an associated function
error: unexpected `self` parameter in function
--> $DIR/invalid-self-argument.rs:15:20
|
LL | fn c(foo: u32, self) {}
| ^^^^ must be the first parameter of an associated function
error: `self` parameter is only allowed in associated functions
--> $DIR/invalid-self-argument.rs:3:6
|
LL | fn a(&self) {}
| ^^^^^ not semantically valid as function parameter
|
= note: associated functions are those in `impl` or `trait` definitions
error: aborting due to 3 previous errors