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
This commit is contained in:
parent
d5cd3205fd
commit
8660832086
16 changed files with 178 additions and 125 deletions
|
@ -284,7 +284,7 @@ impl ParenthesizedArgs {
|
|||
|
||||
pub use crate::node_id::{NodeId, CRATE_NODE_ID, DUMMY_NODE_ID};
|
||||
|
||||
/// A modifier on a bound, e.g., `?Sized` or `?const Trait`.
|
||||
/// A modifier on a bound, e.g., `?Sized` or `~const Trait`.
|
||||
///
|
||||
/// Negative bounds should also be handled here.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug)]
|
||||
|
@ -295,10 +295,10 @@ pub enum TraitBoundModifier {
|
|||
/// `?Trait`
|
||||
Maybe,
|
||||
|
||||
/// `?const Trait`
|
||||
/// `~const Trait`
|
||||
MaybeConst,
|
||||
|
||||
/// `?const ?Trait`
|
||||
/// `~const ?Trait`
|
||||
//
|
||||
// This parses but will be rejected during AST validation.
|
||||
MaybeConstMaybe,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue