File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## Unreleased
4
+
5
+ ### Formatter
6
+
7
+ - Fixed a bug where the ` @internal ` annotation wouldn't be displayed.
8
+
3
9
## v1.1.0-rc2 - 2024-04-10
4
10
5
11
### Compiler
Original file line number Diff line number Diff line change @@ -2175,7 +2175,8 @@ impl<'a> Documentable<'a> for &'a ArgNames {
2175
2175
fn pub_ ( publicity : Publicity ) -> Document < ' static > {
2176
2176
match publicity {
2177
2177
Publicity :: Public => "pub " . to_doc ( ) ,
2178
- Publicity :: Private | Publicity :: Internal => nil ( ) ,
2178
+ Publicity :: Private => nil ( ) ,
2179
+ Publicity :: Internal => "@internal" . to_doc ( ) . append ( line ( ) ) . append ( "pub " ) ,
2179
2180
}
2180
2181
}
2181
2182
Original file line number Diff line number Diff line change @@ -5905,3 +5905,32 @@ fn comments_inside_binop_chain() {
5905
5905
"#
5906
5906
) ;
5907
5907
}
5908
+
5909
+ #[ test]
5910
+ fn internal_attribute_on_function ( ) {
5911
+ assert_format ! (
5912
+ r#"@internal
5913
+ pub fn main() {
5914
+ todo
5915
+ }
5916
+ "#
5917
+ ) ;
5918
+ }
5919
+
5920
+ #[ test]
5921
+ fn internal_attribute_on_type ( ) {
5922
+ assert_format ! (
5923
+ r#"@internal
5924
+ pub type Type
5925
+ "#
5926
+ ) ;
5927
+ }
5928
+
5929
+ #[ test]
5930
+ fn internal_attribute_on_const ( ) {
5931
+ assert_format ! (
5932
+ r#"@internal
5933
+ pub const wibble = 1
5934
+ "#
5935
+ ) ;
5936
+ }
You can’t perform that action at this time.
0 commit comments