File tree Expand file tree Collapse file tree 4 files changed +1
-31
lines changed Expand file tree Collapse file tree 4 files changed +1
-31
lines changed Original file line number Diff line number Diff line change @@ -673,12 +673,7 @@ pub(crate) struct BorrowckInferCtxt<'tcx> {
673
673
674
674
impl < ' tcx > BorrowckInferCtxt < ' tcx > {
675
675
pub ( crate ) fn new ( tcx : TyCtxt < ' tcx > , def_id : LocalDefId ) -> Self {
676
- let typing_mode = if tcx. use_typing_mode_borrowck ( ) {
677
- TypingMode :: borrowck ( tcx, def_id)
678
- } else {
679
- TypingMode :: analysis_in_body ( tcx, def_id)
680
- } ;
681
- let infcx = tcx. infer_ctxt ( ) . build ( typing_mode) ;
676
+ let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: borrowck ( tcx, def_id) ) ;
682
677
let param_env = tcx. param_env ( def_id) ;
683
678
BorrowckInferCtxt { infcx, reg_var_to_origin : RefCell :: new ( Default :: default ( ) ) , param_env }
684
679
}
Original file line number Diff line number Diff line change @@ -198,30 +198,13 @@ pub(crate) fn handle_opaque_type_uses<'tcx>(
198
198
)
199
199
} ) ;
200
200
201
- if !tcx. use_typing_mode_borrowck ( ) {
202
- if let ty:: Alias ( ty:: Opaque , alias_ty) = ty. kind ( )
203
- && alias_ty. def_id == opaque_type_key. def_id . to_def_id ( )
204
- && alias_ty. args == opaque_type_key. args
205
- {
206
- continue ' entry;
207
- }
208
- }
209
201
root_cx. add_concrete_opaque_type (
210
202
opaque_type_key. def_id ,
211
203
OpaqueHiddenType { span : hidden_type. span , ty } ,
212
204
) ;
213
205
}
214
206
215
207
for & ( key, hidden_type) in & opaque_types {
216
- if !tcx. use_typing_mode_borrowck ( ) {
217
- if let ty:: Alias ( ty:: Opaque , alias_ty) = hidden_type. ty . kind ( )
218
- && alias_ty. def_id == key. def_id . to_def_id ( )
219
- && alias_ty. args == key. args
220
- {
221
- continue ;
222
- }
223
- }
224
-
225
208
let Some ( expected) = root_cx. get_concrete_opaque_type ( key. def_id ) else {
226
209
let guar =
227
210
tcx. dcx ( ) . span_err ( hidden_type. span , "non-defining use in the defining scope" ) ;
Original file line number Diff line number Diff line change @@ -3283,11 +3283,6 @@ impl<'tcx> TyCtxt<'tcx> {
3283
3283
self . sess . opts . unstable_opts . next_solver . coherence
3284
3284
}
3285
3285
3286
- #[ allow( rustc:: bad_opt_access) ]
3287
- pub fn use_typing_mode_borrowck ( self ) -> bool {
3288
- self . next_trait_solver_globally ( ) || self . sess . opts . unstable_opts . typing_mode_borrowck
3289
- }
3290
-
3291
3286
pub fn is_impl_trait_in_trait ( self , def_id : DefId ) -> bool {
3292
3287
self . opt_rpitit_info ( def_id) . is_some ( )
3293
3288
}
Original file line number Diff line number Diff line change @@ -2564,9 +2564,6 @@ written to standard error output)"),
2564
2564
"in diagnostics, use heuristics to shorten paths referring to items" ) ,
2565
2565
tune_cpu: Option <String > = ( None , parse_opt_string, [ TRACKED ] ,
2566
2566
"select processor to schedule for (`rustc --print target-cpus` for details)" ) ,
2567
- #[ rustc_lint_opt_deny_field_access( "use `TyCtxt::use_typing_mode_borrowck` instead of this field" ) ]
2568
- typing_mode_borrowck: bool = ( false , parse_bool, [ TRACKED ] ,
2569
- "enable `TypingMode::Borrowck`, changing the way opaque types are handled during MIR borrowck" ) ,
2570
2567
#[ rustc_lint_opt_deny_field_access( "use `Session::ub_checks` instead of this field" ) ]
2571
2568
ub_checks: Option <bool > = ( None , parse_opt_bool, [ TRACKED ] ,
2572
2569
"emit runtime checks for Undefined Behavior (default: -Cdebug-assertions)" ) ,
You can’t perform that action at this time.
0 commit comments