Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix overlong function signature (#1089)
* Fix issue-1049 * Add testcase suggested by pepyakin * Fix last commit * Handle special case * Remove debugging println * Fix grammar in comment * Change word in comment * Add test for long func without ret type * Add one more test
- Loading branch information
Showing
3 changed files
with
53 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Test overlong function signature | ||
pub unsafe fn reborrow_mut(&mut X: Abcde) -> Handle<NodeRef<marker::Mut, K, V, NodeType>, HandleType> { | ||
} | ||
|
||
pub fn merge(mut X: Abcdef) -> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::Edge> { | ||
} | ||
|
||
impl Handle { | ||
pub fn merge(a: Abcd) -> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::Edge> { | ||
} | ||
} | ||
|
||
// Long function without return type that should not be reformated. | ||
fn veeeeeeeeeeeeeeeeeeeeery_long_name(a: FirstTypeeeeeeeeee, b: SecondTypeeeeeeeeeeeeeeeeeeeeeee) {} | ||
|
||
fn veeeeeeeeeeeeeeeeeeeeeery_long_name(a: FirstTypeeeeeeeeee, b: SecondTypeeeeeeeeeeeeeeeeeeeeeee) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Test overlong function signature | ||
pub unsafe fn reborrow_mut(&mut X: Abcde) | ||
-> Handle<NodeRef<marker::Mut, K, V, NodeType>, HandleType> { | ||
} | ||
|
||
pub fn merge(mut X: Abcdef) | ||
-> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::Edge> { | ||
} | ||
|
||
impl Handle { | ||
pub fn merge(a: Abcd) | ||
-> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::Edge> { | ||
} | ||
} | ||
|
||
// Long function without return type that should not be reformated. | ||
fn veeeeeeeeeeeeeeeeeeeeery_long_name(a: FirstTypeeeeeeeeee, b: SecondTypeeeeeeeeeeeeeeeeeeeeeee) {} | ||
|
||
fn veeeeeeeeeeeeeeeeeeeeeery_long_name(a: FirstTypeeeeeeeeee, | ||
b: SecondTypeeeeeeeeeeeeeeeeeeeeeee) { | ||
} |