This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 949769c
authored
Rollup merge of rust-lang#92372 - dtolnay:fntype, r=jackh726
Print space after formal generic params in fn type
Follow-up to rust-lang#92238 fixing one of the FIXMEs.
```rust
macro_rules! repro {
($ty:ty) => {
stringify!($ty)
};
}
fn main() {
println!("{}", repro!(for<'a> fn(&'a u8)));
}
```
Before: `for<'a>fn(&'a u8)`
After: `for<'a> fn(&'a u8)`
The pretty printer's `print_formal_generic_params` already prints formal generic params correctly with a space, we just need to call it when printing BareFn types instead of reimplementing the printing incorrectly without a space.
https://github.com/rust-lang/rust/blob/83b15bfe1c15f325bc186ebfe3691b729ed59f2b/compiler/rustc_ast_pretty/src/pprust/state.rs#L1394-L1400File tree
3 files changed
+3
-9
lines changed- compiler
- rustc_ast_pretty/src/pprust
- rustc_hir_pretty/src
- src/test/ui/macros
3 files changed
+3
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2909 | 2909 | | |
2910 | 2910 | | |
2911 | 2911 | | |
2912 | | - | |
2913 | | - | |
2914 | | - | |
2915 | | - | |
| 2912 | + | |
2916 | 2913 | | |
2917 | 2914 | | |
2918 | 2915 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2327 | 2327 | | |
2328 | 2328 | | |
2329 | 2329 | | |
2330 | | - | |
2331 | | - | |
2332 | | - | |
2333 | | - | |
| 2330 | + | |
2334 | 2331 | | |
2335 | 2332 | | |
2336 | 2333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
803 | 803 | | |
804 | 804 | | |
805 | 805 | | |
806 | | - | |
| 806 | + | |
807 | 807 | | |
808 | 808 | | |
809 | 809 | | |
| |||
0 commit comments