about summary refs log tree commit diff
path: root/tests/ui/resolve/underscore-bindings-disambiguators.rs
blob: 8c89b39f8590c723656238aa7a1ba19b77507ab5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Regression test for issue #144168 where some `_` bindings were incorrectly only allowed once per
// module, failing with "error[E0428]: the name `_` is defined multiple times".

// This weird/complex setup is reduced from `zerocopy-0.8.25` where the issue was encountered.

#![crate_type = "lib"]

macro_rules! impl_for_transmute_from {
    () => {
        const _: () = {};
    };
}

mod impls {
    use super::*;
    impl_for_transmute_from!();
    impl_for_transmute_from!();
    const _: () = todo!(); //~ ERROR: evaluation panicked
    const _: () = todo!(); //~ ERROR: evaluation panicked
    const _: () = todo!(); //~ ERROR: evaluation panicked
    const _: () = todo!(); //~ ERROR: evaluation panicked
    const _: () = todo!(); //~ ERROR: evaluation panicked
}
use X as Y; //~ ERROR: unresolved import
use Z as W; //~ ERROR: unresolved import

const _: () = todo!(); //~ ERROR: evaluation panicked