Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print space after formal generic params in fn type #92372

Merged
merged 1 commit into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions compiler/rustc_ast_pretty/src/pprust/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2908,10 +2908,7 @@ impl<'a> State<'a> {
generic_params: &[ast::GenericParam],
) {
self.ibox(INDENT_UNIT);
if !generic_params.is_empty() {
self.word("for");
self.print_generic_params(generic_params);
}
self.print_formal_generic_params(generic_params);
let generics = ast::Generics {
params: Vec::new(),
where_clause: ast::WhereClause {
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_hir_pretty/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2327,10 +2327,7 @@ impl<'a> State<'a> {
arg_names: &[Ident],
) {
self.ibox(INDENT_UNIT);
if !generic_params.is_empty() {
self.word("for");
self.print_generic_params(generic_params);
}
self.print_formal_generic_params(generic_params);
let generics = hir::Generics {
params: &[],
where_clause: hir::WhereClause { predicates: &[], span: rustc_span::DUMMY_SP },
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/macros/stringify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ fn test_ty() {
assert_eq!(stringify_ty!(fn(x: u8)), "fn(x: u8)");
#[rustfmt::skip]
assert_eq!(stringify_ty!(for<> fn()), "fn()");
assert_eq!(stringify_ty!(for<'a> fn()), "for<'a>fn()"); // FIXME
assert_eq!(stringify_ty!(for<'a> fn()), "for<'a> fn()");

// TyKind::Never
assert_eq!(stringify_ty!(!), "!");
Expand Down