File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ // Regression test for #83026.
2+ // The goal of this test is to ensure that impl blocks inside
3+ // const expressions are documented as well.
4+
5+ #![ crate_name = "foo" ]
6+
7+ // @has 'foo/struct.A.html'
8+ // @has - '//*[@id="method.new"]/*[@class="code-header"]' 'pub fn new() -> A'
9+ // @has - '//*[@id="method.bar"]/*[@class="code-header"]' 'pub fn bar(&self)'
10+ // @has - '//*[@id="method.woo"]/*[@class="code-header"]' 'pub fn woo(&self)'
11+ // @has - '//*[@id="method.yoo"]/*[@class="code-header"]' 'pub fn yoo()'
12+ // @has - '//*[@id="method.yuu"]/*[@class="code-header"]' 'pub fn yuu()'
13+ pub struct A ;
14+
15+ const _: ( ) = {
16+ impl A {
17+ const FOO : ( ) = {
18+ impl A {
19+ pub fn woo ( & self ) { }
20+ }
21+ } ;
22+
23+ pub fn new ( ) -> A {
24+ A
25+ }
26+ }
27+ } ;
28+ pub const X : ( ) = {
29+ impl A {
30+ pub fn bar ( & self ) { }
31+ }
32+ } ;
33+
34+ fn foo ( ) {
35+ impl A {
36+ pub fn yoo ( ) { }
37+ }
38+ const _: ( ) = {
39+ impl A {
40+ pub fn yuu ( ) { }
41+ }
42+ } ;
43+ }
You can’t perform that action at this time.
0 commit comments