From bdd2e0eb5649f6393bf644a822c7f6be6da9a781 Mon Sep 17 00:00:00 2001 From: Debian Rust Maintainers Date: Sun, 20 Dec 2020 18:52:10 +0000 Subject: [PATCH] u-update-version-check Bug: https://github.com/rust-lang/rust/issues/79010 Gbp-Pq: Name u-update-version-check.patch --- .../feature-gates/feature-gate-cfg-version.rs | 6 ++---- .../feature-gate-cfg-version.stderr | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/test/ui/feature-gates/feature-gate-cfg-version.rs b/src/test/ui/feature-gates/feature-gate-cfg-version.rs index c29ef99945..4af6acdfad 100644 --- a/src/test/ui/feature-gates/feature-gate-cfg-version.rs +++ b/src/test/ui/feature-gates/feature-gate-cfg-version.rs @@ -27,14 +27,12 @@ fn bar() -> bool { false } //~^ ERROR `cfg(version)` is experimental and subject to change fn bar() -> bool { true } -#[cfg(version("1.65536.2"))] +#[cfg(version("1.65536.2"))] //~ ERROR: invalid version literal //~^ ERROR `cfg(version)` is experimental and subject to change fn version_check_bug() {} fn main() { - // This should fail but due to a bug in version_check `1.65536.2` is interpreted as `1.2`. - // See https://github.com/SergioBenitez/version_check/issues/11 - version_check_bug(); + version_check_bug(); //~ ERROR: cannot find function `version_check_bug` in this scope assert!(foo()); assert!(bar()); assert!(cfg!(version("1.42"))); //~ ERROR `cfg(version)` is experimental and subject to change diff --git a/src/test/ui/feature-gates/feature-gate-cfg-version.stderr b/src/test/ui/feature-gates/feature-gate-cfg-version.stderr index bdf160b5a0..93442facf4 100644 --- a/src/test/ui/feature-gates/feature-gate-cfg-version.stderr +++ b/src/test/ui/feature-gates/feature-gate-cfg-version.stderr @@ -118,8 +118,14 @@ LL | #[cfg(version("1.65536.2"))] = note: see issue #64796 for more information = help: add `#![feature(cfg_version)]` to the crate attributes to enable +error: invalid version literal + --> $DIR/feature-gate-cfg-version.rs:30:15 + | +LL | #[cfg(version("1.65536.2"))] + | ^^^^^^^^^^^ + error[E0658]: `cfg(version)` is experimental and subject to change - --> $DIR/feature-gate-cfg-version.rs:40:18 + --> $DIR/feature-gate-cfg-version.rs:38:18 | LL | assert!(cfg!(version("1.42"))); | ^^^^^^^^^^^^^^^ @@ -127,6 +133,13 @@ LL | assert!(cfg!(version("1.42"))); = note: see issue #64796 for more information = help: add `#![feature(cfg_version)]` to the crate attributes to enable -error: aborting due to 16 previous errors +error[E0425]: cannot find function `version_check_bug` in this scope + --> $DIR/feature-gate-cfg-version.rs:35:5 + | +LL | version_check_bug(); + | ^^^^^^^^^^^^^^^^^ not found in this scope + +error: aborting due to 18 previous errors -For more information about this error, try `rustc --explain E0658`. +Some errors have detailed explanations: E0425, E0658. +For more information about an error, try `rustc --explain E0425`. -- 2.30.2