Consider mutable ident binding patterns to be simple
This should fix `rustdoc` rendering of by-value mutable arguments in `async fn` contexts.
This commit is contained in:
parent
7f5a42b073
commit
380b222f52
1 changed files with 6 additions and 3 deletions
|
@ -1096,9 +1096,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
||||||
// Check if this is a binding pattern, if so, we can optimize and avoid adding a
|
// Check if this is a binding pattern, if so, we can optimize and avoid adding a
|
||||||
// `let <pat> = __argN;` statement. In this case, we do not rename the parameter.
|
// `let <pat> = __argN;` statement. In this case, we do not rename the parameter.
|
||||||
let (ident, is_simple_parameter) = match parameter.pat.kind {
|
let (ident, is_simple_parameter) = match parameter.pat.kind {
|
||||||
hir::PatKind::Binding(hir::BindingAnnotation::Unannotated, _, ident, _) => {
|
hir::PatKind::Binding(
|
||||||
(ident, true)
|
hir::BindingAnnotation::Unannotated | hir::BindingAnnotation::Mutable,
|
||||||
}
|
_,
|
||||||
|
ident,
|
||||||
|
_,
|
||||||
|
) => (ident, true),
|
||||||
_ => {
|
_ => {
|
||||||
// Replace the ident for bindings that aren't simple.
|
// Replace the ident for bindings that aren't simple.
|
||||||
let name = format!("__arg{}", index);
|
let name = format!("__arg{}", index);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue