8
8
//! specialization errors. These things can (and probably should) be
9
9
//! fixed, but for the moment it's easier to do these checks early.
10
10
11
- use crate :: constrained_generic_params as ctp ;
11
+ use crate :: constrained_generic_params as cgp ;
12
12
use rustc:: hir;
13
13
use rustc:: hir:: itemlikevisit:: ItemLikeVisitor ;
14
14
use rustc:: hir:: def_id:: DefId ;
@@ -102,8 +102,8 @@ fn enforce_impl_params_are_constrained<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
102
102
let impl_predicates = tcx. predicates_of ( impl_def_id) ;
103
103
let impl_trait_ref = tcx. impl_trait_ref ( impl_def_id) ;
104
104
105
- let mut input_parameters = ctp :: parameters_for_impl ( impl_self_ty, impl_trait_ref) ;
106
- ctp :: identify_constrained_generic_params (
105
+ let mut input_parameters = cgp :: parameters_for_impl ( impl_self_ty, impl_trait_ref) ;
106
+ cgp :: identify_constrained_generic_params (
107
107
tcx, & impl_predicates, impl_trait_ref, & mut input_parameters) ;
108
108
109
109
// Disallow unconstrained lifetimes, but only if they appear in assoc types.
@@ -114,23 +114,23 @@ fn enforce_impl_params_are_constrained<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
114
114
item. kind == ty:: AssociatedKind :: Type && item. defaultness . has_value ( )
115
115
} )
116
116
. flat_map ( |def_id| {
117
- ctp :: parameters_for ( & tcx. type_of ( def_id) , true )
117
+ cgp :: parameters_for ( & tcx. type_of ( def_id) , true )
118
118
} ) . collect ( ) ;
119
119
120
120
for param in & impl_generics. params {
121
121
match param. kind {
122
122
// Disallow ANY unconstrained type parameters.
123
123
ty:: GenericParamDefKind :: Type { .. } => {
124
124
let param_ty = ty:: ParamTy :: for_def ( param) ;
125
- if !input_parameters. contains ( & ctp :: Parameter :: from ( param_ty) ) {
125
+ if !input_parameters. contains ( & cgp :: Parameter :: from ( param_ty) ) {
126
126
report_unused_parameter ( tcx,
127
127
tcx. def_span ( param. def_id ) ,
128
128
"type" ,
129
129
& param_ty. to_string ( ) ) ;
130
130
}
131
131
}
132
132
ty:: GenericParamDefKind :: Lifetime => {
133
- let param_lt = ctp :: Parameter :: from ( param. to_early_bound_region_data ( ) ) ;
133
+ let param_lt = cgp :: Parameter :: from ( param. to_early_bound_region_data ( ) ) ;
134
134
if lifetimes_in_associated_types. contains ( & param_lt) && // (*)
135
135
!input_parameters. contains ( & param_lt) {
136
136
report_unused_parameter ( tcx,
@@ -141,7 +141,7 @@ fn enforce_impl_params_are_constrained<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
141
141
}
142
142
ty:: GenericParamDefKind :: Const => {
143
143
let param_ct = ty:: ParamConst :: for_def ( param) ;
144
- if !input_parameters. contains ( & ctp :: Parameter :: from ( param_ct) ) {
144
+ if !input_parameters. contains ( & cgp :: Parameter :: from ( param_ct) ) {
145
145
report_unused_parameter ( tcx,
146
146
tcx. def_span ( param. def_id ) ,
147
147
"const" ,
0 commit comments