about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_hir_analysis/src')
-rw-r--r--compiler/rustc_hir_analysis/src/check/check.rs2
-rw-r--r--compiler/rustc_hir_analysis/src/check/compare_impl_item.rs6
-rw-r--r--compiler/rustc_hir_analysis/src/check/wfcheck.rs2
-rw-r--r--compiler/rustc_hir_analysis/src/collect/item_bounds.rs4
-rw-r--r--compiler/rustc_hir_analysis/src/collect/predicates_of.rs6
-rw-r--r--compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs2
-rw-r--r--compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs4
-rw-r--r--compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs6
-rw-r--r--compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs8
9 files changed, 20 insertions, 20 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs
index f08a2451496..a361679e8ad 100644
--- a/compiler/rustc_hir_analysis/src/check/check.rs
+++ b/compiler/rustc_hir_analysis/src/check/check.rs
@@ -344,7 +344,7 @@ fn check_opaque_meets_bounds<'tcx>(
     let misc_cause = ObligationCause::misc(span, def_id);
     // FIXME: We should just register the item bounds here, rather than equating.
     // FIXME(const_trait_impl): When we do that, please make sure to also register
-    // the `~const` bounds.
+    // the `[const]` bounds.
     match ocx.eq(&misc_cause, param_env, opaque_ty, hidden_ty) {
         Ok(()) => {}
         Err(ty_err) => {
diff --git a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
index 372a383fb39..abbe497858b 100644
--- a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
+++ b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
@@ -264,9 +264,9 @@ fn compare_method_predicate_entailment<'tcx>(
     }
 
     // If we're within a const implementation, we need to make sure that the method
-    // does not assume stronger `~const` bounds than the trait definition.
+    // does not assume stronger `[const]` bounds than the trait definition.
     //
-    // This registers the `~const` bounds of the impl method, which we will prove
+    // This registers the `[const]` bounds of the impl method, which we will prove
     // using the hybrid param-env that we earlier augmented with the const conditions
     // from the impl header and trait method declaration.
     if is_conditionally_const {
@@ -2335,7 +2335,7 @@ pub(super) fn check_type_bounds<'tcx>(
     )
     .collect();
 
-    // Only in a const implementation do we need to check that the `~const` item bounds hold.
+    // Only in a const implementation do we need to check that the `[const]` item bounds hold.
     if tcx.is_conditionally_const(impl_ty_def_id) {
         obligations.extend(util::elaborate(
             tcx,
diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
index 89ce74879d8..b9124ea0e5e 100644
--- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs
+++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
@@ -1402,7 +1402,7 @@ fn check_impl<'tcx>(
                     }
                 }
 
-                // Ensure that the `~const` where clauses of the trait hold for the impl.
+                // Ensure that the `[const]` where clauses of the trait hold for the impl.
                 if tcx.is_conditionally_const(item.owner_id.def_id) {
                     for (bound, _) in
                         tcx.const_conditions(trait_ref.def_id).instantiate(tcx, trait_ref.args)
diff --git a/compiler/rustc_hir_analysis/src/collect/item_bounds.rs b/compiler/rustc_hir_analysis/src/collect/item_bounds.rs
index 53c44cdc411..e51ef46afb7 100644
--- a/compiler/rustc_hir_analysis/src/collect/item_bounds.rs
+++ b/compiler/rustc_hir_analysis/src/collect/item_bounds.rs
@@ -54,7 +54,7 @@ fn associated_type_bounds<'tcx>(
                 );
                 icx.lowerer().add_default_traits(&mut bounds, item_ty, hir_bounds, None, span);
             }
-            // `ConstIfConst` is only interested in `~const` bounds.
+            // `ConstIfConst` is only interested in `[const]` bounds.
             PredicateFilter::ConstIfConst | PredicateFilter::SelfConstIfConst => {}
         }
 
@@ -351,7 +351,7 @@ fn opaque_type_bounds<'tcx>(
                 );
                 icx.lowerer().add_default_traits(&mut bounds, item_ty, hir_bounds, None, span);
             }
-            //`ConstIfConst` is only interested in `~const` bounds.
+            //`ConstIfConst` is only interested in `[const]` bounds.
             PredicateFilter::ConstIfConst | PredicateFilter::SelfConstIfConst => {}
         }
         debug!(?bounds);
diff --git a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs
index c337765c5fe..2813d4204a7 100644
--- a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs
+++ b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs
@@ -666,7 +666,7 @@ pub(super) fn implied_predicates_with_filter<'tcx>(
                 item.span,
             );
         }
-        //`ConstIfConst` is only interested in `~const` bounds.
+        //`ConstIfConst` is only interested in `[const]` bounds.
         PredicateFilter::ConstIfConst | PredicateFilter::SelfConstIfConst => {}
     }
 
