Skip to content

Conversation

lyming2007
Copy link

…rpolation

modified:   compiler/rustc_passes/src/liveness.rs

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 24, 2022
@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @oli-obk (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2022
@TaKO8Ki
Copy link
Member

TaKO8Ki commented Aug 24, 2022

Could you add a ui test about this suggestion?
https://rustc-dev-guide.rust-lang.org/tests/ui.html

@lyming2007
Copy link
Author

Could you add a ui test about this suggestion? https://rustc-dev-guide.rust-lang.org/tests/ui.html
Given this test case:

cat main.rs
fn foo(xyza: &str) {
    let _ = "{xyza}";
}


fn main() {
  foo("aaa");
}

The problem for this specific issue is we're improving the warning for unused variables. But the ui test script won't emit the unused variables with the command -A unused. Here is the full command line of the testing script:

/home/lym/rust3/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /home/lym/rust3/rust/src/test/ui/type/issue-100584.rs -Zthreads=1 --target=x86_64-unknown-linux-gnu --error-format json --json future-incompat -Ccodegen-units=1 -Zui-testing -Zdeduplicate-diagnostics=no -Cstrip=debuginfo --emit metadata -C prefer-dynamic --out-dir /home/lym/rust3/rust/build/x86_64-unknown-linux-gnu/test/ui/type/issue-100584 -A unused -Crpath -Cdebuginfo=0 -Lnative=/home/lym/rust3/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers -L /home/lym/rust3/rust/build/x86_64-unknown-linux-gnu/test/ui/type/issue-100584/auxiliary

Thus, the output of this case is nothing and always failed.
Could you give me more suggestions on this situation?

@oli-obk
Copy link
Contributor

oli-obk commented Aug 24, 2022

You can try adding #![deny(unused)] to the file

@lyming2007
Copy link
Author

yes that works. thanks

…rpolation

	modified:   compiler/rustc_passes/src/liveness.rs

	new file:   src/test/ui/type/issue-100584.rs
	new file:   src/test/ui/type/issue-100584.stderr
@oli-obk
Copy link
Contributor

oli-obk commented Aug 30, 2022

@bors r+

Thanks! and sorry for the let/else confusion

@bors
Copy link
Collaborator

bors commented Aug 30, 2022

📌 Commit 39ffabb has been approved by oli-obk

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 Aug 30, 2022
@lyming2007
Copy link
Author

@bors r+

Thanks! and sorry for the let/else confusion

No worries. Thank you for all useful suggestions, especially for beginners like me. I've learned a lot from this back-and-forth work with you. Appreciate it!

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 30, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#99517 (Display raw pointer as *{mut,const} T instead of *-ptr in errors)
 - rust-lang#99928 (Do not leak type variables from opaque type relation)
 - rust-lang#100473 (Attempt to normalize `FnDef` signature in `InferCtxt::cmp`)
 - rust-lang#100653 (Move the cast_float_to_int fallback code to GCC)
 - rust-lang#100941 (Point at the string inside literal and mention if we need string inte…)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 467d2c1 into rust-lang:master Aug 30, 2022
@rustbot rustbot added this to the 1.65.0 milestone Aug 30, 2022
@lyming2007 lyming2007 deleted the issue-100584 branch September 2, 2022 16:10
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.

6 participants