@@ -16,12 +16,12 @@ use crate::ty::{self, GenericArgs, TyCtxt};
16
16
impl < ' tcx > TyCtxt < ' tcx > {
17
17
/// Evaluates a constant without providing any generic parameters. This is useful to evaluate consts
18
18
/// that can't take any generic arguments like const items or enum discriminants. If a
19
- /// generic parameter is used within the constant `ErrorHandled::ToGeneric ` will be returned.
19
+ /// generic parameter is used within the constant `ErrorHandled::TooGeneric ` will be returned.
20
20
#[ instrument( skip( self ) , level = "debug" ) ]
21
21
pub fn const_eval_poly ( self , def_id : DefId ) -> EvalToConstValueResult < ' tcx > {
22
22
// In some situations def_id will have generic parameters within scope, but they aren't allowed
23
23
// to be used. So we can't use `Instance::mono`, instead we feed unresolved generic parameters
24
- // into `const_eval` which will return `ErrorHandled::ToGeneric ` if any of them are
24
+ // into `const_eval` which will return `ErrorHandled::TooGeneric ` if any of them are
25
25
// encountered.
26
26
let args = GenericArgs :: identity_for_item ( self , def_id) ;
27
27
let instance = ty:: Instance :: new ( def_id, args) ;
@@ -32,12 +32,12 @@ impl<'tcx> TyCtxt<'tcx> {
32
32
33
33
/// Evaluates a constant without providing any generic parameters. This is useful to evaluate consts
34
34
/// that can't take any generic arguments like const items or enum discriminants. If a
35
- /// generic parameter is used within the constant `ErrorHandled::ToGeneric ` will be returned.
35
+ /// generic parameter is used within the constant `ErrorHandled::TooGeneric ` will be returned.
36
36
#[ instrument( skip( self ) , level = "debug" ) ]
37
37
pub fn const_eval_poly_to_alloc ( self , def_id : DefId ) -> EvalToAllocationRawResult < ' tcx > {
38
38
// In some situations def_id will have generic parameters within scope, but they aren't allowed
39
39
// to be used. So we can't use `Instance::mono`, instead we feed unresolved generic parameters
40
- // into `const_eval` which will return `ErrorHandled::ToGeneric ` if any of them are
40
+ // into `const_eval` which will return `ErrorHandled::TooGeneric ` if any of them are
41
41
// encountered.
42
42
let args = GenericArgs :: identity_for_item ( self , def_id) ;
43
43
let instance = ty:: Instance :: new ( def_id, args) ;
@@ -201,12 +201,12 @@ impl<'tcx> TyCtxt<'tcx> {
201
201
impl < ' tcx > TyCtxtEnsure < ' tcx > {
202
202
/// Evaluates a constant without providing any generic parameters. This is useful to evaluate consts
203
203
/// that can't take any generic arguments like const items or enum discriminants. If a
204
- /// generic parameter is used within the constant `ErrorHandled::ToGeneric ` will be returned.
204
+ /// generic parameter is used within the constant `ErrorHandled::TooGeneric ` will be returned.
205
205
#[ instrument( skip( self ) , level = "debug" ) ]
206
206
pub fn const_eval_poly ( self , def_id : DefId ) {
207
207
// In some situations def_id will have generic parameters within scope, but they aren't allowed
208
208
// to be used. So we can't use `Instance::mono`, instead we feed unresolved generic parameters
209
- // into `const_eval` which will return `ErrorHandled::ToGeneric ` if any of them are
209
+ // into `const_eval` which will return `ErrorHandled::TooGeneric ` if any of them are
210
210
// encountered.
211
211
let args = GenericArgs :: identity_for_item ( self . tcx , def_id) ;
212
212
let instance = ty:: Instance :: new ( def_id, self . tcx . erase_regions ( args) ) ;
0 commit comments