]>
git.proxmox.com Git - rustc.git/blob - src/test/run-pass/issue-23808.rs
1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![feature(associated_consts)]
14 // use different types / traits to test all combinations
25 struct StaticFnStruct
;
30 struct AliasedConstStruct
;
31 struct AliasedStaticFnStruct
;
33 enum AliasedConstEnum {}
34 enum AliasedStaticFnEnum {}
36 type AliasConstStruct
= AliasedConstStruct
;
37 type AliasStaticFnStruct
= AliasedStaticFnStruct
;
38 type AliasConstEnum
= AliasedConstEnum
;
39 type AliasStaticFnEnum
= AliasedStaticFnEnum
;
41 macro_rules
! impl_Const
{($
($T
:ident
),*) => {$
(
47 macro_rules
! impl_StaticFn
{($
($T
:ident
),*) => {$
(
48 impl StaticFn
for $T
{
53 impl_Const
!(ConstStruct
, ConstEnum
, AliasedConstStruct
, AliasedConstEnum
);
54 impl_StaticFn
!(StaticFnStruct
, StaticFnEnum
, AliasedStaticFnStruct
, AliasedStaticFnEnum
);
57 let _
= ConstStruct
::C
;
60 StaticFnStruct
::sfn();
63 let _
= AliasConstStruct
::C
;
64 let _
= AliasConstEnum
::C
;
66 AliasStaticFnStruct
::sfn();
67 AliasStaticFnEnum
::sfn();