From cf2dff2b1e3fa55fa5415d524200070d0d7aacfe Mon Sep 17 00:00:00 2001 From: Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> Date: Thu, 5 Jan 2023 09:13:28 +0100 Subject: Move /src/test to /tests --- .../debuginfo-box-with-large-allocator.rs | 23 ----------------- .../debuginfo-emit-llvm-ir-and-split-debuginfo.rs | 8 ------ .../debuginfo-type-name-layout-ice-94961-1.rs | 16 ------------ .../debuginfo-type-name-layout-ice-94961-1.stderr | 4 --- .../debuginfo-type-name-layout-ice-94961-2.rs | 20 --------------- .../debuginfo-type-name-layout-ice-94961-2.stderr | 4 --- ...buginfo_with_uninhabitable_field_and_unsized.rs | 29 ---------------------- src/test/ui/debuginfo/issue-105386-debuginfo-ub.rs | 20 --------------- src/test/ui/debuginfo/late-bound-projection.rs | 7 ------ 9 files changed, 131 deletions(-) delete mode 100644 src/test/ui/debuginfo/debuginfo-box-with-large-allocator.rs delete mode 100644 src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs delete mode 100644 src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs delete mode 100644 src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.stderr delete mode 100644 src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.rs delete mode 100644 src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.stderr delete mode 100644 src/test/ui/debuginfo/debuginfo_with_uninhabitable_field_and_unsized.rs delete mode 100644 src/test/ui/debuginfo/issue-105386-debuginfo-ub.rs delete mode 100644 src/test/ui/debuginfo/late-bound-projection.rs (limited to 'src/test/ui/debuginfo') diff --git a/src/test/ui/debuginfo/debuginfo-box-with-large-allocator.rs b/src/test/ui/debuginfo/debuginfo-box-with-large-allocator.rs deleted file mode 100644 index 761539227a7..00000000000 --- a/src/test/ui/debuginfo/debuginfo-box-with-large-allocator.rs +++ /dev/null @@ -1,23 +0,0 @@ -// build-pass -// compile-flags: -Cdebuginfo=2 -// fixes issue #94725 - -#![feature(allocator_api)] - -use std::alloc::{AllocError, Allocator, Layout}; -use std::ptr::NonNull; - -struct ZST; - -unsafe impl Allocator for &ZST { - fn allocate(&self, layout: Layout) -> Result, AllocError> { - todo!() - } - unsafe fn deallocate(&self, ptr: NonNull, layout: Layout) { - todo!() - } -} - -fn main() { - let _ = Box::::new_in(43, &ZST); -} diff --git a/src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs b/src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs deleted file mode 100644 index ff764015dc7..00000000000 --- a/src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs +++ /dev/null @@ -1,8 +0,0 @@ -// build-pass -// only-linux -// -// compile-flags: -g --emit=llvm-ir -Csplit-debuginfo=unpacked -// -// Make sure that we don't explode with an error if we don't actually end up emitting any `dwo`s, -// as would be the case if we don't actually codegen anything. -#![crate_type="rlib"] diff --git a/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs b/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs deleted file mode 100644 index 78bda28485d..00000000000 --- a/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Make sure the compiler does not ICE when trying to generate the debuginfo name of a type that -// causes a layout error. See https://github.com/rust-lang/rust/issues/94961. - -// compile-flags:-C debuginfo=2 -// build-fail -// error-pattern: too big for the current architecture -// normalize-stderr-64bit "18446744073709551615" -> "SIZE" -// normalize-stderr-32bit "4294967295" -> "SIZE" - -#![crate_type = "rlib"] - -pub struct Foo([T; usize::MAX]); - -pub fn foo() -> usize { - std::mem::size_of::>() -} diff --git a/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.stderr b/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.stderr deleted file mode 100644 index 851dca84c3d..00000000000 --- a/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.stderr +++ /dev/null @@ -1,4 +0,0 @@ -error: values of the type `[u8; SIZE]` are too big for the current architecture - -error: aborting due to previous error - diff --git a/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.rs b/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.rs deleted file mode 100644 index fdc088dc0f9..00000000000 --- a/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Make sure the compiler does not ICE when trying to generate the debuginfo name of a type that -// causes a layout error. -// This version of the test already ICE'd before the commit that introduce the ICE described in -// https://github.com/rust-lang/rust/issues/94961. - -// compile-flags:-C debuginfo=2 -// build-fail -// error-pattern: too big for the current architecture -// normalize-stderr-64bit "18446744073709551615" -> "SIZE" -// normalize-stderr-32bit "4294967295" -> "SIZE" - -#![crate_type = "rlib"] - -pub enum Foo { - Bar([T; usize::MAX]), -} - -pub fn foo() -> usize { - std::mem::size_of::>() -} diff --git a/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.stderr b/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.stderr deleted file mode 100644 index 851dca84c3d..00000000000 --- a/src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.stderr +++ /dev/null @@ -1,4 +0,0 @@ -error: values of the type `[u8; SIZE]` are too big for the current architecture - -error: aborting due to previous error - diff --git a/src/test/ui/debuginfo/debuginfo_with_uninhabitable_field_and_unsized.rs b/src/test/ui/debuginfo/debuginfo_with_uninhabitable_field_and_unsized.rs deleted file mode 100644 index b3f22ecf511..00000000000 --- a/src/test/ui/debuginfo/debuginfo_with_uninhabitable_field_and_unsized.rs +++ /dev/null @@ -1,29 +0,0 @@ -// build-pass -// compile-flags: -Cdebuginfo=2 -// fixes issue #94149 - -#![allow(dead_code)] - -pub fn main() { - let _ = Foo::::new(); -} - -pub struct Foo { - base: FooBase, - value: T, -} - -impl Foo { - pub fn new() -> Box> { - todo!() - } -} - -pub trait FooTrait {} - -pub struct FooBase { - cls: Bar, -} - -// Bar *must* be a fieldless enum -pub enum Bar {} diff --git a/src/test/ui/debuginfo/issue-105386-debuginfo-ub.rs b/src/test/ui/debuginfo/issue-105386-debuginfo-ub.rs deleted file mode 100644 index 6c6eb5d4e86..00000000000 --- a/src/test/ui/debuginfo/issue-105386-debuginfo-ub.rs +++ /dev/null @@ -1,20 +0,0 @@ -// run-pass -// compile-flags: --edition 2021 -Copt-level=3 -Cdebuginfo=2 -Zmir-opt-level=3 - -fn main() { - TranslatorI.visit_pre(); -} - -impl TranslatorI { - fn visit_pre(self) { - Some(()) - .map(|_| self.flags()) - .unwrap_or_else(|| self.flags()); - } -} - -struct TranslatorI; - -impl TranslatorI { - fn flags(&self) {} -} diff --git a/src/test/ui/debuginfo/late-bound-projection.rs b/src/test/ui/debuginfo/late-bound-projection.rs deleted file mode 100644 index 6018078459c..00000000000 --- a/src/test/ui/debuginfo/late-bound-projection.rs +++ /dev/null @@ -1,7 +0,0 @@ -// build-pass -// compile-flags: -Cdebuginfo=2 --crate-type=rlib -// Fixes issue #94998 - -pub trait Trait {} - -pub fn run(_: &dyn FnOnce(&()) -> Box) {} -- cgit 1.4.1-3-g733a5