diff options
| author | bors <bors@rust-lang.org> | 2024-07-25 18:05:00 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-07-25 18:05:00 +0000 | 
| commit | aa877bc71c8c8082122bee23d17c8669f30f275d (patch) | |
| tree | 1ab3cc23cee9f3240950faa293515c9536120f33 /tests | |
| parent | eb10639928a2781cf0a12440007fbcc1e3a6888f (diff) | |
| parent | cf1ce4becabf3f07b82c7dac4fd4aa3d544c3b21 (diff) | |
| download | rust-aa877bc71c8c8082122bee23d17c8669f30f275d.tar.gz rust-aa877bc71c8c8082122bee23d17c8669f30f275d.zip | |
Auto merge of #128195 - matthiaskrgr:rollup-195dfdf, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #126908 (Use Cow<'static, str> for InlineAsmTemplatePiece::String) - #127999 (Inject arm32 shims into Windows metadata generation) - #128137 (CStr: derive PartialEq, Eq; add test for Ord) - #128185 (Fix a span error when parsing a wrong param of function.) - #128187 (Fix 1.80.0 version in RELEASES.md) - #128189 (Turn an unreachable code path into an ICE) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/suggestions/suggest-add-self-issue-128042.rs | 12 | ||||
| -rw-r--r-- | tests/ui/suggestions/suggest-add-self-issue-128042.stderr | 22 | 
2 files changed, 34 insertions, 0 deletions
| diff --git a/tests/ui/suggestions/suggest-add-self-issue-128042.rs b/tests/ui/suggestions/suggest-add-self-issue-128042.rs new file mode 100644 index 00000000000..f94d166c496 --- /dev/null +++ b/tests/ui/suggestions/suggest-add-self-issue-128042.rs @@ -0,0 +1,12 @@ +struct Thing { + state: u8, +} + +impl Thing { + fn oof(*mut Self) { //~ ERROR expected parameter name, found `*` + self.state = 1; + //~^ ERROR expected value, found module `self` + } +} + +fn main() {} diff --git a/tests/ui/suggestions/suggest-add-self-issue-128042.stderr b/tests/ui/suggestions/suggest-add-self-issue-128042.stderr new file mode 100644 index 00000000000..49ac1563250 --- /dev/null +++ b/tests/ui/suggestions/suggest-add-self-issue-128042.stderr @@ -0,0 +1,22 @@ +error: expected parameter name, found `*` + --> $DIR/suggest-add-self-issue-128042.rs:6:12 + | +LL | fn oof(*mut Self) { + | ^ expected parameter name + +error[E0424]: expected value, found module `self` + --> $DIR/suggest-add-self-issue-128042.rs:7:9 + | +LL | fn oof(*mut Self) { + | --- this function doesn't have a `self` parameter +LL | self.state = 1; + | ^^^^ `self` value is a keyword only available in methods with a `self` parameter + | +help: add a `self` receiver parameter to make the associated `fn` a method + | +LL | fn oof(&self, *mut Self) { + | ++++++ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0424`. | 
