Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test for #92481 #105630

Merged
merged 2 commits into from
Dec 14, 2022
Merged

Add a test for #92481 #105630

merged 2 commits into from
Dec 14, 2022

Conversation

albertlarsan68
Copy link
Member

@albertlarsan68 albertlarsan68 commented Dec 12, 2022

The test was copied ad-hoc from #92481, but I can't get the test to pass, because of needing to get twice the same error on the last line of the source.

Closes #92481

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 12, 2022
@compiler-errors
Copy link
Member

compiler-errors commented Dec 12, 2022

It's best to try to minimize these tests, even if they're found via a fuzzer. This one should be possible to write a UI test for, and reproduces the ICE on beta:

fn r({) {
    Ok {
        d..||_=m
    }
}

@albertlarsan68
Copy link
Member Author

Thanks @compiler-errors for the testable test case!

@albertlarsan68
Copy link
Member Author

r? compiler

@TaKO8Ki
Copy link
Member

TaKO8Ki commented Dec 13, 2022

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 13, 2022

📌 Commit 2315012 has been approved by TaKO8Ki

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 13, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Dec 13, 2022
Add a test for rust-lang#92481

The test was copied ad-hoc from rust-lang#92481, but I can't get the test to pass, because of needing to get twice the same error on the last line of the source.

Closes rust-lang#92481
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 14, 2022
Add a test for rust-lang#92481

The test was copied ad-hoc from rust-lang#92481, but I can't get the test to pass, because of needing to get twice the same error on the last line of the source.

Closes rust-lang#92481
@matthiaskrgr
Copy link
Member

@bors r- failed in a rollup
#105687

failures:

---- [ui] src/test/ui/typeck/issue-92481.rs stdout ----
diff of stderr:

32	   |
33	LL |         d..||_=m
34	   |         ^ field does not exist
+	  --> $SRC_DIR/core/src/result.rs:LL:COL
35	   |
-	  ::: $SRC_DIR/core/src/result.rs:LL:COL
-	   |
-	LL |     Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
-	   |     -- `Result<_, _>::Ok` defined here
+	   = note: `Result<_, _>::Ok` defined here
40	   |
41	help: `Result<_, _>::Ok` is a tuple variant, use the appropriate syntax
42	   |


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/typeck/issue-92481/issue-92481.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args typeck/issue-92481.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/typeck/issue-92481.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/typeck/issue-92481" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/typeck/issue-92481/auxiliary"
stdout: none
--- stderr -------------------------------
error: expected parameter name, found `{`
  --> /checkout/src/test/ui/typeck/issue-92481.rs:5:6
   |
LL | fn r({) {
   |      ^ expected parameter name

error: expected one of `,`, `:`, or `}`, found `..`
  --> /checkout/src/test/ui/typeck/issue-92481.rs:5:6
   |
LL | fn r({) {
   |      ^ unclosed delimiter
LL |     Ok {             //~ ERROR mismatched types [E0308]
LL |         d..||_=m
   |          -^
   |          |
   |          help: `}` may belong here

error[E0425]: cannot find value `d` in this scope
  --> /checkout/src/test/ui/typeck/issue-92481.rs:7:9
   |
LL |         d..||_=m
   |         ^ not found in this scope
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu

error[E0425]: cannot find value `m` in this scope
  --> /checkout/src/test/ui/typeck/issue-92481.rs:7:16
   |
LL |         d..||_=m
   |                ^ not found in this scope

error[E0559]: variant `Result<_, _>::Ok` has no field named `d`
  --> /checkout/src/test/ui/typeck/issue-92481.rs:7:9
   |
LL |         d..||_=m
   |         ^ field does not exist
  --> /rustc/FAKE_PREFIX/library/core/src/result.rs:508:5
   |
   = note: `Result<_, _>::Ok` defined here
   |
help: `Result<_, _>::Ok` is a tuple variant, use the appropriate syntax
   |
LL |     Result<_, _>::Ok(/* fields */)
   |

error[E0308]: mismatched types
  --> /checkout/src/test/ui/typeck/issue-92481.rs:6:5
   |
LL |   fn r({) {
   |           - help: a return type might be missing here: `-> _`
LL | /     Ok {             //~ ERROR mismatched types [E0308]
LL | |         d..||_=m
LL | |     }
   | |_____^ expected `()`, found enum `Result`
   |
   = note: expected unit type `()`
                   found enum `Result<_, _>`

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0308, E0425, E0559.
For more information about an error, try `rustc --explain E0308`.
------------------------------------------



failures:
    [ui] src/test/ui/typeck/issue-92481.rs

test result: FAILED. 13860 passed; 1 failed; 135 ignored; 0 measured; 0 filtered out; finished in 132.58s

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 14, 2022
@albertlarsan68
Copy link
Member Author

Rebased and re-blessed, so @rustbot ready now.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 14, 2022
@TaKO8Ki
Copy link
Member

TaKO8Ki commented Dec 14, 2022

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 14, 2022

📌 Commit f7db4f0 has been approved by TaKO8Ki

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 14, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 14, 2022
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#105399 (Use more LFS functions.)
 - rust-lang#105578 (Fix transmutes between pointers in different address spaces (e.g. fn ptrs on AVR))
 - rust-lang#105598 (explain mem::forget(env_lock) in fork/exec)
 - rust-lang#105624 (Fix unsoundness in bootstrap cache code)
 - rust-lang#105630 (Add a test for rust-lang#92481)
 - rust-lang#105684 (Improve rustdoc markdown variable naming)
 - rust-lang#105697 (Remove fee1-dead from reviewers)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e2c9823 into rust-lang:master Dec 14, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 14, 2022
@albertlarsan68 albertlarsan68 deleted the test-92481 branch December 15, 2022 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: no type for local variable local _=m
6 participants