diff options
| author | Trevor Gross <t.gross35@gmail.com> | 2025-07-08 22:50:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-08 22:50:26 -0500 |
| commit | a71dbcd6790aa447e7c446def25ad2aa8b848c62 (patch) | |
| tree | e67dc912609f2663ddb89237405f4e02642806cb /tests/ui/resolve | |
| parent | d069a7cf1443a5095d947ad49642c750fad03a5e (diff) | |
| parent | 236b392904d234d9ec2968c55ae20132405a555d (diff) | |
| download | rust-a71dbcd6790aa447e7c446def25ad2aa8b848c62.tar.gz rust-a71dbcd6790aa447e7c446def25ad2aa8b848c62.zip | |
Rollup merge of #143177 - xizheyin:143134, r=lcnr
Remove false label when `self` resolve failure does not relate to macro Fixes rust-lang/rust#143134 In the first commit, I did some code-clean, moving `suggest*` to `suggestions/` dir. In the second, commit, I added ui test. In the third, I change the code, and present the test result. r? compiler
Diffstat (limited to 'tests/ui/resolve')
| -rw-r--r-- | tests/ui/resolve/false-self-in-macro-issue-143134.rs | 10 | ||||
| -rw-r--r-- | tests/ui/resolve/false-self-in-macro-issue-143134.stderr | 9 | ||||
| -rw-r--r-- | tests/ui/resolve/suggestions/auxiliary/suggest-constructor-cycle-error.rs (renamed from tests/ui/resolve/auxiliary/suggest-constructor-cycle-error.rs) | 0 | ||||
| -rw-r--r-- | tests/ui/resolve/suggestions/suggest-builder-fn.rs (renamed from tests/ui/resolve/suggest-builder-fn.rs) | 0 | ||||
| -rw-r--r-- | tests/ui/resolve/suggestions/suggest-builder-fn.stderr (renamed from tests/ui/resolve/suggest-builder-fn.stderr) | 0 | ||||
| -rw-r--r-- | tests/ui/resolve/suggestions/suggest-constructor-cycle-error.rs (renamed from tests/ui/resolve/suggest-constructor-cycle-error.rs) | 0 | ||||
| -rw-r--r-- | tests/ui/resolve/suggestions/suggest-constructor-cycle-error.stderr (renamed from tests/ui/resolve/suggest-constructor-cycle-error.stderr) | 0 | ||||
| -rw-r--r-- | tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.fixed (renamed from tests/ui/resolve/suggest-import-without-clobbering-attrs.fixed) | 0 | ||||
| -rw-r--r-- | tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.rs (renamed from tests/ui/resolve/suggest-import-without-clobbering-attrs.rs) | 0 | ||||
| -rw-r--r-- | tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.stderr (renamed from tests/ui/resolve/suggest-import-without-clobbering-attrs.stderr) | 0 | ||||
| -rw-r--r-- | tests/ui/resolve/suggestions/suggest-path-for-tuple-struct.rs (renamed from tests/ui/resolve/suggest-path-for-tuple-struct.rs) | 0 | ||||
| -rw-r--r-- | tests/ui/resolve/suggestions/suggest-path-for-tuple-struct.stderr (renamed from tests/ui/resolve/suggest-path-for-tuple-struct.stderr) | 0 | ||||
| -rw-r--r-- | tests/ui/resolve/suggestions/suggest-path-instead-of-mod-dot-item.rs (renamed from tests/ui/resolve/suggest-path-instead-of-mod-dot-item.rs) | 0 | ||||
| -rw-r--r-- | tests/ui/resolve/suggestions/suggest-path-instead-of-mod-dot-item.stderr (renamed from tests/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr) | 0 |
14 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/resolve/false-self-in-macro-issue-143134.rs b/tests/ui/resolve/false-self-in-macro-issue-143134.rs new file mode 100644 index 00000000000..0983b8b3dc3 --- /dev/null +++ b/tests/ui/resolve/false-self-in-macro-issue-143134.rs @@ -0,0 +1,10 @@ +trait T { + fn f(self); + } + impl T for () { + fn f(self) { + let self = (); //~ ERROR expected unit struct, unit variant or constant, found local variable `self` + } +} + +fn main() {} diff --git a/tests/ui/resolve/false-self-in-macro-issue-143134.stderr b/tests/ui/resolve/false-self-in-macro-issue-143134.stderr new file mode 100644 index 00000000000..48c979575ea --- /dev/null +++ b/tests/ui/resolve/false-self-in-macro-issue-143134.stderr @@ -0,0 +1,9 @@ +error[E0424]: expected unit struct, unit variant or constant, found local variable `self` + --> $DIR/false-self-in-macro-issue-143134.rs:6:13 + | +LL | let self = (); + | ^^^^ `self` value is a keyword and may not be bound to variables or shadowed + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0424`. diff --git a/tests/ui/resolve/auxiliary/suggest-constructor-cycle-error.rs b/tests/ui/resolve/suggestions/auxiliary/suggest-constructor-cycle-error.rs index 8de68c38bc3..8de68c38bc3 100644 --- a/tests/ui/resolve/auxiliary/suggest-constructor-cycle-error.rs +++ b/tests/ui/resolve/suggestions/auxiliary/suggest-constructor-cycle-error.rs diff --git a/tests/ui/resolve/suggest-builder-fn.rs b/tests/ui/resolve/suggestions/suggest-builder-fn.rs index 959675ef2c9..959675ef2c9 100644 --- a/tests/ui/resolve/suggest-builder-fn.rs +++ b/tests/ui/resolve/suggestions/suggest-builder-fn.rs diff --git a/tests/ui/resolve/suggest-builder-fn.stderr b/tests/ui/resolve/suggestions/suggest-builder-fn.stderr index 9c5eed35ccf..9c5eed35ccf 100644 --- a/tests/ui/resolve/suggest-builder-fn.stderr +++ b/tests/ui/resolve/suggestions/suggest-builder-fn.stderr diff --git a/tests/ui/resolve/suggest-constructor-cycle-error.rs b/tests/ui/resolve/suggestions/suggest-constructor-cycle-error.rs index c23d6788eef..c23d6788eef 100644 --- a/tests/ui/resolve/suggest-constructor-cycle-error.rs +++ b/tests/ui/resolve/suggestions/suggest-constructor-cycle-error.rs diff --git a/tests/ui/resolve/suggest-constructor-cycle-error.stderr b/tests/ui/resolve/suggestions/suggest-constructor-cycle-error.stderr index c6ec2465a43..c6ec2465a43 100644 --- a/tests/ui/resolve/suggest-constructor-cycle-error.stderr +++ b/tests/ui/resolve/suggestions/suggest-constructor-cycle-error.stderr diff --git a/tests/ui/resolve/suggest-import-without-clobbering-attrs.fixed b/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.fixed index 607c9af4927..607c9af4927 100644 --- a/tests/ui/resolve/suggest-import-without-clobbering-attrs.fixed +++ b/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.fixed diff --git a/tests/ui/resolve/suggest-import-without-clobbering-attrs.rs b/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.rs index 6cc53fb1086..6cc53fb1086 100644 --- a/tests/ui/resolve/suggest-import-without-clobbering-attrs.rs +++ b/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.rs diff --git a/tests/ui/resolve/suggest-import-without-clobbering-attrs.stderr b/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.stderr index de65d695dd2..de65d695dd2 100644 --- a/tests/ui/resolve/suggest-import-without-clobbering-attrs.stderr +++ b/tests/ui/resolve/suggestions/suggest-import-without-clobbering-attrs.stderr diff --git a/tests/ui/resolve/suggest-path-for-tuple-struct.rs b/tests/ui/resolve/suggestions/suggest-path-for-tuple-struct.rs index c8bc3e79fe2..c8bc3e79fe2 100644 --- a/tests/ui/resolve/suggest-path-for-tuple-struct.rs +++ b/tests/ui/resolve/suggestions/suggest-path-for-tuple-struct.rs diff --git a/tests/ui/resolve/suggest-path-for-tuple-struct.stderr b/tests/ui/resolve/suggestions/suggest-path-for-tuple-struct.stderr index 68a5b550978..68a5b550978 100644 --- a/tests/ui/resolve/suggest-path-for-tuple-struct.stderr +++ b/tests/ui/resolve/suggestions/suggest-path-for-tuple-struct.stderr diff --git a/tests/ui/resolve/suggest-path-instead-of-mod-dot-item.rs b/tests/ui/resolve/suggestions/suggest-path-instead-of-mod-dot-item.rs index d5d6b13d62c..d5d6b13d62c 100644 --- a/tests/ui/resolve/suggest-path-instead-of-mod-dot-item.rs +++ b/tests/ui/resolve/suggestions/suggest-path-instead-of-mod-dot-item.rs diff --git a/tests/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr b/tests/ui/resolve/suggestions/suggest-path-instead-of-mod-dot-item.stderr index 5db943cd10d..5db943cd10d 100644 --- a/tests/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr +++ b/tests/ui/resolve/suggestions/suggest-path-instead-of-mod-dot-item.stderr |
