about summary refs log tree commit diff
path: root/src/tools/rustfmt
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-11-24 07:29:13 -0800
committerGitHub <noreply@github.com>2023-11-24 07:29:13 -0800
commitb5d336ffaecd5cb1de34f1a62df08f8db5dd233f (patch)
tree11ad30be9e6eb437a0a6a4c03e757b9706976ae6 /src/tools/rustfmt
parent193e6687e9be466000e51e8c28a4d5a375a28b6c (diff)
parent16040a16285e3bfde82c3e4216d16a6e566494da (diff)
downloadrust-b5d336ffaecd5cb1de34f1a62df08f8db5dd233f.tar.gz
rust-b5d336ffaecd5cb1de34f1a62df08f8db5dd233f.zip
Rollup merge of #118245 - fee1-dead-contrib:span-tilde-const, r=compiler-errors
Add `Span` to `TraitBoundModifier`

This improves diagnostics for the message "`~const` is not allowed here", and also fixes the span that we use when desugaring `~const Tr` into `Tr<host>` in effects desugaring.
Diffstat (limited to 'src/tools/rustfmt')
-rw-r--r--src/tools/rustfmt/src/types.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/rustfmt/src/types.rs b/src/tools/rustfmt/src/types.rs
index 127aff913e3..8ca27150371 100644
--- a/src/tools/rustfmt/src/types.rs
+++ b/src/tools/rustfmt/src/types.rs
@@ -546,7 +546,7 @@ impl Rewrite for ast::GenericBound {
                     ast::TraitBoundModifier::Maybe => poly_trait_ref
                         .rewrite(context, shape.offset_left(1)?)
                         .map(|s| format!("?{}", s)),
-                    ast::TraitBoundModifier::MaybeConst => poly_trait_ref
+                    ast::TraitBoundModifier::MaybeConst(_) => poly_trait_ref
                         .rewrite(context, shape.offset_left(7)?)
                         .map(|s| format!("~const {}", s)),
                     ast::TraitBoundModifier::MaybeConstMaybe => poly_trait_ref