about summary refs log tree commit diff
path: root/compiler/rustc_expand/src/build.rs
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2023-12-20 15:22:06 +0100
committerLeón Orell Valerian Liehr <me@fmease.dev>2023-12-20 19:39:46 +0100
commit5e4f12b41a13d6adf883cfeae8a17724ea457faf (patch)
treedc503e9554557b08835ac3127af07a47c29018e2 /compiler/rustc_expand/src/build.rs
parentbf9229a2e366b4c311f059014a4aa08af16de5d8 (diff)
downloadrust-5e4f12b41a13d6adf883cfeae8a17724ea457faf.tar.gz
rust-5e4f12b41a13d6adf883cfeae8a17724ea457faf.zip
Refactor AST trait bound modifiers
Diffstat (limited to 'compiler/rustc_expand/src/build.rs')
-rw-r--r--compiler/rustc_expand/src/build.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/rustc_expand/src/build.rs b/compiler/rustc_expand/src/build.rs
index 86f555fa08b..f9eddfeeaa8 100644
--- a/compiler/rustc_expand/src/build.rs
+++ b/compiler/rustc_expand/src/build.rs
@@ -134,10 +134,13 @@ impl<'a> ExtCtxt<'a> {
     pub fn trait_bound(&self, path: ast::Path, is_const: bool) -> ast::GenericBound {
         ast::GenericBound::Trait(
             self.poly_trait_ref(path.span, path),
-            if is_const {
-                ast::TraitBoundModifier::MaybeConst(DUMMY_SP)
-            } else {
-                ast::TraitBoundModifier::None
+            ast::TraitBoundModifiers {
+                polarity: ast::BoundPolarity::Positive,
+                constness: if is_const {
+                    ast::BoundConstness::Maybe(DUMMY_SP)
+                } else {
+                    ast::BoundConstness::Never
+                },
             },
         )
     }