From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/symbol-names/issue-75326.rs | 56 +++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/test/ui/symbol-names/issue-75326.rs (limited to 'src/test/ui/symbol-names/issue-75326.rs') diff --git a/src/test/ui/symbol-names/issue-75326.rs b/src/test/ui/symbol-names/issue-75326.rs new file mode 100644 index 000000000..4a1f5a212 --- /dev/null +++ b/src/test/ui/symbol-names/issue-75326.rs @@ -0,0 +1,56 @@ +// build-fail +// revisions: legacy v0 +//[legacy]compile-flags: -Z unstable-options -C symbol-mangling-version=legacy +//[v0]compile-flags: -C symbol-mangling-version=v0 +//[legacy]normalize-stderr-test: "h[\w{16}]+" -> "SYMBOL_HASH" + +#![feature(rustc_attrs)] + +pub(crate) struct Foo(I, E); + +pub trait Iterator2 { + type Item; + + fn next(&mut self) -> Option; + + fn find

(&mut self, predicate: P) -> Option + where + Self: Sized, + P: FnMut(&Self::Item) -> bool, + { + unimplemented!() + } +} + +struct Bar; + +impl Iterator2 for Bar { + type Item = (u32, u16); + + fn next(&mut self) -> Option { + unimplemented!() + } +} + +impl Iterator2 for Foo +where + I: Iterator2, +{ + type Item = T; + + #[rustc_symbol_name] + //[legacy]~^ ERROR symbol-name(_ZN72_$LT$issue_75326..Foo$LT$I$C$E$GT$$u20$as$u20$issue_75326..Iterator2$GT$4next + //[legacy]~| ERROR demangling( as issue_75326::Iterator2>::next + //[legacy]~| ERROR demangling-alt( as issue_75326::Iterator2>::next) + //[v0]~^^^^ ERROR symbol-name + //[v0]~| ERROR demangling + //[v0]~| ERROR demangling-alt( as issue_75326::Iterator2>::next) + fn next(&mut self) -> Option { + self.find(|_| true) + } +} + +fn main() { + let mut a = Foo(Bar, 1u16); + let _ = a.next(); +} -- cgit v1.2.3