Skip to content

Commit 33800a7

Browse files
committed
test: Add more trait header test cases with comments
1 parent 258ab67 commit 33800a7

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

tests/source/trait.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,26 @@ trait FooBar = Foo
102102

103103
// #2637
104104
auto trait Example {}
105+
106+
auto /* post auto comment */ trait AutoExampleWithComments {}
107+
105108
pub auto trait PubExample {}
109+
110+
pub /* post pub comment */ auto /* post auto comment */ trait PubAutoExampleWithComments {}
111+
106112
pub unsafe auto trait PubUnsafeExample {}
107113

114+
pub // post pub comment
115+
unsafe
116+
/* post unsafe comment */
117+
auto /* post auto comment */ trait PubUnsafeAutoExampleWithComments {}
118+
119+
pub // post pub comment
120+
const /* post const comment */
121+
unsafe
122+
/* post unsafe comment */
123+
auto /* post auto comment */ trait PubConstUnsafeAutoExampleWithComments {}
124+
108125
// #3006
109126
trait Foo<'a> {
110127
type Bar< 'a >;

tests/target/trait.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,30 @@ trait FooBar = Foo
137137

138138
// #2637
139139
auto trait Example {}
140+
141+
auto /* post auto comment */ trait AutoExampleWithComments {}
142+
140143
pub auto trait PubExample {}
144+
145+
pub /* post pub comment */ auto /* post auto comment */ trait PubAutoExampleWithComments {}
146+
141147
pub unsafe auto trait PubUnsafeExample {}
142148

149+
pub // post pub comment
150+
unsafe
151+
/* post unsafe comment */
152+
auto /* post auto comment */ trait PubUnsafeAutoExampleWithComments
153+
{
154+
}
155+
156+
pub // post pub comment
157+
const /* post const comment */
158+
unsafe
159+
/* post unsafe comment */
160+
auto /* post auto comment */ trait PubConstUnsafeAutoExampleWithComments
161+
{
162+
}
163+
143164
// #3006
144165
trait Foo<'a> {
145166
type Bar<'a>;

0 commit comments

Comments
 (0)