rust/compiler
Guillaume Gomez b0ae228007
Rollup merge of #141413 - est31:cfg_version_env_var, r=jieyouxu
Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING

The `#[cfg(version(...))]` feature is currently under-tested. Part of it is the difficulty that it is hard to write a test that never changes, while the version of the Rust compiler indeed *does* change.

PR #81468 added the first and so far only test of `#[cfg(version(...))]`'s functionality (there is one other test for the *syntax*, that also acts as feature gate). But that test uses a proc macro that parses the version: the text of the test doesn't contain the actual `#[cfg(version(...))]`.

This PR makes `#[cfg(version(...))]` respect `RUSTC_OVERRIDE_VERSION_STRING`, added by PR #124339, allowing us to virtually pin the rustc version and write tests from all directions against some specific version.

The PR also adds a functional test of `#[cfg(version(...))]` that leverages `RUSTC_OVERRIDE_VERSION_STRING`.

Pulled out of #141137.

Tracking issue: #64796
2025-05-25 15:11:47 +02:00
..
rustc
rustc_abi
rustc_arena
rustc_ast introduce common macro for MutVisitor and Visitor to dedup code 2025-05-19 21:21:03 +08:00
rustc_ast_ir
rustc_ast_lowering Rename kw::Empty as sym::empty. 2025-05-22 11:55:22 +10:00
rustc_ast_passes update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_ast_pretty
rustc_attr_data_structures Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING 2025-05-24 23:54:17 +02:00
rustc_attr_parsing Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING 2025-05-24 23:54:17 +02:00
rustc_baked_icu_data
rustc_borrowck Rollup merge of #139668 - matthewjasper:upper-bound-fix, r=compiler-errors 2025-05-22 16:02:26 +02:00
rustc_builtin_macros Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_codegen_cranelift Rename cfg_match! to cfg_select! 2025-05-20 21:16:23 +00:00
rustc_codegen_gcc Cleanup CodegenFnAttrFlags 2025-05-24 20:31:37 +02:00
rustc_codegen_llvm Cleanup CodegenFnAttrFlags 2025-05-24 20:31:37 +02:00
rustc_codegen_ssa Auto merge of #141518 - GuillaumeGomez:rollup-ivjep2j, r=GuillaumeGomez 2025-05-24 21:00:10 +00:00
rustc_const_eval Rollup merge of #140972 - Stypox:machine-tracing-flag, r=RalfJung 2025-05-20 20:57:26 +02:00
rustc_data_structures Rollup merge of #139668 - matthewjasper:upper-bound-fix, r=compiler-errors 2025-05-22 16:02:26 +02:00
rustc_driver
rustc_driver_impl compiler & tools: bump windows crate to dedupe versions 2025-05-17 15:26:38 +03:00
rustc_error_codes
rustc_error_messages
rustc_errors compiler & tools: bump windows crate to dedupe versions 2025-05-17 15:26:38 +03:00
rustc_expand Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_feature Stabilize avx512_target_feature 2025-05-18 11:12:15 +05:30
rustc_fluent_macro update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_fs_util
rustc_graphviz
rustc_hashes
rustc_hir Rename kw::Empty as sym::empty. 2025-05-22 11:55:22 +10:00
rustc_hir_analysis Auto merge of #140553 - BoxyUwU:defer_type_system_ctfe, r=compiler-errors 2025-05-23 05:30:45 +00:00
rustc_hir_pretty update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_hir_typeck Do not try to confirm non-dyn compatible method 2025-05-23 12:20:35 +00:00
rustc_incremental Auto merge of #139758 - Zoxc:thread-local-graph, r=oli-obk 2025-05-07 12:39:54 +00:00
rustc_index
rustc_index_macros
rustc_infer yeet CanonicalVarInfo 2025-05-23 12:10:53 +00:00
rustc_interface Move -Zcrate-attr injection to just after crate root parsing 2025-05-21 14:32:40 +00:00
rustc_lexer
rustc_lint Suggest correct version("..") predicate syntax in check-cfg 2025-05-23 18:14:49 +02:00
rustc_lint_defs make enabling the neon target feature a FCW 2025-05-22 12:19:25 +02:00
rustc_llvm Experimental cygwin support in rustc 2025-05-15 23:34:11 +08:00
rustc_log
rustc_macros Allow trailing comma after argument in query definition 2025-05-20 10:22:08 +00:00
rustc_metadata Introduce tcx.anon_const_kind query 2025-05-21 20:20:19 +01:00
rustc_middle Rollup merge of #141511 - Noratrieb:codegen-fn-attrs, r=compiler-errors 2025-05-24 21:23:50 +02:00
rustc_mir_build Dont walk into unsafe binders when emiting error for non-structural type match 2025-05-23 10:10:50 +00:00
rustc_mir_dataflow update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_mir_transform Rollup merge of #140967 - azhogin:azhogin/async-drop-poll-shim-for-error-dropee-fix, r=oli-obk 2025-05-23 13:34:17 +02:00
rustc_monomorphize Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_next_trait_solver yeet CanonicalVarInfo 2025-05-23 12:10:53 +00:00
rustc_parse Rollup merge of #141003 - clubby789:ternary-improve, r=compiler-errors 2025-05-16 07:19:41 +02:00
rustc_parse_format
rustc_passes Cleanup CodegenFnAttrFlags 2025-05-24 20:31:37 +02:00
rustc_pattern_analysis Revert "Fix stack overflow in exhaustiveness due to recursive HIR opaque type values" 2025-05-20 10:09:01 +00:00
rustc_privacy Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin 2025-05-19 13:24:54 +10:00
rustc_query_impl
rustc_query_system Handle rustc_query_system cases of rustc::potential_query_instability lint 2025-05-14 08:59:55 +03:00
rustc_resolve Rollup merge of #141376 - nnethercote:rename-kw-Empty, r=petrochenkov 2025-05-23 13:34:20 +02:00
rustc_sanitizers update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
rustc_serialize
rustc_session current_dll_path: fix mistake in assertion message 2025-05-19 20:20:54 +02:00
rustc_smir
rustc_span Rollup merge of #141376 - nnethercote:rename-kw-Empty, r=petrochenkov 2025-05-23 13:34:20 +02:00
rustc_symbol_mangling Rename kw::Empty as sym::empty. 2025-05-22 11:55:22 +10:00
rustc_target Rollup merge of #140832 - workingjubilee:aarch64-linux-should-use-frame-pointers, r=compiler-errors 2025-05-23 20:30:09 +02:00
rustc_trait_selection yeet CanonicalVarInfo 2025-05-23 12:10:53 +00:00
rustc_traits Querify coroutine_hidden_types 2025-05-20 11:50:25 +00:00
rustc_transmute
rustc_ty_utils Rollup merge of #140926 - azhogin:azhogin/async-drop-coroutine-layout-returns-layout-error, r=oli-obk 2025-05-18 18:44:12 +02:00
rustc_type_ir yeet CanonicalVarInfo 2025-05-23 12:10:53 +00:00
rustc_type_ir_macros
stable_mir