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 explanatory message for [#must_use] in ops #103761

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

chenyukang
Copy link
Member

Fixes #103320

@rustbot
Copy link
Collaborator

rustbot commented Oct 30, 2022

r? @m-ou-se

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 30, 2022
@rustbot
Copy link
Collaborator

rustbot commented Oct 30, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@chenyukang
Copy link
Member Author

r? rust-lang/library

@rustbot
Copy link
Collaborator

rustbot commented Dec 9, 2022

Team or group rust-lang/library not found.

rust-lang team names can be found at https://github.com/rust-lang/team/tree/master/teams.
Reviewer group names can be found in triagebot.toml in this repo.

@chenyukang
Copy link
Member Author

r? rust-lang/libs

@rustbot rustbot assigned joshtriplett and unassigned m-ou-se Dec 9, 2022
@compiler-errors
Copy link
Member

@chenyukang can you change this to be a bit more in-line with the unused message for operators?

warning: unused arithmetic operation that must be used
 --> src/main.rs:4:5
  |
4 |     1 + 2;
  |     ^^^^^ the arithmetic operation produces a value
  |
  = note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
  |
4 |     let _ = 1 + 2;
  |     +++++++

@chenyukang
Copy link
Member Author

@chenyukang can you change this to be a bit more in-line with the unused message for operators?

warning: unused arithmetic operation that must be used
 --> src/main.rs:4:5
  |
4 |     1 + 2;
  |     ^^^^^ the arithmetic operation produces a value
  |
  = note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
  |
4 |     let _ = 1 + 2;
  |     +++++++

Updated, thanks!

@jyn514
Copy link
Member

jyn514 commented Jan 30, 2023

r? @compiler-errors

@chenyukang chenyukang force-pushed the yukang/fix-103320-must-use branch 3 times, most recently from 95ac25d to 6e84f7d Compare February 1, 2023 09:32
@rustbot rustbot added the A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic label Feb 1, 2023
@rustbot
Copy link
Collaborator

rustbot commented Feb 1, 2023

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

@compiler-errors
Copy link
Member

Looks fine to me, any follow-ups can be iterated on in another PR I think.

@bors r+

@bors
Copy link
Contributor

bors commented Feb 2, 2023

📌 Commit 6e84f7d has been approved by compiler-errors

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 Feb 2, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Feb 2, 2023
…use, r=compiler-errors

Add explanatory message for [#must_use] in ops

Fixes rust-lang#103320
@bors
Copy link
Contributor

bors commented Feb 2, 2023

⌛ Testing commit 6e84f7d with merge b0ad27afaac9feafd139ce80cdddee23d7c251a4...

@bors
Copy link
Contributor

bors commented Feb 2, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 2, 2023
@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 6, 2023

📌 Commit cb55d10 has been approved by compiler-errors

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 Feb 6, 2023
@bors
Copy link
Contributor

bors commented Feb 6, 2023

⌛ Testing commit cb55d10 with merge 43cffee12404cb6ea088bd1e9cd2ba72f5bbb4a3...

@bors
Copy link
Contributor

bors commented Feb 6, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 6, 2023
@estebank
Copy link
Contributor

estebank commented Feb 6, 2023

@bors retry

@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 Feb 6, 2023
@bors
Copy link
Contributor

bors commented Feb 6, 2023

⌛ Testing commit cb55d10 with merge 044a28a...

@chenyukang
Copy link
Member Author

Seems CI is not stable, building get an error:

[2627/3025] Linking CXX static library lib\libLLVMWebAssemblyDisassembler.a
FAILED: lib/libLLVMWebAssemblyDisassembler.a 
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E rm -f lib\libLLVMWebAssemblyDisassembler.a && D:\a\rust\rust\mingw64\bin\ar.exe qc lib\libLLVMWebAssemblyDisassembler.a  lib/Target/WebAssembly/Disassembler/CMakeFiles/LLVMWebAssemblyDisassembler.dir/WebAssemblyDisassembler.cpp.obj && D:\a\rust\rust\mingw64\bin\ranlib.exe lib\libLLVMWebAssemblyDisassembler.a && cd ."
D:\a\rust\rust\mingw64\bin\ranlib.exe: could not create temporary file whilst writing archive: no more archived files

[2628/3025] Linking CXX static library lib\libLLVMSelectionDAG.a
[2629/3025] Building C object tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/object.c.obj
[2630/3025] Building C object tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/helpers.c.obj
[2631/3025] Linking CXX executable bin\llvm-bcanalyzer.exe
[2632/3025] Linking CXX executable bin\llvm-profdata.exe
[2633/3025] Linking CXX executable bin\llvm-as.exe
[2634/3025] Linking CXX static library lib\libLLVMPasses.a
ninja: build stopped: subcommand failed.
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1

build script failed, must exit now', C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.48\src\lib.rs:975:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
	finished in 229.322 seconds

@bors
Copy link
Contributor

bors commented Feb 6, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing 044a28a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 6, 2023
@bors bors merged commit 044a28a into rust-lang:master Feb 6, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 6, 2023
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-mingw-2 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[2625/3025] Linking CXX static library lib\libLLVMDWARFLinker.a
[2626/3025] Building C object tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/disassemble.c.obj
[2627/3025] Linking CXX static library lib\libLLVMWebAssemblyDisassembler.a
FAILED: lib/libLLVMWebAssemblyDisassembler.a 
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E rm -f lib\libLLVMWebAssemblyDisassembler.a && D:\a\rust\rust\mingw64\bin\ar.exe qc lib\libLLVMWebAssemblyDisassembler.a  lib/Target/WebAssembly/Disassembler/CMakeFiles/LLVMWebAssemblyDisassembler.dir/WebAssemblyDisassembler.cpp.obj && D:\a\rust\rust\mingw64\bin\ranlib.exe lib\libLLVMWebAssemblyDisassembler.a && cd ."
D:\a\rust\rust\mingw64\bin\ranlib.exe: could not create temporary file whilst writing archive: no more archived files
[2628/3025] Linking CXX static library lib\libLLVMSelectionDAG.a
[2629/3025] Building C object tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/object.c.obj
[2630/3025] Building C object tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/helpers.c.obj
[2631/3025] Linking CXX executable bin\llvm-bcanalyzer.exe
[2631/3025] Linking CXX executable bin\llvm-bcanalyzer.exe
[2632/3025] Linking CXX executable bin\llvm-profdata.exe
[2633/3025] Linking CXX executable bin\llvm-as.exe
[2634/3025] Linking CXX static library lib\libLLVMPasses.a
ninja: build stopped: subcommand failed.
command did not execute successfully, got: exit code: 1


build script failed, must exit now', C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.48\src\lib.rs:975:5
 finished in 229.322 seconds
Build completed successfully in 0:05:05
Build completed successfully in 0:05:05
make: *** [Makefile:80: ci-mingw-subset-2] Error 1

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (044a28a): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-3.2%, -2.1%] 4
All ❌✅ (primary) - - 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add explanatory message for [#must_use] on std::ops::Add et al