From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../assume-incomplete-release/assume-incomplete.rs | 38 ----- .../auxiliary/ver-cfg-rel.rs | 56 -------- src/test/ui/cfg/auxiliary/cfg_inner_static.rs | 7 - src/test/ui/cfg/cfg-attr-cfg.rs | 8 -- src/test/ui/cfg/cfg-attr-crate.rs | 8 -- src/test/ui/cfg/cfg-family.rs | 12 -- src/test/ui/cfg/cfg-in-crate-1.rs | 5 - src/test/ui/cfg/cfg-macros-foo.rs | 26 ---- src/test/ui/cfg/cfg-macros-notfoo.rs | 26 ---- src/test/ui/cfg/cfg-match-arm.rs | 20 --- 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-abort.rs | 16 --- src/test/ui/cfg/cfg-panic.rs | 16 --- src/test/ui/cfg/cfg-path-error.rs | 19 --- src/test/ui/cfg/cfg-path-error.stderr | 26 ---- src/test/ui/cfg/cfg-target-abi.rs | 10 -- src/test/ui/cfg/cfg-target-compact-errors.rs | 17 --- src/test/ui/cfg/cfg-target-compact-errors.stderr | 22 --- src/test/ui/cfg/cfg-target-compact.rs | 10 -- src/test/ui/cfg/cfg-target-family.rs | 13 -- src/test/ui/cfg/cfg-target-vendor.rs | 8 -- src/test/ui/cfg/cfg_attr.rs | 50 ------- src/test/ui/cfg/cfg_inner_static.rs | 10 -- src/test/ui/cfg/cfg_stmt_expr.rs | 92 ------------ src/test/ui/cfg/cfgs-on-items.rs | 29 ---- src/test/ui/cfg/conditional-compile-arch.rs | 41 ------ src/test/ui/cfg/conditional-compile.rs | 155 --------------------- src/test/ui/cfg/crt-static-off-works.rs | 10 -- src/test/ui/cfg/crt-static-on-works.rs | 6 - src/test/ui/cfg/expanded-cfg.rs | 21 --- ...uture-compat-crate-attributes-using-cfg_attr.rs | 15 -- ...e-compat-crate-attributes-using-cfg_attr.stderr | 39 ------ 34 files changed, 880 deletions(-) delete mode 100644 src/test/ui/cfg/assume-incomplete-release/assume-incomplete.rs delete mode 100644 src/test/ui/cfg/assume-incomplete-release/auxiliary/ver-cfg-rel.rs delete mode 100644 src/test/ui/cfg/auxiliary/cfg_inner_static.rs delete mode 100644 src/test/ui/cfg/cfg-attr-cfg.rs delete mode 100644 src/test/ui/cfg/cfg-attr-crate.rs delete mode 100644 src/test/ui/cfg/cfg-family.rs delete mode 100644 src/test/ui/cfg/cfg-in-crate-1.rs delete mode 100644 src/test/ui/cfg/cfg-macros-foo.rs delete mode 100644 src/test/ui/cfg/cfg-macros-notfoo.rs delete mode 100644 src/test/ui/cfg/cfg-match-arm.rs delete mode 100644 src/test/ui/cfg/cfg-method-receiver-ok.rs delete mode 100644 src/test/ui/cfg/cfg-method-receiver.rs delete mode 100644 src/test/ui/cfg/cfg-method-receiver.stderr delete mode 100644 src/test/ui/cfg/cfg-panic-abort.rs delete mode 100644 src/test/ui/cfg/cfg-panic.rs delete mode 100644 src/test/ui/cfg/cfg-path-error.rs delete mode 100644 src/test/ui/cfg/cfg-path-error.stderr delete mode 100644 src/test/ui/cfg/cfg-target-abi.rs delete mode 100644 src/test/ui/cfg/cfg-target-compact-errors.rs delete mode 100644 src/test/ui/cfg/cfg-target-compact-errors.stderr delete mode 100644 src/test/ui/cfg/cfg-target-compact.rs delete mode 100644 src/test/ui/cfg/cfg-target-family.rs delete mode 100644 src/test/ui/cfg/cfg-target-vendor.rs delete mode 100644 src/test/ui/cfg/cfg_attr.rs delete mode 100644 src/test/ui/cfg/cfg_inner_static.rs delete mode 100644 src/test/ui/cfg/cfg_stmt_expr.rs delete mode 100644 src/test/ui/cfg/cfgs-on-items.rs delete mode 100644 src/test/ui/cfg/conditional-compile-arch.rs delete mode 100644 src/test/ui/cfg/conditional-compile.rs delete mode 100644 src/test/ui/cfg/crt-static-off-works.rs delete mode 100644 src/test/ui/cfg/crt-static-on-works.rs delete mode 100644 src/test/ui/cfg/expanded-cfg.rs delete mode 100644 src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.rs delete mode 100644 src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr (limited to 'src/test/ui/cfg') diff --git a/src/test/ui/cfg/assume-incomplete-release/assume-incomplete.rs b/src/test/ui/cfg/assume-incomplete-release/assume-incomplete.rs deleted file mode 100644 index 24d2dc645..000000000 --- a/src/test/ui/cfg/assume-incomplete-release/assume-incomplete.rs +++ /dev/null @@ -1,38 +0,0 @@ -// run-pass -// aux-build:ver-cfg-rel.rs -// revisions: assume no_assume -// [assume]compile-flags: -Z assume-incomplete-release - -#![feature(cfg_version)] - -extern crate ver_cfg_rel; - -use ver_cfg_rel::ver_cfg_rel; - -#[ver_cfg_rel("-2")] -fn foo_2() { } - -#[ver_cfg_rel("-1")] -fn foo_1() { } - -#[cfg(assume)] -#[ver_cfg_rel("0")] -fn foo() { compile_error!("wrong+0") } - -#[cfg(no_assume)] -#[ver_cfg_rel("0")] -fn foo() { } - -#[ver_cfg_rel("1")] -fn bar() { compile_error!("wrong+1") } - -#[ver_cfg_rel("2")] -fn bar() { compile_error!("wrong+2") } - -fn main() { - foo_2(); - foo_1(); - - #[cfg(no_assume)] - foo(); -} diff --git a/src/test/ui/cfg/assume-incomplete-release/auxiliary/ver-cfg-rel.rs b/src/test/ui/cfg/assume-incomplete-release/auxiliary/ver-cfg-rel.rs deleted file mode 100644 index 678752702..000000000 --- a/src/test/ui/cfg/assume-incomplete-release/auxiliary/ver-cfg-rel.rs +++ /dev/null @@ -1,56 +0,0 @@ -// force-host -// no-prefer-dynamic - -#![crate_type = "proc-macro"] - -extern crate proc_macro; -use proc_macro::{TokenStream, TokenTree as Tt}; -use std::str::FromStr; - -// String containing the current version number of the tip, i.e. "1.41.2" -static VERSION_NUMBER: &str = include_str!("../../../../../version"); - -#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] -struct Version { - major: i16, - minor: i16, - patch: i16, -} - -fn parse_version(s: &str) -> Option { - let mut digits = s.splitn(3, '.'); - let major = digits.next()?.parse().ok()?; - let minor = digits.next()?.parse().ok()?; - let patch = digits.next().unwrap_or("0").trim().parse().ok()?; - Some(Version { major, minor, patch }) -} - -#[proc_macro_attribute] -/// Emits a #[cfg(version)] relative to the current one, so passing -/// -1 as argument on compiler 1.50 will emit #[cfg(version("1.49.0"))], -/// while 1 will emit #[cfg(version("1.51.0"))] -pub fn ver_cfg_rel(attr: TokenStream, input: TokenStream) -> TokenStream { - let mut v_rel = None; - for a in attr.into_iter() { - match a { - Tt::Literal(l) => { - let mut s = l.to_string(); - let s = s.trim_matches('"'); - let v: i16 = s.parse().unwrap(); - v_rel = Some(v); - break; - }, - _ => panic!("{:?}", a), - } - } - let v_rel = v_rel.unwrap(); - - let mut v = parse_version(VERSION_NUMBER).unwrap(); - v.minor += v_rel; - - let attr_str = format!("#[cfg(version(\"{}.{}.{}\"))]", v.major, v.minor, v.patch); - let mut res = Vec::::new(); - res.extend(TokenStream::from_str(&attr_str).unwrap().into_iter()); - res.extend(input.into_iter()); - res.into_iter().collect() -} diff --git a/src/test/ui/cfg/auxiliary/cfg_inner_static.rs b/src/test/ui/cfg/auxiliary/cfg_inner_static.rs deleted file mode 100644 index 6a619a4e7..000000000 --- a/src/test/ui/cfg/auxiliary/cfg_inner_static.rs +++ /dev/null @@ -1,7 +0,0 @@ -// this used to just ICE on compiling -pub fn foo() { - if cfg!(foo) { - static a: isize = 3; - a - } else { 3 }; -} diff --git a/src/test/ui/cfg/cfg-attr-cfg.rs b/src/test/ui/cfg/cfg-attr-cfg.rs deleted file mode 100644 index 61794e0bf..000000000 --- a/src/test/ui/cfg/cfg-attr-cfg.rs +++ /dev/null @@ -1,8 +0,0 @@ -// run-pass -// main is conditionally compiled, but the conditional compilation -// is conditional too! - -// pretty-expanded FIXME #23616 - -#[cfg_attr(foo, cfg(bar))] -fn main() { } diff --git a/src/test/ui/cfg/cfg-attr-crate.rs b/src/test/ui/cfg/cfg-attr-crate.rs deleted file mode 100644 index 1d70f2f84..000000000 --- a/src/test/ui/cfg/cfg-attr-crate.rs +++ /dev/null @@ -1,8 +0,0 @@ -// run-pass -// https://github.com/rust-lang/rust/issues/21833#issuecomment-72353044 - -// pretty-expanded FIXME #23616 - -#![cfg_attr(not_used, no_core)] - -fn main() { } diff --git a/src/test/ui/cfg/cfg-family.rs b/src/test/ui/cfg/cfg-family.rs deleted file mode 100644 index c7d196a2a..000000000 --- a/src/test/ui/cfg/cfg-family.rs +++ /dev/null @@ -1,12 +0,0 @@ -// build-pass -// pretty-expanded FIXME #23616 -// ignore-wasm32-bare no bare family -// ignore-sgx - -#[cfg(windows)] -pub fn main() { -} - -#[cfg(unix)] -pub fn main() { -} diff --git a/src/test/ui/cfg/cfg-in-crate-1.rs b/src/test/ui/cfg/cfg-in-crate-1.rs deleted file mode 100644 index e84300aa3..000000000 --- a/src/test/ui/cfg/cfg-in-crate-1.rs +++ /dev/null @@ -1,5 +0,0 @@ -// run-pass -// compile-flags: --cfg bar -D warnings -#![cfg(bar)] - -fn main() {} diff --git a/src/test/ui/cfg/cfg-macros-foo.rs b/src/test/ui/cfg/cfg-macros-foo.rs deleted file mode 100644 index 8b112c796..000000000 --- a/src/test/ui/cfg/cfg-macros-foo.rs +++ /dev/null @@ -1,26 +0,0 @@ -// run-pass -// compile-flags: --cfg foo - -// check that cfg correctly chooses between the macro impls (see also -// cfg-macros-notfoo.rs) - - -#[cfg(foo)] -#[macro_use] -mod foo { - macro_rules! bar { - () => { true } - } -} - -#[cfg(not(foo))] -#[macro_use] -mod foo { - macro_rules! bar { - () => { false } - } -} - -pub fn main() { - assert!(bar!()) -} diff --git a/src/test/ui/cfg/cfg-macros-notfoo.rs b/src/test/ui/cfg/cfg-macros-notfoo.rs deleted file mode 100644 index 292d97821..000000000 --- a/src/test/ui/cfg/cfg-macros-notfoo.rs +++ /dev/null @@ -1,26 +0,0 @@ -// run-pass -// compile-flags: - -// check that cfg correctly chooses between the macro impls (see also -// cfg-macros-foo.rs) - - -#[cfg(foo)] -#[macro_use] -mod foo { - macro_rules! bar { - () => { true } - } -} - -#[cfg(not(foo))] -#[macro_use] -mod foo { - macro_rules! bar { - () => { false } - } -} - -pub fn main() { - assert!(!bar!()) -} diff --git a/src/test/ui/cfg/cfg-match-arm.rs b/src/test/ui/cfg/cfg-match-arm.rs deleted file mode 100644 index 071008f9e..000000000 --- a/src/test/ui/cfg/cfg-match-arm.rs +++ /dev/null @@ -1,20 +0,0 @@ -// run-pass -#![allow(dead_code)] -// pretty-expanded FIXME #23616 - -enum Foo { - Bar, - Baz, -} - -fn foo(f: Foo) { - match f { - Foo::Bar => {}, - #[cfg(not(asdfa))] - Foo::Baz => {}, - #[cfg(afsd)] - Basdfwe => {} - } -} - -pub fn main() {} diff --git a/src/test/ui/cfg/cfg-method-receiver-ok.rs b/src/test/ui/cfg/cfg-method-receiver-ok.rs deleted file mode 100644 index 61ad3b8c1..000000000 --- a/src/test/ui/cfg/cfg-method-receiver-ok.rs +++ /dev/null @@ -1,14 +0,0 @@ -// 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 deleted file mode 100644 index 71134ff17..000000000 --- a/src/test/ui/cfg/cfg-method-receiver.rs +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index 5767a7c1b..000000000 --- a/src/test/ui/cfg/cfg-method-receiver.stderr +++ /dev/null @@ -1,24 +0,0 @@ -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-abort.rs b/src/test/ui/cfg/cfg-panic-abort.rs deleted file mode 100644 index 3853b598a..000000000 --- a/src/test/ui/cfg/cfg-panic-abort.rs +++ /dev/null @@ -1,16 +0,0 @@ -// build-pass -// compile-flags: -C panic=abort -// no-prefer-dynamic - - -#[cfg(panic = "unwind")] -pub fn bad() -> i32 { } - -#[cfg(not(panic = "abort"))] -pub fn bad() -> i32 { } - -#[cfg(panic = "some_imaginary_future_panic_handler")] -pub fn bad() -> i32 { } - -#[cfg(panic = "abort")] -pub fn main() { } diff --git a/src/test/ui/cfg/cfg-panic.rs b/src/test/ui/cfg/cfg-panic.rs deleted file mode 100644 index 2de72d54a..000000000 --- a/src/test/ui/cfg/cfg-panic.rs +++ /dev/null @@ -1,16 +0,0 @@ -// build-pass -// compile-flags: -C panic=unwind -// needs-unwind - - -#[cfg(panic = "abort")] -pub fn bad() -> i32 { } - -#[cfg(not(panic = "unwind"))] -pub fn bad() -> i32 { } - -#[cfg(panic = "some_imaginary_future_panic_handler")] -pub fn bad() -> i32 { } - -#[cfg(panic = "unwind")] -pub fn main() { } diff --git a/src/test/ui/cfg/cfg-path-error.rs b/src/test/ui/cfg/cfg-path-error.rs deleted file mode 100644 index 5bf80bd74..000000000 --- a/src/test/ui/cfg/cfg-path-error.rs +++ /dev/null @@ -1,19 +0,0 @@ -// check-fail - -#[cfg(any(foo, foo::bar))] -//~^ERROR `cfg` predicate key must be an identifier -fn foo1() {} - -#[cfg(any(foo::bar, foo))] -//~^ERROR `cfg` predicate key must be an identifier -fn foo2() {} - -#[cfg(all(foo, foo::bar))] -//~^ERROR `cfg` predicate key must be an identifier -fn foo3() {} - -#[cfg(all(foo::bar, foo))] -//~^ERROR `cfg` predicate key must be an identifier -fn foo4() {} - -fn main() {} diff --git a/src/test/ui/cfg/cfg-path-error.stderr b/src/test/ui/cfg/cfg-path-error.stderr deleted file mode 100644 index 84b44b2b0..000000000 --- a/src/test/ui/cfg/cfg-path-error.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error: `cfg` predicate key must be an identifier - --> $DIR/cfg-path-error.rs:3:16 - | -LL | #[cfg(any(foo, foo::bar))] - | ^^^^^^^^ - -error: `cfg` predicate key must be an identifier - --> $DIR/cfg-path-error.rs:7:11 - | -LL | #[cfg(any(foo::bar, foo))] - | ^^^^^^^^ - -error: `cfg` predicate key must be an identifier - --> $DIR/cfg-path-error.rs:11:16 - | -LL | #[cfg(all(foo, foo::bar))] - | ^^^^^^^^ - -error: `cfg` predicate key must be an identifier - --> $DIR/cfg-path-error.rs:15:11 - | -LL | #[cfg(all(foo::bar, foo))] - | ^^^^^^^^ - -error: aborting due to 4 previous errors - diff --git a/src/test/ui/cfg/cfg-target-abi.rs b/src/test/ui/cfg/cfg-target-abi.rs deleted file mode 100644 index acc570fc8..000000000 --- a/src/test/ui/cfg/cfg-target-abi.rs +++ /dev/null @@ -1,10 +0,0 @@ -// run-pass -#![feature(cfg_target_abi)] - -#[cfg(target_abi = "eabihf")] -pub fn main() { -} - -#[cfg(not(target_abi = "eabihf"))] -pub fn main() { -} diff --git a/src/test/ui/cfg/cfg-target-compact-errors.rs b/src/test/ui/cfg/cfg-target-compact-errors.rs deleted file mode 100644 index bca2275b1..000000000 --- a/src/test/ui/cfg/cfg-target-compact-errors.rs +++ /dev/null @@ -1,17 +0,0 @@ -// check-fail - -#![feature(cfg_target_compact)] - -#[cfg(target(o::o))] -//~^ ERROR `cfg` predicate key must be an identifier -fn one() {} - -#[cfg(target(os = 8))] -//~^ ERROR literal in `cfg` predicate value must be a string -fn two() {} - -#[cfg(target(os = "linux", pointer(width = "64")))] -//~^ ERROR invalid predicate `target_pointer` -fn three() {} - -fn main() {} diff --git a/src/test/ui/cfg/cfg-target-compact-errors.stderr b/src/test/ui/cfg/cfg-target-compact-errors.stderr deleted file mode 100644 index bb858301e..000000000 --- a/src/test/ui/cfg/cfg-target-compact-errors.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error: `cfg` predicate key must be an identifier - --> $DIR/cfg-target-compact-errors.rs:5:14 - | -LL | #[cfg(target(o::o))] - | ^^^^ - -error[E0565]: literal in `cfg` predicate value must be a string - --> $DIR/cfg-target-compact-errors.rs:9:19 - | -LL | #[cfg(target(os = 8))] - | ^ - -error[E0537]: invalid predicate `target_pointer` - --> $DIR/cfg-target-compact-errors.rs:13:28 - | -LL | #[cfg(target(os = "linux", pointer(width = "64")))] - | ^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0537, E0565. -For more information about an error, try `rustc --explain E0537`. diff --git a/src/test/ui/cfg/cfg-target-compact.rs b/src/test/ui/cfg/cfg-target-compact.rs deleted file mode 100644 index dc95a8091..000000000 --- a/src/test/ui/cfg/cfg-target-compact.rs +++ /dev/null @@ -1,10 +0,0 @@ -// run-pass -#![feature(cfg_target_compact)] - -#[cfg(target(os = "linux", pointer_width = "64"))] -pub fn main() { -} - -#[cfg(not(target(os = "linux", pointer_width = "64")))] -pub fn main() { -} diff --git a/src/test/ui/cfg/cfg-target-family.rs b/src/test/ui/cfg/cfg-target-family.rs deleted file mode 100644 index 5182cdc89..000000000 --- a/src/test/ui/cfg/cfg-target-family.rs +++ /dev/null @@ -1,13 +0,0 @@ -// build-pass -// ignore-sgx - -// pretty-expanded FIXME #23616 - -#[cfg(target_family = "windows")] -pub fn main() {} - -#[cfg(target_family = "unix")] -pub fn main() {} - -#[cfg(all(target_family = "wasm", not(target_os = "emscripten")))] -pub fn main() {} diff --git a/src/test/ui/cfg/cfg-target-vendor.rs b/src/test/ui/cfg/cfg-target-vendor.rs deleted file mode 100644 index 782458516..000000000 --- a/src/test/ui/cfg/cfg-target-vendor.rs +++ /dev/null @@ -1,8 +0,0 @@ -// run-pass -#[cfg(target_vendor = "unknown")] -pub fn main() { -} - -#[cfg(not(target_vendor = "unknown"))] -pub fn main() { -} diff --git a/src/test/ui/cfg/cfg_attr.rs b/src/test/ui/cfg/cfg_attr.rs deleted file mode 100644 index c959e68ac..000000000 --- a/src/test/ui/cfg/cfg_attr.rs +++ /dev/null @@ -1,50 +0,0 @@ -// run-pass -// compile-flags:--cfg set1 --cfg set2 -#![allow(dead_code)] -use std::fmt::Debug; - -struct NotDebugable; - -#[cfg_attr(set1, derive(Debug))] -struct Set1; - -#[cfg_attr(notset, derive(Debug))] -struct Notset(NotDebugable); - -#[cfg_attr(not(notset), derive(Debug))] -struct NotNotset; - -#[cfg_attr(not(set1), derive(Debug))] -struct NotSet1(NotDebugable); - -#[cfg_attr(all(set1, set2), derive(Debug))] -struct AllSet1Set2; - -#[cfg_attr(all(set1, notset), derive(Debug))] -struct AllSet1Notset(NotDebugable); - -#[cfg_attr(any(set1, notset), derive(Debug))] -struct AnySet1Notset; - -#[cfg_attr(any(notset, notset2), derive(Debug))] -struct AnyNotsetNotset2(NotDebugable); - -#[cfg_attr(all(not(notset), any(set1, notset)), derive(Debug))] -struct Complex; - -#[cfg_attr(any(notset, not(any(set1, notset))), derive(Debug))] -struct ComplexNot(NotDebugable); - -#[cfg_attr(any(target_endian = "little", target_endian = "big"), derive(Debug))] -struct KeyValue; - -fn is_show() {} - -fn main() { - is_show::(); - is_show::(); - is_show::(); - is_show::(); - is_show::(); - is_show::(); -} diff --git a/src/test/ui/cfg/cfg_inner_static.rs b/src/test/ui/cfg/cfg_inner_static.rs deleted file mode 100644 index 45dbbcc10..000000000 --- a/src/test/ui/cfg/cfg_inner_static.rs +++ /dev/null @@ -1,10 +0,0 @@ -// run-pass -// aux-build:cfg_inner_static.rs - -// pretty-expanded FIXME #23616 - -extern crate cfg_inner_static; - -pub fn main() { - cfg_inner_static::foo(); -} diff --git a/src/test/ui/cfg/cfg_stmt_expr.rs b/src/test/ui/cfg/cfg_stmt_expr.rs deleted file mode 100644 index 6381bb2d5..000000000 --- a/src/test/ui/cfg/cfg_stmt_expr.rs +++ /dev/null @@ -1,92 +0,0 @@ -// run-pass -#![allow(dead_code)] -#![allow(unused_mut)] -#![allow(unused_variables)] -#![deny(non_snake_case)] -#![feature(stmt_expr_attributes)] - -fn main() { - let a = 413; - #[cfg(unset)] - let a = (); - assert_eq!(a, 413); - - let mut b = 612; - #[cfg(unset)] - { - b = 1111; - } - assert_eq!(b, 612); - - #[cfg(unset)] - undefined_fn(); - - #[cfg(unset)] - undefined_macro!(); - #[cfg(unset)] - undefined_macro![]; - #[cfg(unset)] - undefined_macro!{}; - - // pretty printer bug... - // #[cfg(unset)] - // undefined_macro!{} - - let () = (#[cfg(unset)] 341,); // Should this also work on parens? - let t = (1, #[cfg(unset)] 3, 4); - assert_eq!(t, (1, 4)); - - let f = |_: u32, _: u32| (); - f(2, 1, #[cfg(unset)] 6); - - let _: u32 = a.clone(#[cfg(unset)] undefined); - - let _: [(); 0] = [#[cfg(unset)] 126]; - let t = [#[cfg(unset)] 1, 2, 6]; - assert_eq!(t, [2, 6]); - - { - let r; - #[cfg(unset)] - (r = 5); - #[cfg(not(unset))] - (r = 10); - assert_eq!(r, 10); - } - - // check that macro expanded code works - - macro_rules! if_cfg { - ($cfg:meta? $ib:block else $eb:block) => { - { - let r; - #[cfg($cfg)] - (r = $ib); - #[cfg(not($cfg))] - (r = $eb); - r - } - } - } - - let n = if_cfg!(unset? { - 413 - } else { - 612 - }); - - assert_eq!((#[cfg(unset)] 1, #[cfg(not(unset))] 2), (2,)); - assert_eq!(n, 612); - - // check that lints work - - #[allow(non_snake_case)] - let FOOBAR = { - fn SYLADEX() {} - }; - - #[allow(non_snake_case)] - { - fn CRUXTRUDER() {} - } -} diff --git a/src/test/ui/cfg/cfgs-on-items.rs b/src/test/ui/cfg/cfgs-on-items.rs deleted file mode 100644 index 9f2fc4942..000000000 --- a/src/test/ui/cfg/cfgs-on-items.rs +++ /dev/null @@ -1,29 +0,0 @@ -// run-pass -// compile-flags: --cfg fooA --cfg fooB - -// fooA AND !bar - -#[cfg(all(fooA, not(bar)))] -fn foo1() -> isize { 1 } - -// !fooA AND !bar -#[cfg(all(not(fooA), not(bar)))] -fn foo2() -> isize { 2 } - -// fooC OR (fooB AND !bar) -#[cfg(any(fooC, all(fooB, not(bar))))] -fn foo2() -> isize { 3 } - -// fooA AND bar -#[cfg(all(fooA, bar))] -fn foo3() -> isize { 2 } - -// !(fooA AND bar) -#[cfg(not(all(fooA, bar)))] -fn foo3() -> isize { 3 } - -pub fn main() { - assert_eq!(1, foo1()); - assert_eq!(3, foo2()); - assert_eq!(3, foo3()); -} diff --git a/src/test/ui/cfg/conditional-compile-arch.rs b/src/test/ui/cfg/conditional-compile-arch.rs deleted file mode 100644 index 7de561df1..000000000 --- a/src/test/ui/cfg/conditional-compile-arch.rs +++ /dev/null @@ -1,41 +0,0 @@ -// run-pass -// pretty-expanded FIXME #23616 - -#[cfg(target_arch = "x86")] -pub fn main() { } - -#[cfg(target_arch = "x86_64")] -pub fn main() { } - -#[cfg(target_arch = "arm")] -pub fn main() { } - -#[cfg(target_arch = "aarch64")] -pub fn main() { } - -#[cfg(target_arch = "mips")] -pub fn main() { } - -#[cfg(target_arch = "mips64")] -pub fn main() { } - -#[cfg(target_arch = "powerpc")] -pub fn main() { } - -#[cfg(target_arch = "powerpc64")] -pub fn main() { } - -#[cfg(target_arch = "s390x")] -pub fn main() { } - -#[cfg(target_arch = "asmjs")] -pub fn main() { } - -#[cfg(target_arch = "wasm32")] -pub fn main() { } - -#[cfg(target_arch = "sparc64")] -pub fn main() { } - -#[cfg(target_arch = "riscv64")] -pub fn main() { } diff --git a/src/test/ui/cfg/conditional-compile.rs b/src/test/ui/cfg/conditional-compile.rs deleted file mode 100644 index 69f4de431..000000000 --- a/src/test/ui/cfg/conditional-compile.rs +++ /dev/null @@ -1,155 +0,0 @@ -// run-pass -#![allow(dead_code)] -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(improper_ctypes)] - -// Crate use statements - -#[cfg(bogus)] -use flippity; - -#[cfg(bogus)] -static b: bool = false; - -static b: bool = true; - -mod rustrt { - #[cfg(bogus)] - extern "C" { - // This symbol doesn't exist and would be a link error if this - // module was codegened - pub fn bogus(); - } - - extern "C" {} -} - -#[cfg(bogus)] -type t = isize; - -type t = bool; - -#[cfg(bogus)] -enum tg { - foo, -} - -enum tg { - bar, -} - -#[cfg(bogus)] -struct r { - i: isize, -} - -#[cfg(bogus)] -fn r(i: isize) -> r { - r { i: i } -} - -struct r { - i: isize, -} - -fn r(i: isize) -> r { - r { i: i } -} - -#[cfg(bogus)] -mod m { - // This needs to parse but would fail in typeck. Since it's not in - // the current config it should not be typechecked. - pub fn bogus() { - return 0; - } -} - -mod m { - // Submodules have slightly different code paths than the top-level - // module, so let's make sure this jazz works here as well - #[cfg(bogus)] - pub fn f() {} - - pub fn f() {} -} - -// Since the bogus configuration isn't defined main will just be -// parsed, but nothing further will be done with it -#[cfg(bogus)] -pub fn main() { - panic!() -} - -pub fn main() { - // Exercise some of the configured items in ways that wouldn't be possible - // if they had the bogus definition - assert!((b)); - let _x: t = true; - let _y: tg = tg::bar; - - test_in_fn_ctxt(); -} - -fn test_in_fn_ctxt() { - #[cfg(bogus)] - fn f() { - panic!() - } - fn f() {} - f(); - - #[cfg(bogus)] - static i: isize = 0; - static i: isize = 1; - assert_eq!(i, 1); -} - -mod test_foreign_items { - pub mod rustrt { - extern "C" { - #[cfg(bogus)] - pub fn write() -> String; - pub fn write() -> String; - } - } -} - -mod test_use_statements { - #[cfg(bogus)] - use flippity_foo; -} - -mod test_methods { - struct Foo { - bar: usize, - } - - impl Fooable for Foo { - #[cfg(bogus)] - fn what(&self) {} - - fn what(&self) {} - - #[cfg(bogus)] - fn the(&self) {} - - fn the(&self) {} - } - - trait Fooable { - #[cfg(bogus)] - fn what(&self); - - fn what(&self); - - #[cfg(bogus)] - fn the(&self); - - fn the(&self); - } -} - -#[cfg(any())] -mod nonexistent_file; // Check that unconfigured non-inline modules are not loaded or parsed. diff --git a/src/test/ui/cfg/crt-static-off-works.rs b/src/test/ui/cfg/crt-static-off-works.rs deleted file mode 100644 index 911467ee5..000000000 --- a/src/test/ui/cfg/crt-static-off-works.rs +++ /dev/null @@ -1,10 +0,0 @@ -// run-pass - -#![allow(stable_features)] -// compile-flags:-C target-feature=-crt-static -Z unstable-options -// ignore-musl - requires changing the linker which is hard - -#![feature(cfg_target_feature)] - -#[cfg(not(target_feature = "crt-static"))] -fn main() {} diff --git a/src/test/ui/cfg/crt-static-on-works.rs b/src/test/ui/cfg/crt-static-on-works.rs deleted file mode 100644 index f89d1edd6..000000000 --- a/src/test/ui/cfg/crt-static-on-works.rs +++ /dev/null @@ -1,6 +0,0 @@ -// run-pass -// compile-flags:-C target-feature=+crt-static -// only-msvc - -#[cfg(target_feature = "crt-static")] -fn main() {} diff --git a/src/test/ui/cfg/expanded-cfg.rs b/src/test/ui/cfg/expanded-cfg.rs deleted file mode 100644 index baa161af7..000000000 --- a/src/test/ui/cfg/expanded-cfg.rs +++ /dev/null @@ -1,21 +0,0 @@ -// check-pass - -macro_rules! mac { - {} => { - #[cfg(attr)] - mod m { - #[lang_item] - fn f() {} - - #[cfg_attr(target_thread_local, custom)] - fn g() {} - } - - #[cfg(attr)] - unconfigured_invocation!(); - } -} - -mac! {} - -fn main() {} diff --git a/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.rs b/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.rs deleted file mode 100644 index 1f23dadc4..000000000 --- a/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.rs +++ /dev/null @@ -1,15 +0,0 @@ -// check-fail -// compile-flags:--cfg foo - -#![cfg_attr(foo, crate_type="bin")] -//~^ERROR `crate_type` within -//~| WARN this was previously accepted -//~|ERROR `crate_type` within -//~| WARN this was previously accepted -#![cfg_attr(foo, crate_name="bar")] -//~^ERROR `crate_name` within -//~| WARN this was previously accepted -//~|ERROR `crate_name` within -//~| WARN this was previously accepted - -fn main() {} 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 deleted file mode 100644 index 9ce4710d6..000000000 --- a/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error: `crate_type` within an `#![cfg_attr] attribute is deprecated` - --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:4:18 - | -LL | #![cfg_attr(foo, crate_type="bin")] - | ^^^^^^^^^^^^^^^^ - | - = 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 - | -LL | #![cfg_attr(foo, crate_name="bar")] - | ^^^^^^^^^^^^^^^^ - | - = 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 - -error: `crate_type` within an `#![cfg_attr] attribute is deprecated` - --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:4:18 - | -LL | #![cfg_attr(foo, crate_type="bin")] - | ^^^^^^^^^^^^^^^^ - | - = 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 - -error: `crate_name` within an `#![cfg_attr] attribute is deprecated` - --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:9:18 - | -LL | #![cfg_attr(foo, crate_name="bar")] - | ^^^^^^^^^^^^^^^^ - | - = 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 - -error: aborting due to 4 previous errors - -- cgit v1.2.3