From 5f066e94677017321cf2386f9ed459adc7c9facd Mon Sep 17 00:00:00 2001 From: cyrgani Date: Tue, 28 Apr 2026 12:22:02 +0000 Subject: [PATCH] delete unused auxillary test files --- .../auxiliary/fn-dyn-aux.rs | 182 ------------------ .../auxiliary/reexport-should-still-link.rs | 5 - .../auxiliary/def_colliding_external.rs | 7 - .../proc-macro/auxiliary/derive-unstable-2.rs | 12 -- .../auxiliary/static-priv-by-default.rs | 27 --- 5 files changed, 233 deletions(-) delete mode 100644 tests/ui/associated-type-bounds/auxiliary/fn-dyn-aux.rs delete mode 100644 tests/ui/extern/auxiliary/reexport-should-still-link.rs delete mode 100644 tests/ui/linkage-attr/auxiliary/def_colliding_external.rs delete mode 100644 tests/ui/proc-macro/auxiliary/derive-unstable-2.rs delete mode 100644 tests/ui/static/auxiliary/static-priv-by-default.rs diff --git a/tests/ui/associated-type-bounds/auxiliary/fn-dyn-aux.rs b/tests/ui/associated-type-bounds/auxiliary/fn-dyn-aux.rs deleted file mode 100644 index 85d6c5aaf3c6f..0000000000000 --- a/tests/ui/associated-type-bounds/auxiliary/fn-dyn-aux.rs +++ /dev/null @@ -1,182 +0,0 @@ -// Traits: - -pub trait Alpha { - fn alpha(self) -> usize; -} - -pub trait Beta { - type Gamma; - fn gamma(&self) -> Self::Gamma; -} - -pub trait Delta { - fn delta(self) -> usize; -} - -pub trait Epsilon<'a> { - type Zeta; - fn zeta(&'a self) -> Self::Zeta; - - fn epsilon(&'a self) -> usize; -} - -pub trait Eta { - fn eta(self) -> usize; -} - -// Assertions: - -pub fn assert_alpha(x: T) -> usize { x.alpha() } -pub fn assert_static(_: T) -> usize { 24 } -pub fn assert_delta(x: T) -> usize { x.delta() } -pub fn assert_epsilon_specific<'a, T: 'a + Epsilon<'a>>(x: &'a T) -> usize { x.epsilon() } -pub fn assert_epsilon_forall Epsilon<'a>>() {} -pub fn assert_forall_epsilon_zeta_satisfies_eta(x: T) -> usize -where - T: for<'a> Epsilon<'a>, - for<'a> >::Zeta: Eta, -{ - x.epsilon() + x.zeta().eta() -} - -// Implementations and types: - -#[derive(Copy, Clone)] -pub struct BetaType; - -#[derive(Copy, Clone)] -pub struct GammaType; - -#[derive(Copy, Clone)] -pub struct ZetaType; - -impl Beta for &(dyn Beta + Send) { - type Gamma = T; - fn gamma(&self) -> Self::Gamma { (*self).gamma() } -} - -impl Beta for BetaType { - type Gamma = GammaType; - fn gamma(&self) -> Self::Gamma { GammaType } -} - -impl<'a> Beta for &'a BetaType { - type Gamma = GammaType; - fn gamma(&self) -> Self::Gamma { GammaType } -} - -impl Beta for GammaType { - type Gamma = Self; - fn gamma(&self) -> Self::Gamma { Self } -} - -impl Alpha for GammaType { - fn alpha(self) -> usize { 42 } -} - -impl Delta for GammaType { - fn delta(self) -> usize { 1337 } -} - -impl<'a> Epsilon<'a> for GammaType { - type Zeta = ZetaType; - fn zeta(&'a self) -> Self::Zeta { ZetaType } - - fn epsilon(&'a self) -> usize { 7331 } -} - -impl Eta for ZetaType { - fn eta(self) -> usize { 7 } -} - -// Desugared forms to check against: - -pub fn desugared_bound(beta: &B) -> usize -where - B: Beta, - B::Gamma: Alpha -{ - let gamma: B::Gamma = beta.gamma(); - assert_alpha::(gamma) -} - -pub fn desugared_bound_region(beta: &B) -> usize -where - B: Beta, - B::Gamma: 'static, -{ - assert_static::(beta.gamma()) -} - -pub fn desugared_bound_multi(beta: B) -> usize -where - B: Copy + Beta, - B::Gamma: Alpha + 'static + Delta, -{ - assert_alpha::(beta.gamma()) + - assert_static::(beta.gamma()) + - assert_delta::(beta.gamma()) -} - -pub fn desugared_bound_region_specific<'a, B: ?Sized>(gamma: &'a B::Gamma) -> usize -where - B: Beta, - B::Gamma: 'a + Epsilon<'a>, -{ - assert_epsilon_specific::(gamma) -} - -pub fn desugared_bound_region_forall(beta: &B) -> usize -where - B: Beta, - B::Gamma: Copy + for<'a> Epsilon<'a>, -{ - assert_epsilon_forall::(); - let g1: B::Gamma = beta.gamma(); - let g2: B::Gamma = g1; - assert_epsilon_specific::(&g1) + - assert_epsilon_specific::(&g2) -} - -pub fn desugared_bound_region_forall2(beta: &B) -> usize -where - B: Beta, - B::Gamma: Copy + for<'a> Epsilon<'a>, - for<'a> >::Zeta: Eta, -{ - let gamma = beta.gamma(); - assert_forall_epsilon_zeta_satisfies_eta::(gamma) -} - -pub fn desugared_contraint_region_forall(beta: &B) -> usize -where - for<'a> &'a B: Beta, - for<'a> <&'a B as Beta>::Gamma: Alpha, -{ - let g1 = beta.gamma(); - let g2 = beta.gamma(); - assert_alpha(g1) + assert_alpha(g2) -} - -pub fn desugared_bound_nested(beta: &B) -> usize -where - B: Beta, - B::Gamma: Copy + Alpha + Beta, - ::Gamma: Delta, -{ - let go = beta.gamma(); - let gi = go.gamma(); - go.alpha() + gi.delta() -} - -pub fn desugared() { - let beta = BetaType; - let gamma = beta.gamma(); - - assert_eq!(42, desugared_bound(&beta)); - assert_eq!(24, desugared_bound_region(&beta)); - assert_eq!(42 + 24 + 1337, desugared_bound_multi(beta)); - assert_eq!(7331, desugared_bound_region_specific::(&gamma)); - assert_eq!(7331 * 2, desugared_bound_region_forall(&beta)); - assert_eq!(42 + 1337, desugared_bound_nested(&beta)); -} diff --git a/tests/ui/extern/auxiliary/reexport-should-still-link.rs b/tests/ui/extern/auxiliary/reexport-should-still-link.rs deleted file mode 100644 index 237ea8dfcf3f8..0000000000000 --- a/tests/ui/extern/auxiliary/reexport-should-still-link.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub use foo::bar; - -mod foo { - pub fn bar() {} -} diff --git a/tests/ui/linkage-attr/auxiliary/def_colliding_external.rs b/tests/ui/linkage-attr/auxiliary/def_colliding_external.rs deleted file mode 100644 index 60b55b3e27bc8..0000000000000 --- a/tests/ui/linkage-attr/auxiliary/def_colliding_external.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![feature(linkage)] -#![crate_type = "lib"] - -extern "C" { - #[linkage = "external"] - pub static collision: *const i32; -} diff --git a/tests/ui/proc-macro/auxiliary/derive-unstable-2.rs b/tests/ui/proc-macro/auxiliary/derive-unstable-2.rs deleted file mode 100644 index 4bc56efecdbf5..0000000000000 --- a/tests/ui/proc-macro/auxiliary/derive-unstable-2.rs +++ /dev/null @@ -1,12 +0,0 @@ -extern crate proc_macro; - -use proc_macro::TokenStream; - -#[proc_macro_derive(Unstable)] -pub fn derive(_input: TokenStream) -> TokenStream { - - " - #[rustc_foo] - fn foo() {} - ".parse().unwrap() -} diff --git a/tests/ui/static/auxiliary/static-priv-by-default.rs b/tests/ui/static/auxiliary/static-priv-by-default.rs deleted file mode 100644 index f36f87c5736a1..0000000000000 --- a/tests/ui/static/auxiliary/static-priv-by-default.rs +++ /dev/null @@ -1,27 +0,0 @@ -//@ aux-build:static_priv_by_default.rs - -extern crate static_priv_by_default; - -mod child { - pub mod childs_child { - static private: isize = 0; - pub static public: isize = 0; - } -} - -fn foo(_: isize) {} - -fn full_ref() { - foo(static_priv_by_default::private); //~ ERROR: static `private` is private - foo(static_priv_by_default::public); - foo(child::childs_child::private); //~ ERROR: static `private` is private - foo(child::childs_child::public); -} - -fn medium_ref() { - use child::childs_child; - foo(childs_child::private); //~ ERROR: static `private` is private - foo(childs_child::public); -} - -fn main() {}