fix: adjust span derivation for const generics
This commit is contained in:
parent
268716b85e
commit
2707103154
3 changed files with 18 additions and 1 deletions
|
|
@ -3244,7 +3244,7 @@ fn format_generics(
|
|||
if brace_pos == BracePos::None {
|
||||
span.hi()
|
||||
} else {
|
||||
context.snippet_provider.span_before(span, "{")
|
||||
context.snippet_provider.span_before_last(span, "{")
|
||||
},
|
||||
),
|
||||
shape,
|
||||
|
|
|
|||
9
tests/source/issue-5935.rs
Normal file
9
tests/source/issue-5935.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
struct Regs<
|
||||
const BEGIN: u64,
|
||||
const END: u64,
|
||||
const DIM: usize,
|
||||
const N: usize = { (END - BEGIN) as usize / (8 * DIM) + 1 },
|
||||
>
|
||||
{
|
||||
_foo: u64,
|
||||
}
|
||||
8
tests/target/issue-5935.rs
Normal file
8
tests/target/issue-5935.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
struct Regs<
|
||||
const BEGIN: u64,
|
||||
const END: u64,
|
||||
const DIM: usize,
|
||||
const N: usize = { (END - BEGIN) as usize / (8 * DIM) + 1 },
|
||||
> {
|
||||
_foo: u64,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue