1
Fork 0
rust/compiler
Jacob Pratt 94bf32e719
Rollup merge of #136835 - compiler-errors:contracts-span-hack, r=celinval
Stop using span hack for contracts feature gating

The contracts machinery is a pretty straightforward case of an *external* feature using a (perma-unstable) *internal* feature within its implementation. There's no reason why it needs to be implemented any differently than other features by using global span tracking hacks to change whether the internals are gated behind the `contracts` or `contracts_internals` feature gate -- for the case of macro expansions we already have `allow_internal_unstable` for exactly this situation.

This PR changes the internal, perma-unstable AST syntax to use the `contracts_internals` gate always, and adjusts the macro expansion to use the right spans so that `allow_internal_unstable` works correctly.

As a follow-up, there's really no reason to have `contracts` be a *compiler feature* since it's at this point fully a *library feature*; the only reason it's a compiler feature today is so we can mark it as incomplete, but that seems like a weak reason. I didn't do anything in this PR for this.

r? ``@celinval``
2025-02-11 01:02:43 -05:00
..
rustc
rustc_abi Rustfmt 2025-02-08 22:12:13 +00:00
rustc_arena Add inherent versions of MaybeUninit methods for slices 2025-01-11 23:57:00 -05:00
rustc_ast Rollup merge of #136419 - EnzymeAD:autodiff-tests, r=onur-ozkan,jieyouxu 2025-02-10 16:38:23 +01:00
rustc_ast_ir
rustc_ast_lowering Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum 2025-02-09 15:44:16 +00:00
rustc_ast_passes compiler: use rustc_abi in rustc_ast_* 2025-02-07 21:52:37 -08:00
rustc_ast_pretty Auto merge of #136471 - safinaskar:parallel, r=SparrowLii 2025-02-06 10:50:05 +00:00
rustc_attr_data_structures rustc_allowed_through_unstable_modules: require deprecation message 2025-02-02 12:36:12 +01:00
rustc_attr_parsing Rustfmt 2025-02-08 22:12:13 +00:00
rustc_baked_icu_data
rustc_borrowck Rustfmt 2025-02-08 22:12:13 +00:00
rustc_builtin_macros Fix imports, remove attrs for unused_* 2025-02-10 20:15:30 +00:00
rustc_codegen_cranelift Rollup merge of #136714 - tgross35:update-builtins, r=tgross35 2025-02-10 16:38:26 +01:00
rustc_codegen_gcc Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum 2025-02-09 15:44:16 +00:00
rustc_codegen_llvm Rollup merge of #136813 - mrkajetanp:aarch32-fp16-target-feature, r=davidtwco 2025-02-11 01:02:41 -05:00
rustc_codegen_ssa Rollup merge of #136419 - EnzymeAD:autodiff-tests, r=onur-ozkan,jieyouxu 2025-02-10 16:38:23 +01:00
rustc_const_eval Rustfmt 2025-02-08 22:12:13 +00:00
rustc_data_structures Rustfmt 2025-02-08 22:12:13 +00:00
rustc_driver
rustc_driver_impl Rollup merge of #136636 - bjorn3:error_cleanup, r=compiler-errors 2025-02-06 21:56:28 +01:00
rustc_error_codes Auto merge of #133154 - estebank:issue-133137, r=wesleywiser 2025-01-25 11:41:21 +00:00
rustc_error_messages tree-wide: parallel: Fully removed all Lrc, replaced with Arc 2025-02-03 13:25:57 +03:00
rustc_errors Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
rustc_expand Rustfmt 2025-02-08 22:12:13 +00:00
rustc_feature Rollup merge of #134367 - WaffleLapkin:trait_upcasting_as_a_treat, r=compiler-errors 2025-02-07 18:26:25 +01:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz Rustfmt 2025-02-08 22:12:13 +00:00
rustc_hir Rustfmt 2025-02-08 22:12:13 +00:00
rustc_hir_analysis Rustfmt 2025-02-08 22:12:13 +00:00
rustc_hir_pretty Rustfmt 2025-02-08 22:12:13 +00:00
rustc_hir_typeck Rustfmt 2025-02-08 22:12:13 +00:00
rustc_incremental Rustfmt 2025-02-08 22:12:13 +00:00
rustc_index Rustfmt 2025-02-08 22:12:13 +00:00
rustc_index_macros update rustc_index_macros feature handling 2024-12-19 20:32:12 +03:00
rustc_infer Rustfmt 2025-02-08 22:12:13 +00:00
rustc_interface Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum 2025-02-09 15:44:16 +00:00
rustc_lexer Rustfmt 2025-02-08 22:12:13 +00:00
rustc_lint Rollup merge of #136760 - chenyukang:fix-overflowing-int-lint-crash, r=oli-obk 2025-02-09 19:44:53 +01:00
rustc_lint_defs Rollup merge of #135964 - ehuss:cenum_impl_drop_cast, r=Nadrieril 2025-02-05 19:09:33 +08:00
rustc_llvm Rollup merge of #136419 - EnzymeAD:autodiff-tests, r=onur-ozkan,jieyouxu 2025-02-10 16:38:23 +01:00
rustc_log Avoid naming variables str 2025-01-07 14:30:02 +02:00
rustc_macros Rustfmt 2025-02-08 22:12:13 +00:00
rustc_metadata Rustfmt 2025-02-08 22:12:13 +00:00
rustc_middle Rollup merge of #136731 - safinaskar:parallel-2025-02-08-07-22, r=SparrowLii 2025-02-10 16:38:27 +01:00
rustc_mir_build Rustfmt 2025-02-08 22:12:13 +00:00
rustc_mir_dataflow Rustfmt 2025-02-08 22:12:13 +00:00
rustc_mir_transform Rollup merge of #136053 - Zalathar:defer-counters, r=saethlin 2025-02-10 00:51:49 -08:00
rustc_monomorphize Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum 2025-02-09 15:44:16 +00:00
rustc_next_trait_solver Rustfmt 2025-02-08 22:12:13 +00:00
rustc_parse Stop using span hack for contracts feature gating 2025-02-10 19:51:26 +00:00
rustc_parse_format Rustfmt 2025-02-08 22:12:13 +00:00
rustc_passes Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum 2025-02-09 15:44:16 +00:00
rustc_pattern_analysis Get rid of mir::Const::from_ty_const 2025-01-20 04:26:44 +00:00
rustc_privacy Make comma separated lists of anything easier to make for errors 2025-01-31 20:36:44 +00:00
rustc_query_impl Removed dependency on the field-offset crate. 2025-02-05 17:56:06 +01:00
rustc_query_system Auto merge of #136471 - safinaskar:parallel, r=SparrowLii 2025-02-06 10:50:05 +00:00
rustc_resolve Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum 2025-02-09 15:44:16 +00:00
rustc_sanitizers check the types in ty::Value to value conversion 2025-01-30 18:13:16 +01:00
rustc_serialize
rustc_session Stop using span hack for contracts feature gating 2025-02-10 19:51:26 +00:00
rustc_smir Rustfmt 2025-02-08 22:12:13 +00:00
rustc_span Auto merge of #136471 - safinaskar:parallel, r=SparrowLii 2025-02-06 10:50:05 +00:00
rustc_symbol_mangling Move try_to_raw_bytes from ty::Valtree to ty::Value 2025-02-03 18:33:27 +01:00
rustc_target Rollup merge of #136813 - mrkajetanp:aarch32-fp16-target-feature, r=davidtwco 2025-02-11 01:02:41 -05:00
rustc_trait_selection Rustfmt 2025-02-08 22:12:13 +00:00
rustc_traits Auto merge of #136011 - compiler-errors:query-norm-vaniquishes-us, r=jackh726 2025-01-29 02:12:12 +00:00
rustc_transmute transmutability: fix ICE when passing wrong ADT to ASSUME 2025-02-08 05:44:29 +01:00
rustc_ty_utils Rustfmt 2025-02-08 22:12:13 +00:00
rustc_type_ir Rustfmt 2025-02-08 22:12:13 +00:00
rustc_type_ir_macros Rustfmt 2025-02-08 22:12:13 +00:00
stable_mir occured -> occurred 2025-02-08 22:28:21 +00:00