rust/compiler
bors 7f0fa485a6 Auto merge of #115582 - compiler-errors:refine-yeet, r=oli-obk
Implement refinement lint for RPITIT

Implements a lint that warns against accidentally refining an RPITIT in an implementation. This is not a hard error, and can be suppressed with `#[allow(refining_impl_trait)]`, since this behavior may be desirable -- the lint just serves as an acknowledgement from the impl author that they understand that the types they write in the implementation are an API guarantee.

This compares bounds syntactically, not semantically -- semantic implication is more difficult and essentially relies on adding the ability to keep the RPITIT hidden in the trait system so that things can be proven about the type that shows up in the impl without its own bounds leaking through, either via a new reveal mode or something else. This was experimentally implemented in #111931.

Somewhat opinionated choices:
1. Putting the lint behind `refining_impl_trait` rather than a blanket `refine` lint. This could be changed, but I like keeping the lint specialized to RPITITs so the explanation can be tailored to it.
2. This PR does not include the `#[refine]` attribute or the feature gate, since it's kind of orthogonal and can be added in a separate PR.

r? `@oli-obk`
2023-09-07 07:26:26 +00:00
..
rustc inline format!() args up to and including rustc_middle 2023-07-30 13:18:33 +02:00
rustc_abi there seems to be no reason to treat ZST specially in these cases 2023-08-29 08:58:58 +02:00
rustc_arena Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00
rustc_ast improve AttrTokenStream 2023-09-04 20:07:28 +08:00
rustc_ast_lowering Don't hold the definitions' lock across index_hir 2023-09-02 08:13:07 +02:00
rustc_ast_passes Auto merge of #115131 - frank-king:feature/unnamed-fields-lite, r=petrochenkov 2023-08-24 12:52:35 +00:00
rustc_ast_pretty Auto merge of #115131 - frank-king:feature/unnamed-fields-lite, r=petrochenkov 2023-08-24 12:52:35 +00:00
rustc_attr Auto merge of #114201 - Centri3:explicit-repr-rust, r=WaffleLapkin 2023-08-25 00:02:54 +00:00
rustc_baked_icu_data Regen baked data 2023-05-02 10:45:16 -07:00
rustc_borrowck Rollup merge of #114511 - chenyukang:yukang-fix-114374-fmt-args, r=b-naber 2023-09-06 19:31:48 +02:00
rustc_builtin_macros Load include_bytes! directly into an Lrc 2023-08-27 20:16:19 -04:00
rustc_codegen_cranelift Auto merge of #115616 - bjorn3:sync_cg_clif-2023-09-06, r=bjorn3 2023-09-07 03:56:43 +00:00
rustc_codegen_gcc Rollup merge of #111580 - atsuzaki:layout-ice, r=oli-obk 2023-08-29 20:49:02 +02:00
rustc_codegen_llvm Use relative positions inside a SourceFile. 2023-09-03 12:56:10 +00:00
rustc_codegen_ssa Refactor how MIR represents composite debuginfo. 2023-09-05 17:20:07 +00:00
rustc_const_eval Refactor how MIR represents composite debuginfo. 2023-09-05 17:20:07 +00:00
rustc_data_structures Use a reference to the lock in the guards 2023-09-06 11:44:06 +02:00
rustc_driver Update rustix 2023-07-03 07:20:51 +00:00
rustc_driver_impl Rollup merge of #113565 - workingjubilee:better-signal-handler-message, r=pnkfelix 2023-08-30 07:18:10 +02:00
rustc_error_codes Auto merge of #113126 - Bryanskiy:delete_old, r=petrochenkov 2023-09-01 12:40:01 +00:00
rustc_error_messages Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00
rustc_errors Implement refinement lint for RPITIT 2023-09-07 00:49:09 +00:00
rustc_expand Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00
rustc_feature fix version for abi_thiscall to 1.73.0, which was forgotten to change when stabilized 2023-09-01 19:46:09 +03:00
rustc_fluent_macro Fix diagnostics with errors 2023-05-26 10:44:18 +00:00
rustc_fs_util Add try_canonicalize to rustc_fs_util and use it over fs::canonicalize 2023-03-16 21:50:23 +01:00
rustc_graphviz enable rust_2018_idioms for doctests 2023-05-07 00:12:29 +03:00
rustc_hir replace doc occurrences of ItemLikeVisitor 2023-09-05 22:40:36 +02:00
rustc_hir_analysis Add note 2023-09-07 01:31:33 +00:00
rustc_hir_pretty Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obk 2023-08-08 19:23:41 +00:00
rustc_hir_typeck Remove allow_private entirely. 2023-08-29 16:36:13 -07:00
rustc_incremental Ignore unexpected incr-comp session dirs 2023-08-18 19:57:41 +02:00
rustc_index Auto merge of #115094 - Mark-Simulacrum:bootstrap-update, r=ozkanonur 2023-08-24 11:10:52 +00:00
rustc_infer Test and note unsafe ctor to fn ptr coercion 2023-08-30 15:09:40 -07:00
rustc_interface Rename Freeze to FreezeLock 2023-09-02 08:14:06 +02:00
rustc_lexer Update lexer emoji diagnostics to Unicode 15.0 2023-07-29 08:47:21 +08:00
rustc_lint Auto merge of #115166 - Urgau:invalid_ref_casting-invalid-unsafecell-usage, r=est31 2023-09-07 00:24:45 +00:00
rustc_lint_defs Don't emit refining_impl_trait for private items 2023-09-07 01:31:32 +00:00
rustc_llvm Auto merge of #114946 - anforowicz:generic-fix-for-asan-lto, r=tmiasko 2023-09-06 20:04:03 +00:00
rustc_log inline format!() args up to and including rustc_middle 2023-07-30 13:18:33 +02:00
rustc_macros Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00
rustc_metadata Register the file while computing its start position. 2023-09-03 15:02:46 +00:00
rustc_middle Auto merge of #115582 - compiler-errors:refine-yeet, r=oli-obk 2023-09-07 07:26:26 +00:00
rustc_mir_build Refactor how MIR represents composite debuginfo. 2023-09-05 17:20:07 +00:00
rustc_mir_dataflow Take &mut Results in ResultsVisitor 2023-09-02 19:35:51 -04:00
rustc_mir_transform Auto merge of #115615 - matthiaskrgr:rollup-49fosdf, r=matthiaskrgr 2023-09-06 18:16:06 +00:00
rustc_monomorphize Rollup merge of #115492 - Enselic:large-box-move, r=oli-obk 2023-09-05 07:15:16 +02:00
rustc_parse Rollup merge of #115596 - nnethercote:two-small-changes, r=lqd 2023-09-06 19:31:50 +02:00
rustc_parse_format Replace data_structures dependency with index in rustc_parse_format 2023-09-05 19:11:50 +02:00
rustc_passes add rustc_abi debugging attribute 2023-08-27 11:55:49 +02:00
rustc_plugin_impl Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_privacy Auto merge of #113126 - Bryanskiy:delete_old, r=petrochenkov 2023-09-01 12:40:01 +00:00
rustc_query_impl remove some unused crate deps 2023-09-01 19:13:09 +03:00
rustc_query_system Auto merge of #110050 - saethlin:better-u32-encoding, r=nnethercote 2023-09-07 02:09:41 +00:00
rustc_resolve Auto merge of #115429 - compiler-errors:assoc-ct-lt-fallthrough, r=cjgillot 2023-09-02 10:55:49 +00:00
rustc_serialize Use a specialized varint + bitpacking scheme for DepGraph encoding 2023-09-04 12:16:50 -04:00
rustc_session Rename Freeze to FreezeLock 2023-09-02 08:14:06 +02:00
rustc_smir Rollup merge of #115605 - ouz-a:smir_better_debug, r=oli-obk 2023-09-06 19:31:51 +02:00
rustc_span Auto merge of #115166 - Urgau:invalid_ref_casting-invalid-unsafecell-usage, r=est31 2023-09-07 00:24:45 +00:00
rustc_symbol_mangling Fix CFI: f32 and f64 are encoded incorrectly for c 2023-08-24 21:02:06 -07:00
rustc_target Auto merge of #114114 - keith:ks/always-add-lc_build_version-for-metadata-object-files, r=wesleywiser 2023-08-29 21:17:13 +00:00
rustc_trait_selection Auto merge of #115529 - chenyukang:yukang-fix-115402-overflowsize, r=compiler-errors 2023-09-06 02:37:41 +00:00
rustc_traits remove some unused crate deps 2023-09-01 19:13:09 +03:00
rustc_transmute Fix error report for size overflow from transmute 2023-09-06 06:48:34 +08:00
rustc_ty_utils some more is_zst that should be is_1zst 2023-08-29 14:11:27 +02:00
rustc_type_ir Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00