File tree 2 files changed +17
-7
lines changed
rustc_hir_analysis/src/collect
2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -937,12 +937,6 @@ impl<'tcx> ItemCtxt<'tcx> {
937
937
}
938
938
}
939
939
940
- /// Compute the conditions that need to hold for a conditionally-const item to be const.
941
- /// That is, compute the set of `~const` where clauses for a given item.
942
- ///
943
- /// This query also computes the `~const` where clauses for associated types, which are
944
- /// not "const", but which have item bounds which may be `~const`. These must hold for
945
- /// the `~const` item bound to hold.
946
940
pub ( super ) fn const_conditions < ' tcx > (
947
941
tcx : TyCtxt < ' tcx > ,
948
942
def_id : LocalDefId ,
@@ -1060,7 +1054,9 @@ pub(super) fn explicit_implied_const_bounds<'tcx>(
1060
1054
def_id : LocalDefId ,
1061
1055
) -> ty:: EarlyBinder < ' tcx , & ' tcx [ ( ty:: PolyTraitRef < ' tcx > , Span ) ] > {
1062
1056
if !tcx. is_conditionally_const ( def_id) {
1063
- bug ! ( "const_conditions invoked for item that is not conditionally const: {def_id:?}" ) ;
1057
+ bug ! (
1058
+ "explicit_implied_const_bounds invoked for item that is not conditionally const: {def_id:?}"
1059
+ ) ;
1064
1060
}
1065
1061
1066
1062
let bounds = match tcx. opt_rpitit_info ( def_id. to_def_id ( ) ) {
Original file line number Diff line number Diff line change @@ -748,6 +748,15 @@ rustc_queries! {
748
748
}
749
749
}
750
750
751
+ /// Compute the conditions that need to hold for a conditionally-const item to be const.
752
+ /// That is, compute the set of `~const` where clauses for a given item.
753
+ ///
754
+ /// This can be thought of as the `~const` equivalent of `predicates_of`. These are the
755
+ /// predicates that need to be proven at usage sites, and can be assumed at definition.
756
+ ///
757
+ /// This query also computes the `~const` where clauses for associated types, which are
758
+ /// not "const", but which have item bounds which may be `~const`. These must hold for
759
+ /// the `~const` item bound to hold.
751
760
query const_conditions(
752
761
key: DefId
753
762
) -> ty:: ConstConditions <' tcx> {
@@ -757,6 +766,11 @@ rustc_queries! {
757
766
separate_provide_extern
758
767
}
759
768
769
+ /// Compute the const bounds that are implied for a conditionally-const item.
770
+ ///
771
+ /// This can be though of as the `~const` equivalent of `explicit_item_bounds`. These
772
+ /// are the predicates that need to proven at definition sites, and can be assumed at
773
+ /// usage sites.
760
774
query explicit_implied_const_bounds(
761
775
key: DefId
762
776
) -> ty:: EarlyBinder <' tcx, & ' tcx [ ( ty:: PolyTraitRef <' tcx>, Span ) ] > {
You can’t perform that action at this time.
0 commit comments