11// 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 
33// no effect on stable code so it should be hidden as well. 
44// 
55// To future blessers: make sure that `const_trait_impl` is 
88#![ feature( const_trait_impl) ]  
99#![ crate_name = "foo" ]  
1010
11+ use  std:: marker:: Destruct ; 
12+ 
1113pub  struct  S < T > ( T ) ; 
1214
1315// @!has foo/trait.Tr.html '//pre[@class="rust trait"]/code/a[@class="trait"]' '~const' 
@@ -20,22 +22,36 @@ pub trait Tr<T> {
2022    // @!has - '//div[@id="method.a"]/h4[@class="code-header"]/span[@class="where"]' '~const' 
2123    // @has - '//div[@id="method.a"]/h4[@class="code-header"]/span[@class="where fmt-newline"]' ': Clone' 
2224    #[ 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+     } 
2430} 
2531
2632// @!has - '//section[@id="impl-Tr%3CT%3E"]/h3[@class="code-header in-band"]' '~const' 
2733// @has - '//section[@id="impl-Tr%3CT%3E"]/h3[@class="code-header in-band"]/a[@class="trait"]' 'Clone' 
2834// @!has - '//section[@id="impl-Tr%3CT%3E"]/h3[@class="code-header in-band"]/span[@class="where"]' '~const' 
2935// @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+     } 
3245} 
3346
3447// @!has foo/fn.foo.html '//pre[@class="rust fn"]/code/a[@class="trait"]' '~const' 
3548// @has - '//pre[@class="rust fn"]/code/a[@class="trait"]' 'Clone' 
3649// @!has - '//pre[@class="rust fn"]/code/span[@class="where fmt-newline"]' '~const' 
3750// @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+ { 
3955    F :: a ( ) 
4056} 
4157
@@ -44,7 +60,10 @@ impl<T> S<T> {
4460    // @has - '//section[@id="method.foo"]/h4[@class="code-header"]/a[@class="trait"]' 'Clone' 
4561    // @!has - '//section[@id="method.foo"]/h4[@class="code-header"]/span[@class="where"]' '~const' 
4662    // @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+     { 
4867        B :: a ( ) 
4968    } 
5069} 
0 commit comments