]> git.lizzy.rs Git - rust.git/blob - tests/ui/inference/issue-81522.rs
Rollup merge of #107192 - fmease:mailmap-me-at-fmease-dev, r=albertlarsan68
[rust.git] / tests / ui / inference / issue-81522.rs
1 // Regression test for #81522.
2 // Ensures that `#[allow(unstable_name_collisions)]` appended to things other than function
3 // suppresses the corresponding diagnostics emitted from inside them.
4 // But note that this attribute doesn't work for macro invocations if it is appended directly.
5
6 // aux-build:inference_unstable_iterator.rs
7 // aux-build:inference_unstable_itertools.rs
8 // run-pass
9
10 extern crate inference_unstable_iterator;
11 extern crate inference_unstable_itertools;
12
13 #[allow(unused_imports)]
14 use inference_unstable_iterator::IpuIterator;
15 use inference_unstable_itertools::IpuItertools;
16
17 fn main() {
18     // expression statement
19     #[allow(unstable_name_collisions)]
20     'x'.ipu_flatten();
21
22     // let statement
23     #[allow(unstable_name_collisions)]
24     let _ = 'x'.ipu_flatten();
25
26     // block expression
27     #[allow(unstable_name_collisions)]
28     {
29         'x'.ipu_flatten();
30     }
31 }