parent
152ccb5059
commit
f8deed3a3a
@ -2217,11 +2217,10 @@ fn rewrite_fn_base(
|
||||
|
||||
// Skip `pub(crate)`.
|
||||
let lo_after_visibility = get_bytepos_after_visibility(&fn_sig.visibility, span);
|
||||
// A conservative estimation, to goal is to be over all parens in generics
|
||||
// A conservative estimation, the goal is to be over all parens in generics
|
||||
let params_start = fn_sig
|
||||
.generics
|
||||
.params
|
||||
.iter()
|
||||
.last()
|
||||
.map_or(lo_after_visibility, |param| param.span().hi());
|
||||
let params_end = if fd.inputs.is_empty() {
|
||||
|
@ -132,7 +132,8 @@ impl Spanned for ast::GenericParam {
|
||||
};
|
||||
let ty_hi = if let ast::GenericParamKind::Type {
|
||||
default: Some(ref ty),
|
||||
} = self.kind
|
||||
}
|
||||
| ast::GenericParamKind::Const { ref ty, .. } = self.kind
|
||||
{
|
||||
ty.span().hi()
|
||||
} else {
|
||||
|
9
tests/target/issue-4310.rs
Normal file
9
tests/target/issue-4310.rs
Normal file
@ -0,0 +1,9 @@
|
||||
#![feature(const_generics)]
|
||||
|
||||
fn foo<
|
||||
const N: [u8; {
|
||||
struct Inner<'a>(&'a ());
|
||||
3
|
||||
}],
|
||||
>() {
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user