Skip to content

Commit 6fe782d

Browse files
committed
Give all impls a constness
1 parent 8f1be83 commit 6fe782d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/items.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,7 @@ fn format_impl_ref_and_type(
961961
of_trait,
962962
self_ty,
963963
items: _,
964+
constness,
964965
} = iimpl;
965966
let mut result = String::with_capacity(128);
966967

@@ -969,6 +970,8 @@ fn format_impl_ref_and_type(
969970
if let Some(of_trait) = of_trait.as_deref() {
970971
result.push_str(format_defaultness(of_trait.defaultness));
971972
result.push_str(format_safety(of_trait.safety));
973+
} else {
974+
result.push_str(format_constness_right(*constness));
972975
}
973976

974977
let shape = if context.config.style_edition() >= StyleEdition::Edition2024 {
@@ -985,7 +988,7 @@ fn format_impl_ref_and_type(
985988

986989
let trait_ref_overhead;
987990
if let Some(of_trait) = of_trait.as_deref() {
988-
result.push_str(format_constness_right(of_trait.constness));
991+
result.push_str(format_constness_right(*constness));
989992
let polarity_str = match of_trait.polarity {
990993
ast::ImplPolarity::Negative(_) => "!",
991994
ast::ImplPolarity::Positive => "",

0 commit comments

Comments
 (0)