Relax a test to permit warnings to be emitted, too.#13415
Merged
bors merged 1 commit intorust-lang:masterfrom Feb 7, 2024
Merged
Relax a test to permit warnings to be emitted, too.#13415bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Collaborator
|
r? @weihanglo (rustbot has picked a reviewer for you, use r? to override) |
weihanglo
reviewed
Feb 7, 2024
tests/testsuite/fix.rs
Outdated
Comment on lines
+32
to
+35
| .with_stderr_line_without( | ||
| &["[ERROR] could not compile `foo` (lib) due to 1 previous error"], | ||
| &[], | ||
| ) |
Member
There was a problem hiding this comment.
Before rust-lang/rust#120550:
error[E0308]: mismatched types
--> src/lib.rs:8:35
|
8 | let _x: u32 = "a";
| --- ^^^ expected `u32`, found `&str`
| |
| expected due to this
For more information about this error, try `rustc --explain E0308`.
error: could not compile `foo` (lib test) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `foo` (lib) due to 1 previous error
This is what we'll have after rust-lang/rust#120550:
error[E0308]: mismatched types
Error: --> src/lib.rs:8:35
|
8 | let _x: u32 = "a";
| --- ^^^ expected `u32`, found `&str`
| |
| expected due to this
warning: variable does not need to be mutable
Warning: --> src/lib.rs:3:25
|
3 | let mut x = 3;
| ----^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
For more information about this error, try `rustc --explain E0308`.
warning: `foo` (lib) generated 1 warning
error: could not compile `foo` (lib) due to 1 previous error; 1 warning emitted
warning: build failed, waiting for other jobs to finish...
warning: `foo` (lib test) generated 1 warning (1 duplicate)
error: could not compile `foo` (lib test) due to 1 previous error; 1 warning emitted
I wonder if we could
Suggested change
| .with_stderr_line_without( | |
| &["[ERROR] could not compile `foo` (lib) due to 1 previous error"], | |
| &[], | |
| ) | |
| .with_stderr_contains("[ERROR] could not compile `foo` (lib) due to 1 previous error[..]") |
And have a TODO for updating this after rust-lang/rust#120550 landed. (though not required since it's not the point of this test)
This change is necessary to allow rustc to actually start emitting the warning about the unused `mut`
a7bd71e to
e60678f
Compare
weihanglo
approved these changes
Feb 7, 2024
Member
|
@bors r+ Thanks! I'll update the submodule shortly. |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-actions |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 7, 2024
Update cargo 14 commits in cdf84b69d0416c57ac9dc3459af80dfb4883d27a..ccc84ccec4b7340eb916aefda1cb3e2fe17d8e7b 2024-02-02 19:39:16 +0000 to 2024-02-07 15:37:49 +0000 - Relax a test to permit warnings to be emitted, too. (rust-lang/cargo#13415) - test: disable lldb test as it requires privileges to run on macOS (rust-lang/cargo#13416) - Update git2 (rust-lang/cargo#13412) - fix: Switch more notes/warnings to lowercase (rust-lang/cargo#13410) - Don't add the new package to workspace.members if there is no existing workspace in Cargo.toml. (rust-lang/cargo#13391) - Remove build metadata from curl-sys version. (rust-lang/cargo#13401) - Fix markdown line break in cargo-add (rust-lang/cargo#13400) - Remove `package.documentation` from the “before publishing” list. (rust-lang/cargo#13398) - chore(deps): update gix (rust-lang/cargo#13380) - chore(deps): update compatible (rust-lang/cargo#13379) - feat(update): Tell users when they are still behind (rust-lang/cargo#13372) - docs(changelog): Slight cleanup (rust-lang/cargo#13396) - Bump to 0.79.0; update changelog (rust-lang/cargo#13392) - doc: `[package]` doesn't require `version` field (rust-lang/cargo#13390) r? ghost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change is necessary to allow rustc to actually start emitting the warning about the unused
mutSee the test failure in rust-lang/rust#120550 (comment) for where this happens.