rust/compiler
bors 1c53407e8c Auto merge of #112006 - kylematsuda:earlybinder-private, r=jackh726
Make `EarlyBinder`'s inner value private

Currently, `EarlyBinder(T)`'s inner value is public, which allows implicitly skipping the binder by indexing into the tuple struct (i.e., `x.0`). `@lcnr` suggested making `EarlyBinder`'s inner value private so users are required to explicitly call `skip_binder` (https://github.com/rust-lang/rust/issues/105779#issuecomment-1549933424) .

This PR makes the inner value private, adds `EarlyBinder::new` for constructing a new instance, and replaces uses of `x.0` with `x.skip_binder()` (or similar). It also adds some documentation to `EarlyBinder::skip_binder` explaining how to skip the binder of `&EarlyBinder<T>` to get `&T` now that the inner value is private (since previously we could just do `&x.0`).

r? `@lcnr`
2023-05-28 18:04:53 +00:00
..
rustc
rustc_abi Avoid &format("...") calls in error message code. 2023-05-16 17:59:56 +10:00
rustc_apfloat
rustc_arena
rustc_ast Add warn-by-default lint for local binding shadowing exported glob re-export item 2023-05-27 18:49:07 +08:00
rustc_ast_lowering Auto merge of #111858 - clubby789:fluent-alphabetical, r=jyn514,compiler-errors 2023-05-26 03:31:04 +00:00
rustc_ast_passes Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_ast_pretty
rustc_attr Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_baked_icu_data
rustc_borrowck Rollup merge of #111983 - compiler-errors:type-op-locally, r=lcnr 2023-05-27 13:38:32 +02:00
rustc_builtin_macros Auto merge of #111928 - c410-f3r:dqewdas, r=eholk 2023-05-27 07:02:48 +00:00
rustc_codegen_cranelift Replace EarlyBinder(x) with EarlyBinder::new(x) 2023-05-28 10:44:50 -06:00
rustc_codegen_gcc Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_codegen_llvm Replace EarlyBinder(x) with EarlyBinder::new(x) 2023-05-28 10:44:50 -06:00
rustc_codegen_ssa Replace EarlyBinder(x) with EarlyBinder::new(x) 2023-05-28 10:44:50 -06:00
rustc_const_eval Replace EarlyBinder(x) with EarlyBinder::new(x) 2023-05-28 10:44:50 -06:00
rustc_data_structures Add some comments 2023-05-28 15:54:52 +02:00
rustc_driver
rustc_driver_impl Rollup merge of #109084 - dekrain:fix-panic-arg0-expansion, r=petrochenkov 2023-05-27 20:40:27 +02:00
rustc_error_codes
rustc_error_messages
rustc_errors Auto merge of #111858 - clubby789:fluent-alphabetical, r=jyn514,compiler-errors 2023-05-26 03:31:04 +00:00
rustc_expand Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_feature Use is_some_and/is_ok_and in less obvious spots 2023-05-24 14:33:43 +00:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Use Option::is_some_and and Result::is_ok_and in the compiler 2023-05-24 14:20:41 +00:00
rustc_hir_analysis Make EarlyBinder's inner value private; and fix all of the resulting errors 2023-05-28 10:44:53 -06:00
rustc_hir_pretty
rustc_hir_typeck Make EarlyBinder's inner value private; and fix all of the resulting errors 2023-05-28 10:44:53 -06:00
rustc_incremental Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_index Auto merge of #111925 - Manishearth:rollup-z6z6l2v, r=Manishearth 2023-05-25 00:33:43 +00:00
rustc_infer Make EarlyBinder's inner value private; and fix all of the resulting errors 2023-05-28 10:44:53 -06:00
rustc_interface Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_lexer
rustc_lint Auto merge of #111378 - jieyouxu:local-shadows-glob-reexport, r=petrochenkov 2023-05-28 01:18:51 +00:00
rustc_lint_defs Add warn-by-default lint for local binding shadowing exported glob re-export item 2023-05-27 18:49:07 +08:00
rustc_llvm Add SafeStack support to rustc 2023-05-26 15:18:54 -04:00
rustc_log
rustc_macros Merge query property modules into one 2023-05-18 09:45:12 +02:00
rustc_metadata Replace EarlyBinder(x) with EarlyBinder::new(x) 2023-05-28 10:44:50 -06:00
rustc_middle Add documentation on skip_binder on how to get &T from &EarlyBinder<T> 2023-05-28 10:44:53 -06:00
rustc_mir_build Rollup merge of #111952 - cjgillot:drop-replace, r=WaffleLapkin 2023-05-27 13:38:31 +02:00
rustc_mir_dataflow Rollup merge of #111952 - cjgillot:drop-replace, r=WaffleLapkin 2023-05-27 13:38:31 +02:00
rustc_mir_transform Make EarlyBinder's inner value private; and fix all of the resulting errors 2023-05-28 10:44:53 -06:00
rustc_monomorphize Replace EarlyBinder(x) with EarlyBinder::new(x) 2023-05-28 10:44:50 -06:00
rustc_parse Rollup merge of #111181 - bvanjoi:fix-issue-111148, r=davidtwco 2023-05-27 20:40:28 +02:00
rustc_parse_format
rustc_passes Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_plugin_impl
rustc_privacy Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_query_impl Add comment 2023-05-21 11:25:07 +02:00
rustc_query_system Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_resolve Add warn-by-default lint for local binding shadowing exported glob re-export item 2023-05-27 18:49:07 +08:00
rustc_serialize
rustc_session Add SafeStack support to rustc 2023-05-26 15:18:54 -04:00
rustc_smir Remove DesugaringKind::Replace. 2023-05-25 17:40:46 +00:00
rustc_span Rollup merge of #111952 - cjgillot:drop-replace, r=WaffleLapkin 2023-05-27 13:38:31 +02:00
rustc_symbol_mangling Replace EarlyBinder(x) with EarlyBinder::new(x) 2023-05-28 10:44:50 -06:00
rustc_target Add SafeStack support to rustc 2023-05-26 15:18:54 -04:00
rustc_trait_selection Make EarlyBinder's inner value private; and fix all of the resulting errors 2023-05-28 10:44:53 -06:00
rustc_traits Make EarlyBinder's inner value private; and fix all of the resulting errors 2023-05-28 10:44:53 -06:00
rustc_transmute
rustc_ty_utils Make EarlyBinder's inner value private; and fix all of the resulting errors 2023-05-28 10:44:53 -06:00
rustc_type_ir