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

Point at the string inside literal and mention if we need string inte… #100941

Merged
merged 1 commit into from
Aug 30, 2022

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
Collaborator

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

compiler/rustc_passes/src/liveness.rs Outdated Show resolved Hide resolved
compiler/rustc_passes/src/liveness.rs Outdated Show resolved Hide resolved
compiler/rustc_passes/src/liveness.rs Outdated Show resolved Hide resolved
compiler/rustc_passes/src/liveness.rs Outdated Show resolved Hide resolved
compiler/rustc_passes/src/liveness.rs Outdated Show resolved Hide resolved
src/test/ui/type/issue-100584.stderr Show resolved Hide resolved
compiler/rustc_passes/src/liveness.rs Show resolved Hide resolved
…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
Contributor

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