mirror of https://github.com/rust-lang/cargo
refactor(implicit_features): Use lint description for title
This commit is contained in:
parent
af1e5b3623
commit
495f94e80e
|
@ -192,7 +192,7 @@ pub fn check_implicit_features(
|
|||
}
|
||||
let level = lint_level.to_diagnostic_level();
|
||||
let manifest_path = rel_cwd_manifest_path(path, gctx);
|
||||
let message = level.title("unused optional dependency").snippet(
|
||||
let message = level.title(IMPLICIT_FEATURES.desc).snippet(
|
||||
Snippet::source(manifest.contents())
|
||||
.origin(&manifest_path)
|
||||
.annotation(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<svg width="740px" height="218px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="944px" height="218px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
|
@ -20,7 +20,7 @@
|
|||
<rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
|
||||
|
||||
<text xml:space="preserve" class="container fg">
|
||||
<tspan x="10px" y="28px"><tspan class="fg-yellow bold">warning</tspan><tspan>: </tspan><tspan class="bold">unused optional dependency</tspan>
|
||||
<tspan x="10px" y="28px"><tspan class="fg-yellow bold">warning</tspan><tspan>: </tspan><tspan class="bold">implicit features for optional dependencies is deprecated and will be unavailable in the 2024 edition</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-bright-blue bold">--></tspan><tspan> Cargo.toml:8:1</tspan>
|
||||
</tspan>
|
||||
|
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
@ -1,4 +1,4 @@
|
|||
<svg width="740px" height="146px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="928px" height="146px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
|
@ -19,7 +19,7 @@
|
|||
<rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
|
||||
|
||||
<text xml:space="preserve" class="container fg">
|
||||
<tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error</tspan><tspan>: </tspan><tspan class="bold">unused optional dependency</tspan>
|
||||
<tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error</tspan><tspan>: </tspan><tspan class="bold">implicit features for optional dependencies is deprecated and will be unavailable in the 2024 edition</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-bright-blue bold">--></tspan><tspan> Cargo.toml:9:1</tspan>
|
||||
</tspan>
|
||||
|
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
@ -1,4 +1,4 @@
|
|||
<svg width="740px" height="218px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="944px" height="218px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
|
@ -20,7 +20,7 @@
|
|||
<rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
|
||||
|
||||
<text xml:space="preserve" class="container fg">
|
||||
<tspan x="10px" y="28px"><tspan class="fg-yellow bold">warning</tspan><tspan>: </tspan><tspan class="bold">unused optional dependency</tspan>
|
||||
<tspan x="10px" y="28px"><tspan class="fg-yellow bold">warning</tspan><tspan>: </tspan><tspan class="bold">implicit features for optional dependencies is deprecated and will be unavailable in the 2024 edition</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-bright-blue bold">--></tspan><tspan> Cargo.toml:9:1</tspan>
|
||||
</tspan>
|
||||
|
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
@ -874,7 +874,7 @@ fn cargo_lints_underscore_supported() {
|
|||
.masquerade_as_nightly_cargo(&["-Zcargo-lints"])
|
||||
.with_stderr(
|
||||
"\
|
||||
warning: unused optional dependency
|
||||
warning: implicit features for optional dependencies is deprecated and will be unavailable in the 2024 edition
|
||||
--> Cargo.toml:12:17
|
||||
|
|
||||
12 | bar = { version = \"0.1.0\", optional = true }
|
||||
|
|
Loading…
Reference in New Issue