1
1
// Test that we do not currently display `~const` in rustdoc
2
- // as that syntax is currently provisional; `~const Drop ` has
2
+ // as that syntax is currently provisional; `~const Destruct ` has
3
3
// no effect on stable code so it should be hidden as well.
4
4
//
5
5
// To future blessers: make sure that `const_trait_impl` is
8
8
#![ feature( const_trait_impl) ]
9
9
#![ crate_name = "foo" ]
10
10
11
+ use std:: marker:: Destruct ;
12
+
11
13
pub struct S < T > ( T ) ;
12
14
13
15
// @!has foo/trait.Tr.html '//pre[@class="rust trait"]/code/a[@class="trait"]' '~const'
@@ -20,22 +22,36 @@ pub trait Tr<T> {
20
22
// @!has - '//div[@id="method.a"]/h4[@class="code-header"]/span[@class="where"]' '~const'
21
23
// @has - '//div[@id="method.a"]/h4[@class="code-header"]/span[@class="where fmt-newline"]' ': Clone'
22
24
#[ default_method_body_is_const]
23
- fn a < A : ~const Clone > ( ) where Option < A > : ~const Clone { }
25
+ fn a < A : ~const Clone + ~const Destruct > ( )
26
+ where
27
+ Option < A > : ~const Clone + ~const Destruct ,
28
+ {
29
+ }
24
30
}
25
31
26
32
// @!has - '//section[@id="impl-Tr%3CT%3E"]/h3[@class="code-header in-band"]' '~const'
27
33
// @has - '//section[@id="impl-Tr%3CT%3E"]/h3[@class="code-header in-band"]/a[@class="trait"]' 'Clone'
28
34
// @!has - '//section[@id="impl-Tr%3CT%3E"]/h3[@class="code-header in-band"]/span[@class="where"]' '~const'
29
35
// @has - '//section[@id="impl-Tr%3CT%3E"]/h3[@class="code-header in-band"]/span[@class="where fmt-newline"]' ': Clone'
30
- impl < T : ~const Clone > const Tr < T > for T where Option < T > : ~const Clone {
31
- fn a < A : ~const Clone > ( ) where Option < A > : ~const Clone { }
36
+ impl < T : ~const Clone + ~const Destruct > const Tr < T > for T
37
+ where
38
+ Option < T > : ~const Clone + ~const Destruct ,
39
+ {
40
+ fn a < A : ~const Clone + ~const Destruct > ( )
41
+ where
42
+ Option < A > : ~const Clone + ~const Destruct ,
43
+ {
44
+ }
32
45
}
33
46
34
47
// @!has foo/fn.foo.html '//pre[@class="rust fn"]/code/a[@class="trait"]' '~const'
35
48
// @has - '//pre[@class="rust fn"]/code/a[@class="trait"]' 'Clone'
36
49
// @!has - '//pre[@class="rust fn"]/code/span[@class="where fmt-newline"]' '~const'
37
50
// @has - '//pre[@class="rust fn"]/code/span[@class="where fmt-newline"]' ': Clone'
38
- pub const fn foo < F : ~const Clone > ( ) where Option < F > : ~const Clone {
51
+ pub const fn foo < F : ~const Clone + ~const Destruct > ( )
52
+ where
53
+ Option < F > : ~const Clone + ~const Destruct ,
54
+ {
39
55
F :: a ( )
40
56
}
41
57
@@ -44,7 +60,10 @@ impl<T> S<T> {
44
60
// @has - '//section[@id="method.foo"]/h4[@class="code-header"]/a[@class="trait"]' 'Clone'
45
61
// @!has - '//section[@id="method.foo"]/h4[@class="code-header"]/span[@class="where"]' '~const'
46
62
// @has - '//section[@id="method.foo"]/h4[@class="code-header"]/span[@class="where fmt-newline"]' ': Clone'
47
- pub const fn foo < B : ~const Clone > ( ) where B : ~const Clone {
63
+ pub const fn foo < B : ~const Clone + ~const Destruct > ( )
64
+ where
65
+ B : ~const Clone + ~const Destruct ,
66
+ {
48
67
B :: a ( )
49
68
}
50
69
}
0 commit comments