]> git.lizzy.rs Git - rust.git/blob - src/test/ui/symbol-names/issue-75326.rs
Update UI tests affected by changed DefPathHash value construction.
[rust.git] / src / test / ui / symbol-names / issue-75326.rs
1 // build-fail
2 // ignore-tidy-linelength
3 // revisions: legacy v0
4 //[legacy]compile-flags: -Z symbol-mangling-version=legacy
5 //[v0]compile-flags: -Z symbol-mangling-version=v0
6 //[legacy]normalize-stderr-test: "h[\w{16}]+" -> "SYMBOL_HASH"
7
8 #![feature(rustc_attrs)]
9
10 pub(crate) struct Foo<I, E>(I, E);
11
12 pub trait Iterator2 {
13     type Item;
14
15     fn next(&mut self) -> Option<Self::Item>;
16
17     fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
18     where
19         Self: Sized,
20         P: FnMut(&Self::Item) -> bool,
21     {
22         unimplemented!()
23     }
24 }
25
26 struct Bar;
27
28 impl Iterator2 for Bar {
29     type Item = (u32, u16);
30
31     fn next(&mut self) -> Option<Self::Item> {
32         unimplemented!()
33     }
34 }
35
36 impl<I, T, E> Iterator2 for Foo<I, E>
37 where
38     I: Iterator2<Item = (T, E)>,
39 {
40     type Item = T;
41
42     #[rustc_symbol_name]
43     //[legacy]~^ ERROR symbol-name(_ZN72_$LT$issue_75326..Foo$LT$I$C$E$GT$$u20$as$u20$issue_75326..Iterator2$GT$4next
44     //[legacy]~| ERROR demangling(<issue_75326::Foo<I,E> as issue_75326::Iterator2>::next
45     //[legacy]~| ERROR demangling-alt(<issue_75326::Foo<I,E> as issue_75326::Iterator2>::next)
46     //[v0]~^^^^  ERROR symbol-name(_RNvXINICs21hi0yVfW1J_11issue_75326s_0pppEINtB5_3FooppENtB5_9Iterator24nextB5_)
47     //[v0]~|     ERROR demangling(<issue_75326[17891616a171812d]::Foo<_, _> as issue_75326[17891616a171812d]::Iterator2>::next)
48     //[v0]~|     ERROR demangling-alt(<issue_75326::Foo<_, _> as issue_75326::Iterator2>::next)
49     fn next(&mut self) -> Option<Self::Item> {
50         self.find(|_| true)
51     }
52 }
53
54 fn main() {
55     let mut a = Foo(Bar, 1u16);
56     let _ = a.next();
57 }