diff options
| author | Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> | 2023-01-05 09:13:28 +0100 |
|---|---|---|
| committer | Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> | 2023-01-11 09:32:08 +0000 |
| commit | cf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch) | |
| tree | 40a88d9a46aaf3e8870676eb2538378b75a263eb /src/test/ui/symbol-names/const-generics-structural-demangling.rs | |
| parent | ca855e6e42787ecd062d81d53336fe6788ef51a9 (diff) | |
| download | rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip | |
Move /src/test to /tests
Diffstat (limited to 'src/test/ui/symbol-names/const-generics-structural-demangling.rs')
| -rw-r--r-- | src/test/ui/symbol-names/const-generics-structural-demangling.rs | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/src/test/ui/symbol-names/const-generics-structural-demangling.rs b/src/test/ui/symbol-names/const-generics-structural-demangling.rs deleted file mode 100644 index df09ba494a7..00000000000 --- a/src/test/ui/symbol-names/const-generics-structural-demangling.rs +++ /dev/null @@ -1,96 +0,0 @@ -// build-fail -// compile-flags: -C symbol-mangling-version=v0 --crate-name=c - -// NOTE(eddyb) we need `core` for `core::option::Option`, normalize away its -// disambiguator hash, which can/should change (including between stage{1,2}). -// normalize-stderr-test: "core\[[0-9a-f]+\]" -> "core[HASH]" -// normalize-stderr-test: "c\[[0-9a-f]+\]" -> "c[HASH]" - -#![feature(adt_const_params, decl_macro, rustc_attrs)] -#![allow(incomplete_features)] - -pub struct RefByte<const RB: &'static u8>; - -#[rustc_symbol_name] -//~^ ERROR symbol-name -//~| ERROR demangling -//~| ERROR demangling-alt(<c::RefByte<{&123}>>) -impl RefByte<{&123}> {} - -// FIXME(eddyb) this was supposed to be `RefMutZst` with `&mut []`, -// but that is currently not allowed in const generics. -pub struct RefZst<const RMZ: &'static [u8; 0]>; - -#[rustc_symbol_name] -//~^ ERROR symbol-name -//~| ERROR demangling -//~| ERROR demangling-alt(<c::RefZst<{&[]}>>) -impl RefZst<{&[]}> {} - -pub struct Array3Bytes<const A3B: [u8; 3]>; - -#[rustc_symbol_name] -//~^ ERROR symbol-name -//~| ERROR demangling -//~| ERROR demangling-alt(<c::Array3Bytes<{[1, 2, 3]}>>) -impl Array3Bytes<{[1, 2, 3]}> {} - -pub struct TupleByteBool<const TBB: (u8, bool)>; - -#[rustc_symbol_name] -//~^ ERROR symbol-name -//~| ERROR demangling -//~| ERROR demangling-alt(<c::TupleByteBool<{(1, false)}>>) -impl TupleByteBool<{(1, false)}> {} - -pub struct OptionUsize<const OU: Option<usize>>; - -// HACK(eddyb) the full mangling is only in `.stderr` because we can normalize -// the `core` disambiguator hash away there, but not here. -#[rustc_symbol_name] -//~^ ERROR symbol-name -//~| ERROR demangling -//~| ERROR demangling-alt(<c::OptionUsize<{core::option::Option::<usize>::None}>>) -impl OptionUsize<{None}> {} - -// HACK(eddyb) the full mangling is only in `.stderr` because we can normalize -// the `core` disambiguator hash away there, but not here. -#[rustc_symbol_name] -//~^ ERROR symbol-name -//~| ERROR demangling -//~| ERROR demangling-alt(<c::OptionUsize<{core::option::Option::<usize>::Some(0)}>>) -impl OptionUsize<{Some(0)}> {} - -#[derive(PartialEq, Eq)] -pub struct Foo { - s: &'static str, - ch: char, - slice: &'static [u8], -} -pub struct Foo_<const F: Foo>; - -#[rustc_symbol_name] -//~^ ERROR symbol-name -//~| ERROR demangling -//~| ERROR demangling-alt(<c::Foo_<{c::Foo { s: "abc", ch: 'x', slice: &[1, 2, 3] }}>>) -impl Foo_<{Foo { s: "abc", ch: 'x', slice: &[1, 2, 3] }}> {} - -// NOTE(eddyb) this tests specifically the use of disambiguators in field names, -// using macros 2.0 hygiene to create a `struct` with conflicting field names. -macro duplicate_field_name_test($x:ident) { - #[derive(PartialEq, Eq)] - pub struct Bar { - $x: u8, - x: u16, - } - pub struct Bar_<const B: Bar>; - - #[rustc_symbol_name] - //~^ ERROR symbol-name - //~| ERROR demangling - //~| ERROR demangling-alt(<c::Bar_<{c::Bar { x: 123, x: 4096 }}>>) - impl Bar_<{Bar { $x: 123, x: 4096 }}> {} -} -duplicate_field_name_test!(x); - -fn main() {} |
