Skip to content

Commit fab6b27

Browse files
committed
feat: formating warning
1 parent 4cc9334 commit fab6b27

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

src/cargo/core/compiler/job_queue/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ impl<'cfg> DrainState<'cfg> {
953953

954954
for warning in output.warnings.iter() {
955955
let warning_with_package =
956-
format!("{}@{} {}", unit.pkg.name(), unit.pkg.version(), warning);
956+
format!("{}@{}: {}", unit.pkg.name(), unit.pkg.version(), warning);
957957

958958
bcx.config.shell().warn(warning_with_package)?;
959959
}

tests/testsuite/build_script.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3778,8 +3778,8 @@ fn warnings_emitted() {
37783778
[COMPILING] foo v0.5.0 ([..])
37793779
[RUNNING] `rustc [..]`
37803780
[RUNNING] `[..]`
3781-
warning: [email protected] foo
3782-
warning: [email protected] bar
3781+
warning: [email protected]: foo
3782+
warning: [email protected]: bar
37833783
[RUNNING] `rustc [..]`
37843784
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
37853785
",
@@ -3816,7 +3816,7 @@ fn warnings_emitted_when_build_script_panics() {
38163816
p.cargo("build")
38173817
.with_status(101)
38183818
.with_stdout("")
3819-
.with_stderr_contains("warning: [email protected] foo\nwarning: [email protected] bar")
3819+
.with_stderr_contains("warning: [email protected]: foo\nwarning: [email protected]: bar")
38203820
.run();
38213821
}
38223822

@@ -3929,8 +3929,8 @@ fn warnings_printed_on_vv() {
39293929
[COMPILING] bar v0.1.0
39303930
[RUNNING] `[..] rustc [..]`
39313931
[RUNNING] `[..]`
3932-
warning: [email protected] foo
3933-
warning: [email protected] bar
3932+
warning: [email protected]: foo
3933+
warning: [email protected]: bar
39343934
[RUNNING] `[..] rustc [..]`
39353935
[COMPILING] foo v0.5.0 ([..])
39363936
[RUNNING] `[..] rustc [..]`

tests/testsuite/build_script_env.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ fn rustc_bootstrap() {
137137
// NOTE: uses RUSTC_BOOTSTRAP so it will be propagated to rustc
138138
// (this matters when tests are being run with a beta or stable cargo)
139139
.env("RUSTC_BOOTSTRAP", "1")
140-
.with_stderr_contains("warning: [email protected] Cannot set `RUSTC_BOOTSTRAP=1` [..]")
140+
.with_stderr_contains("warning: [email protected]: Cannot set `RUSTC_BOOTSTRAP=1` [..]")
141141
.run();
142142
// RUSTC_BOOTSTRAP set to the name of the library should warn
143143
p.cargo("check")
144144
.env("RUSTC_BOOTSTRAP", "has_dashes")
145-
.with_stderr_contains("warning: [email protected] Cannot set `RUSTC_BOOTSTRAP=1` [..]")
145+
.with_stderr_contains("warning: [email protected]: Cannot set `RUSTC_BOOTSTRAP=1` [..]")
146146
.run();
147147
// RUSTC_BOOTSTRAP set to some random value should error
148148
p.cargo("check")
@@ -169,7 +169,7 @@ fn rustc_bootstrap() {
169169
// NOTE: uses RUSTC_BOOTSTRAP so it will be propagated to rustc
170170
// (this matters when tests are being run with a beta or stable cargo)
171171
.env("RUSTC_BOOTSTRAP", "1")
172-
.with_stderr_contains("warning: [email protected] Cannot set `RUSTC_BOOTSTRAP=1` [..]")
172+
.with_stderr_contains("warning: [email protected]: Cannot set `RUSTC_BOOTSTRAP=1` [..]")
173173
.run();
174174
// RUSTC_BOOTSTRAP conditionally set when there's no library should error (regardless of the value)
175175
p.cargo("check")

tests/testsuite/build_script_extra_link_arg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ fn cdylib_link_arg_transitive() {
204204
[COMPILING] bar v1.0.0 [..]
205205
[RUNNING] `rustc --crate-name build_script_build bar/build.rs [..]
206206
[RUNNING] `[..]build-script-build[..]
207-
warning: [email protected] cargo:rustc-link-arg-cdylib was specified in the build script of bar v1.0.0 \
207+
warning: [email protected]: cargo:rustc-link-arg-cdylib was specified in the build script of bar v1.0.0 \
208208
([ROOT]/foo/bar), but that package does not contain a cdylib target
209209
210210
Allowing this was an unintended change in the 1.50 release, and may become an error in \

tests/testsuite/features2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,7 +1807,7 @@ fn shared_dep_same_but_dependencies() {
18071807
[COMPILING] dep [..]
18081808
[COMPILING] bin2 [..]
18091809
[COMPILING] bin1 [..]
1810-
warning: [email protected] feat: enabled
1810+
warning: [email protected]: feat: enabled
18111811
[FINISHED] [..]
18121812
",
18131813
)
@@ -1823,7 +1823,7 @@ warning: [email protected] feat: enabled
18231823
[FRESH] subdep [..]
18241824
[FRESH] dep [..]
18251825
[FRESH] bin1 [..]
1826-
warning: [email protected] feat: enabled
1826+
warning: [email protected]: feat: enabled
18271827
[FRESH] bin2 [..]
18281828
[FINISHED] [..]
18291829
",

tests/testsuite/warn_on_failure.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn warning_on_lib_failure() {
105105
.with_stderr_contains("[UPDATING] `[..]` index")
106106
.with_stderr_contains("[DOWNLOADED] bar v0.0.1 ([..])")
107107
.with_stderr_contains("[COMPILING] bar v0.0.1")
108-
.with_stderr_contains(&format!("[WARNING] [email protected] {}", WARNING1))
109-
.with_stderr_contains(&format!("[WARNING] [email protected] {}", WARNING2))
108+
.with_stderr_contains(&format!("[WARNING] [email protected]: {}", WARNING1))
109+
.with_stderr_contains(&format!("[WARNING] [email protected]: {}", WARNING2))
110110
.run();
111111
}

0 commit comments

Comments
 (0)