about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2021-08-25 11:53:16 +0000
committerDeadbeef <ent3rm4n@gmail.com>2021-08-27 05:07:37 +0000
commit076916fe940c07719244412e2834fdab543305d2 (patch)
treeb4b6d1f413822c9fe71c203ec1a77125f51529e3 /src
parent9bc0dbeb6415b205df8336edca438a7ff4468adf (diff)
Introduce `~const`
 - [x] Removed `?const` and change uses of `?const`
 - [x] Added `~const` to the AST. It is gated behind const_trait_impl.
 - [x] Validate `~const` in ast_validation.
 - [ ] Add enum `BoundConstness` to the HIR. (With variants `NotConst` and
 `ConstIfConst` allowing future extensions)
 - [ ] Adjust trait selection and pre-existing code to use `BoundConstness`.
 - [ ] Optional steps (*for this PR, obviously*)
      - [ ] Fix #88155
      - [ ] Do something with constness bounds in chalk
Diffstat (limited to 'src')
-rw-r--r--src/types.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/types.rs b/src/types.rs
index c6f89c31065..640d127e860 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -537,10 +537,10 @@ impl Rewrite for ast::GenericBound {
                         .map(|s| format!("?{}", s)),
                     ast::TraitBoundModifier::MaybeConst => poly_trait_ref
                         .rewrite(context, shape.offset_left(7)?)
-                        .map(|s| format!("?const {}", s)),
+                        .map(|s| format!("~const {}", s)),
                     ast::TraitBoundModifier::MaybeConstMaybe => poly_trait_ref
                         .rewrite(context, shape.offset_left(8)?)
-                        .map(|s| format!("?const ?{}", s)),
+                        .map(|s| format!("~const ?{}", s)),
                 };
                 rewrite.map(|s| if has_paren { format!("({})", s) } else { s })
             }