From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/cfg/cfg-method-receiver-ok.rs | 14 +++++++++++++ src/test/ui/cfg/cfg-method-receiver.rs | 11 ++++++++++ src/test/ui/cfg/cfg-method-receiver.stderr | 24 ++++++++++++++++++++++ src/test/ui/cfg/cfg-panic.rs | 3 --- ...e-compat-crate-attributes-using-cfg_attr.stderr | 2 +- 5 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 src/test/ui/cfg/cfg-method-receiver-ok.rs create mode 100644 src/test/ui/cfg/cfg-method-receiver.rs create mode 100644 src/test/ui/cfg/cfg-method-receiver.stderr (limited to 'src/test/ui/cfg') diff --git a/src/test/ui/cfg/cfg-method-receiver-ok.rs b/src/test/ui/cfg/cfg-method-receiver-ok.rs new file mode 100644 index 000000000..61ad3b8c1 --- /dev/null +++ b/src/test/ui/cfg/cfg-method-receiver-ok.rs @@ -0,0 +1,14 @@ +// check-pass + +macro_rules! foo { + () => { + #[allow(unreachable_patterns)] + { + 123i32 + } + }; +} + +fn main() { + let _ = foo!().abs(); +} diff --git a/src/test/ui/cfg/cfg-method-receiver.rs b/src/test/ui/cfg/cfg-method-receiver.rs new file mode 100644 index 000000000..71134ff17 --- /dev/null +++ b/src/test/ui/cfg/cfg-method-receiver.rs @@ -0,0 +1,11 @@ +macro_rules! cbor_map { + ($key:expr) => { + $key.signum(); + //~^ ERROR can't call method `signum` on ambiguous numeric type `{integer}` [E0689] + }; +} + +fn main() { + cbor_map! { #[cfg(test)] 4}; + //~^ ERROR removing an expression is not supported in this position +} diff --git a/src/test/ui/cfg/cfg-method-receiver.stderr b/src/test/ui/cfg/cfg-method-receiver.stderr new file mode 100644 index 000000000..5767a7c1b --- /dev/null +++ b/src/test/ui/cfg/cfg-method-receiver.stderr @@ -0,0 +1,24 @@ +error: removing an expression is not supported in this position + --> $DIR/cfg-method-receiver.rs:9:17 + | +LL | cbor_map! { #[cfg(test)] 4}; + | ^^^^^^^^^^^^ + +error[E0689]: can't call method `signum` on ambiguous numeric type `{integer}` + --> $DIR/cfg-method-receiver.rs:3:14 + | +LL | $key.signum(); + | ^^^^^^ +... +LL | cbor_map! { #[cfg(test)] 4}; + | --------------------------- in this macro invocation + | + = note: this error originates in the macro `cbor_map` (in Nightly builds, run with -Z macro-backtrace for more info) +help: you must specify a concrete type for this numeric value, like `i32` + | +LL | cbor_map! { #[cfg(test)] 4_i32}; + | ~~~~~ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0689`. diff --git a/src/test/ui/cfg/cfg-panic.rs b/src/test/ui/cfg/cfg-panic.rs index fb3e5059c..2de72d54a 100644 --- a/src/test/ui/cfg/cfg-panic.rs +++ b/src/test/ui/cfg/cfg-panic.rs @@ -1,9 +1,6 @@ // build-pass // compile-flags: -C panic=unwind // needs-unwind -// ignore-emscripten no panic_unwind implementation -// ignore-wasm32 no panic_unwind implementation -// ignore-wasm64 no panic_unwind implementation #[cfg(panic = "abort")] diff --git a/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr b/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr index b52535ffd..9ce4710d6 100644 --- a/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr +++ b/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr @@ -4,9 +4,9 @@ error: `crate_type` within an `#![cfg_attr] attribute is deprecated` LL | #![cfg_attr(foo, crate_type="bin")] | ^^^^^^^^^^^^^^^^ | - = note: `#[deny(deprecated_cfg_attr_crate_type_name)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #91632 + = note: `#[deny(deprecated_cfg_attr_crate_type_name)]` on by default error: `crate_name` within an `#![cfg_attr] attribute is deprecated` --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:9:18 -- cgit v1.2.3