2015-04-30 09:37:13 -07:00
|
|
|
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
#![feature(associated_consts)]
|
|
|
|
|
|
|
|
pub trait Foo {
|
|
|
|
// @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \
|
|
|
|
// 'const FOO: usize;'
|
2015-05-09 00:16:20 +02:00
|
|
|
// @has - '//*[@id="associatedconstant.FOO"]' 'const FOO'
|
2015-04-30 09:37:13 -07:00
|
|
|
const FOO: usize;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Bar;
|
|
|
|
|
|
|
|
impl Bar {
|
2016-02-12 09:43:33 +01:00
|
|
|
// @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAR"]' \
|
2015-04-30 09:37:13 -07:00
|
|
|
// 'const BAR: usize = 3'
|
|
|
|
pub const BAR: usize = 3;
|
|
|
|
}
|