2025-07-24 19:07:20 +05:00
|
|
|
//! Regression test for https://github.com/rust-lang/rust/issues/15774
|
|
|
|
|
|
2025-06-03 09:54:30 +02:00
|
|
|
//@ edition: 2015
|
2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2014-07-21 18:47:24 +02:00
|
|
|
#![deny(warnings)]
|
|
|
|
|
#![allow(unused_imports)]
|
|
|
|
|
|
2015-03-12 10:44:56 +13:00
|
|
|
pub enum Foo { A }
|
2014-07-21 18:47:24 +02:00
|
|
|
mod bar {
|
|
|
|
|
pub fn normal(x: ::Foo) {
|
2014-11-06 00:05:53 -08:00
|
|
|
use Foo::A;
|
2014-07-21 18:47:24 +02:00
|
|
|
match x {
|
|
|
|
|
A => {}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pub fn wrong(x: ::Foo) {
|
|
|
|
|
match x {
|
2014-11-06 00:05:53 -08:00
|
|
|
::Foo::A => {}
|
2014-07-21 18:47:24 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn main() {
|
2014-11-06 00:05:53 -08:00
|
|
|
bar::normal(Foo::A);
|
|
|
|
|
bar::wrong(Foo::A);
|
2014-07-21 18:47:24 +02:00
|
|
|
}
|