File tree 2 files changed +34
-0
lines changed
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 14
14
// @has - '//*[@class="sidebar-elems"]//section//a' 'Output'
15
15
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-associated-types"]' 'Provided Associated Types'
16
16
// @has - '//*[@class="sidebar-elems"]//section//a' 'Extra'
17
+ // @has - '//div[@class="sidebar-elems"]//h3/a[@href="#object-safety"]' 'Object Safety'
17
18
pub trait Foo {
18
19
const FOO : usize ;
19
20
const BAR : u32 = 0 ;
@@ -24,6 +25,12 @@ pub trait Foo {
24
25
fn bar ( ) -> Self :: Output ;
25
26
}
26
27
28
+ // @has foo/trait.Safe.html
29
+ // @!has - '//div[@class="sidebar-elems"]//h3/a[@href="#object-safety"]' ''
30
+ pub trait Safe {
31
+ fn access ( & self ) ;
32
+ }
33
+
27
34
// @has foo/struct.Bar.html
28
35
// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Fields'
29
36
// @has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.f"]' 'f'
Original file line number Diff line number Diff line change
1
+ #![ crate_name = "foo" ]
2
+
3
+ // @has 'foo/trait.Unsafe.html'
4
+ // @has - '//*[@class="object-safety-info"]' 'This trait is not object safe.'
5
+ // @has - '//*[@id="object-safety"]' 'Object Safety'
6
+ pub trait Unsafe {
7
+ fn foo ( ) -> Self ;
8
+ }
9
+
10
+ // @has 'foo/trait.Unsafe2.html'
11
+ // @has - '//*[@class="object-safety-info"]' 'This trait is not object safe.'
12
+ // @has - '//*[@id="object-safety"]' 'Object Safety'
13
+ pub trait Unsafe2 < T > {
14
+ fn foo ( i : T ) ;
15
+ }
16
+
17
+ // @has 'foo/trait.Safe.html'
18
+ // @!has - '//*[@class="object-safety-info"]' ''
19
+ // @!has - '//*[@id="object-safety"]' ''
20
+ pub trait Safe {
21
+ fn foo ( & self ) ;
22
+ }
23
+
24
+ // @has 'foo/struct.Foo.html'
25
+ // @!has - '//*[@class="object-safety-info"]' ''
26
+ // @!has - '//*[@id="object-safety"]' ''
27
+ pub struct Foo ;
You can’t perform that action at this time.
0 commit comments