2022-03-29 12:30:54 -05:00
|
|
|
#![feature(associated_type_defaults)]
|
2017-11-04 14:45:12 -05:00
|
|
|
#![crate_name = "foo"]
|
|
|
|
|
|
|
|
// @has foo/trait.Foo.html
|
2022-10-15 13:53:47 -05:00
|
|
|
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-methods"]' 'Required Methods'
|
2022-02-08 10:05:00 -06:00
|
|
|
// @has - '//*[@class="sidebar-elems"]//section//a' 'bar'
|
2022-10-15 13:53:47 -05:00
|
|
|
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-methods"]' 'Provided Methods'
|
2022-02-08 10:05:00 -06:00
|
|
|
// @has - '//*[@class="sidebar-elems"]//section//a' 'foo'
|
2022-10-15 13:53:47 -05:00
|
|
|
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-associated-consts"]' 'Required Associated Constants'
|
2022-03-29 12:30:54 -05:00
|
|
|
// @has - '//*[@class="sidebar-elems"]//section//a' 'FOO'
|
2022-10-15 13:53:47 -05:00
|
|
|
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-associated-consts"]' 'Provided Associated Constants'
|
2022-02-08 10:05:00 -06:00
|
|
|
// @has - '//*[@class="sidebar-elems"]//section//a' 'BAR'
|
2022-10-15 13:53:47 -05:00
|
|
|
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-associated-types"]' 'Required Associated Types'
|
2022-02-08 10:05:00 -06:00
|
|
|
// @has - '//*[@class="sidebar-elems"]//section//a' 'Output'
|
2022-10-15 13:53:47 -05:00
|
|
|
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-associated-types"]' 'Provided Associated Types'
|
2022-03-29 12:30:54 -05:00
|
|
|
// @has - '//*[@class="sidebar-elems"]//section//a' 'Extra'
|
2023-07-01 12:13:26 -05:00
|
|
|
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#object-safety"]' 'Object Safety'
|
2017-11-04 14:45:12 -05:00
|
|
|
pub trait Foo {
|
2022-03-29 12:30:54 -05:00
|
|
|
const FOO: usize;
|
2017-11-04 14:45:12 -05:00
|
|
|
const BAR: u32 = 0;
|
2022-03-29 12:30:54 -05:00
|
|
|
type Extra: Copy = ();
|
2017-11-04 14:45:12 -05:00
|
|
|
type Output: ?Sized;
|
|
|
|
|
|
|
|
fn foo() {}
|
|
|
|
fn bar() -> Self::Output;
|
|
|
|
}
|
|
|
|
|
2023-07-01 12:13:26 -05:00
|
|
|
// @has foo/trait.Safe.html
|
|
|
|
// @!has - '//div[@class="sidebar-elems"]//h3/a[@href="#object-safety"]' ''
|
|
|
|
pub trait Safe {
|
|
|
|
fn access(&self);
|
|
|
|
}
|
|
|
|
|
2017-11-04 14:45:12 -05:00
|
|
|
// @has foo/struct.Bar.html
|
2022-10-15 13:53:47 -05:00
|
|
|
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Fields'
|
2022-02-08 10:05:00 -06:00
|
|
|
// @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
|
2022-10-15 13:53:47 -05:00
|
|
|
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#variants"]' 'Variants'
|
2022-02-08 10:05:00 -06:00
|
|
|
// @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 {
|
2021-11-26 17:03:16 -06:00
|
|
|
Foo,
|
|
|
|
Bar,
|
2017-11-04 14:45:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// @has foo/union.MyUnion.html
|
2022-10-15 13:53:47 -05:00
|
|
|
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Fields'
|
2022-02-08 10:05:00 -06:00
|
|
|
// @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
|
|
|
}
|