rust/tests/rustdoc/sidebar-items.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
2.2 KiB
Rust
Raw Normal View History

#![feature(associated_type_defaults)]
2017-11-04 14:45:12 -05:00
#![crate_name = "foo"]
// @has foo/trait.Foo.html
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-methods"]' 'Required Methods'
// @has - '//*[@class="sidebar-elems"]//section//a' 'bar'
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-methods"]' 'Provided Methods'
// @has - '//*[@class="sidebar-elems"]//section//a' 'foo'
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-associated-consts"]' 'Required Associated Constants'
// @has - '//*[@class="sidebar-elems"]//section//a' 'FOO'
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-associated-consts"]' 'Provided Associated Constants'
// @has - '//*[@class="sidebar-elems"]//section//a' 'BAR'
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-associated-types"]' 'Required Associated Types'
// @has - '//*[@class="sidebar-elems"]//section//a' 'Output'
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-associated-types"]' 'Provided Associated Types'
// @has - '//*[@class="sidebar-elems"]//section//a' 'Extra'
2017-11-04 14:45:12 -05:00
pub trait Foo {
const FOO: usize;
2017-11-04 14:45:12 -05:00
const BAR: u32 = 0;
type Extra: Copy = ();
2017-11-04 14:45:12 -05:00
type Output: ?Sized;
fn foo() {}
fn bar() -> Self::Output;
}
// @has foo/struct.Bar.html
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Fields'
// @has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.f"]' 'f'
// @has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.u"]' 'u'
// @!has - '//*[@class="sidebar-elems"]//section//a' 'waza'
2017-11-04 14:45:12 -05:00
pub struct Bar {
pub f: u32,
pub u: u32,
2018-07-21 06:19:17 -05:00
waza: u32,
2017-11-04 14:45:12 -05:00
}
// @has foo/enum.En.html
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#variants"]' 'Variants'
// @has - '//*[@class="sidebar-elems"]//section//a' 'Foo'
// @has - '//*[@class="sidebar-elems"]//section//a' 'Bar'
2017-11-04 14:45:12 -05:00
pub enum En {
Foo,
Bar,
2017-11-04 14:45:12 -05:00
}
// @has foo/union.MyUnion.html
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Fields'
// @has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.f1"]' 'f1'
// @has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.f2"]' 'f2'
// @!has - '//*[@class="sidebar-elems"]//section//a' 'waza'
2017-11-04 14:45:12 -05:00
pub union MyUnion {
pub f1: u32,
pub f2: f32,
2018-07-21 06:19:17 -05:00
waza: u32,
2017-11-04 14:45:12 -05:00
}