@@ -821,7 +821,7 @@ pub(super) fn assert_only_contains_predicates_from<'tcx>(
                         assert_eq!(
                             pred.constness,
                             ty::BoundConstness::Maybe,
-                            "expected `~const` predicate when computing `{filter:?}` \
+                            "expected `[const]` predicate when computing `{filter:?}` \
                             implied bounds: {clause:?}",
                         );
                         assert_eq!(
@@ -1009,7 +1009,7 @@ pub(super) fn const_conditions<'tcx>(
             }
             _ => bug!("const_conditions called on wrong item: {def_id:?}"),
         },
-        // While associated types are not really const, we do allow them to have `~const`
+        // While associated types are not really const, we do allow them to have `[const]`
         // bounds and where clauses. `const_conditions` is responsible for gathering
         // these up so we can check them in `compare_type_predicate_entailment`, and
         // in `HostEffect` goal computation.
diff --git a/compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs b/compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs
index a3c8ce620b3..ef789743e06 100644
--- a/compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs
+++ b/compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs
@@ -635,7 +635,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
                 self.suggest_adding_type_and_const_args(err);
             }
             ExcessTypesOrConsts { .. } => {
-                // this can happen with `~const T` where T isn't a const_trait.
+                // this can happen with `[const] T` where T isn't a const_trait.
             }
             _ => unreachable!(),
         }
diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs
index e06df5e4679..d17986d45d2 100644
--- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs
+++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs
@@ -494,7 +494,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
                     );
                 }
                 hir::GenericBound::Outlives(lifetime) => {
-                    // `ConstIfConst` is only interested in `~const` bounds.
+                    // `ConstIfConst` is only interested in `[const]` bounds.
                     if matches!(
                         predicate_filter,
                         PredicateFilter::ConstIfConst | PredicateFilter::SelfConstIfConst
@@ -710,7 +710,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
                     }
                     // SelfTraitThatDefines is only interested in trait predicates.
                     PredicateFilter::SelfTraitThatDefines(_) => {}
-                    // `ConstIfConst` is only interested in `~const` bounds.
+                    // `ConstIfConst` is only interested in `[const]` bounds.
                     PredicateFilter::ConstIfConst | PredicateFilter::SelfConstIfConst => {}
                 }
             }
diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
index baf3b9b5bc9..74739355e1f 100644
--- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
+++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
@@ -80,10 +80,10 @@ pub enum PredicateFilter {
     /// and `<Self as Tr>::A: B`.
     SelfAndAssociatedTypeBounds,
 
-    /// Filter only the `~const` bounds, which are lowered into `HostEffect` clauses.
+    /// Filter only the `[const]` bounds, which are lowered into `HostEffect` clauses.
     ConstIfConst,
 
-    /// Filter only the `~const` bounds which are *also* in the supertrait position.
+    /// Filter only the `[const]` bounds which are *also* in the supertrait position.
     SelfConstIfConst,
 }
 
@@ -885,7 +885,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
                     }
                 }
                 // On the flip side, when filtering `ConstIfConst` bounds, we only need to convert
-                // `~const` bounds. All other predicates are handled in their respective queries.
+                // `[const]` bounds. All other predicates are handled in their respective queries.
                 //
                 // Note that like `PredicateFilter::SelfOnly`, we don't need to do any filtering
                 // here because we only call this on self bounds, and deal with the recursive case
diff --git a/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs b/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs
index 309221f9a12..574d19a5aa5 100644
--- a/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs
+++ b/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs
@@ -402,22 +402,22 @@ fn check_predicates<'tcx>(
 /// as some predicate on the base impl (`predicate2`).
 ///
 /// This basically just checks syntactic equivalence, but is a little more
-/// forgiving since we want to equate `T: Tr` with `T: ~const Tr` so this can work:
+/// forgiving since we want to equate `T: Tr` with `T: [const] Tr` so this can work:
 ///
 /// ```ignore (illustrative)
 /// #[rustc_specialization_trait]
 /// trait Specialize { }
 ///
 /// impl<T: Bound> Tr for T { }
-/// impl<T: ~const Bound + Specialize> const Tr for T { }
+/// impl<T: [const] Bound + Specialize> const Tr for T { }
 /// ```
 ///
 /// However, we *don't* want to allow the reverse, i.e., when the bound on the
 /// specializing impl is not as const as the bound on the base impl:
 ///
 /// ```ignore (illustrative)
-/// impl<T: ~const Bound> const Tr for T { }
-/// impl<T: Bound + Specialize> const Tr for T { } // should be T: ~const Bound
+/// impl<T: [const] Bound> const Tr for T { }
+/// impl<T: Bound + Specialize> const Tr for T { } // should be T: [const] Bound
 /// ```
 ///
 /// So we make that check in this function and try to raise a helpful error message.