mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
fix: correct span for structs with const generics
This commit is contained in:
parent
ee2bed96d6
commit
aae222c974
@ -1245,7 +1245,7 @@ fn format_unit_struct(
|
|||||||
) -> Option<String> {
|
) -> Option<String> {
|
||||||
let header_str = format_header(context, p.prefix, p.ident, p.vis, offset);
|
let header_str = format_header(context, p.prefix, p.ident, p.vis, offset);
|
||||||
let generics_str = if let Some(generics) = p.generics {
|
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(
|
format_generics(
|
||||||
context,
|
context,
|
||||||
generics,
|
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…
Reference in New Issue
Block a user