fix: correct span for structs with const generics
This commit is contained in:
parent
ee2bed96d6
commit
aae222c974
2 changed files with 9 additions and 1 deletions
|
@ -1245,7 +1245,7 @@ fn format_unit_struct(
|
|||
) -> Option<String> {
|
||||
let header_str = format_header(context, p.prefix, p.ident, p.vis, offset);
|
||||
let generics_str = if let Some(generics) = p.generics {
|
||||
let hi = context.snippet_provider.span_before(p.span, ";");
|
||||
let hi = context.snippet_provider.span_before_last(p.span, ";");
|
||||
format_generics(
|
||||
context,
|
||||
generics,
|
||||
|
|
8
tests/target/issue_5668.rs
Normal file
8
tests/target/issue_5668.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
type Foo = impl Send;
|
||||
struct Struct<
|
||||
const C: usize = {
|
||||
let _: Foo = ();
|
||||
//~^ ERROR: mismatched types
|
||||
0
|
||||
},
|
||||
>;
|
Loading…
Add table
Add a link
Reference in a new issue