Repository navigation
Add new RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags mode for testing stable compiler behavior in UI tests - #163664
Conversation
|
The rustc-dev-guide subtree was changed. If your future PRs only touch the subtree, consider submitting them directly to rust-lang/rustc-dev-guide, which is where the document is primarily maintained (and has faster CI). Some changes occurred in src/tools/compiletest cc @jieyouxu |
This comment has been minimized.
This comment has been minimized.
80eb9e2 to
9565273
Compare
|
You can probably remove rust/compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh Lines 162 to 167 in c165834 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
9565273 to
a36b6f8
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a36b6f8 to
8e072e8
Compare
This comment has been minimized.
This comment has been minimized.
8e072e8 to
0c3b3be
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
…-real-2, r=jieyouxu Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests Right now, it is [not possible](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707) to test how the compiler behaves on the stable toolchain in UI tests. Even though rust-lang#132993 added a mechanism to emulate stable rustc on the nightly channel, using the `RUSTC_BOOTSTRAP=-1` environment variable, this mechanism is not currently usable within compiletest and UI tests directly, because compiletest unconditionally passes several unstable `-Z` flags that are load-bearing for the testing infra itself to work (notably `-Zui-testing` and friends). That is quite annoying, because we do in fact want to test stable behavior in a couple of tests, but today we have to write those as `run-make` tests (latest example: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707), even if the tested situation is very simple. Those are harder to read, write and maintain than UI tests and they do not support blessing outputs as well as UI tests. Recently, I at least added rust-lang#163444 as a way of centralizing the logic of testing a stable `rustc` in a run-make test, but that does not really help with the fact that we still have to use run-make tests for it, even when a normal UI test would do. For rust-lang#162848, I would also like to have a way of passing `-Zthreads=1` to all run-make tests, even if they are testing stable `rustc`, but that's not easily possible, because those tests are using `RUSTC_BOOTSTRAP=-1`. This PR proposes to add a new mode to `RUSTC_BOOTSTRAP`, with the value of `-allow-unstable-compiler-flags=<flags>`. This can be used to emulate the behavior of stable rustc, while still allowing passing *specific* unstable flags to the compiler. The stability check in the compiler is thus now separated into two questions: - Are we an unstable/nightly build? - Can we accept specific unstable compiler flags? The latter is checked only at a few places, so the necessary change to the compiler is rather small (IMO). To demonstrate how this would be used, I also implemented a new directive into compiletest in this PR, `act-as-stable`. That can be used in a UI test to emulate stable rustc. Some tests before used `only-stable` to "achieve" this, which is very misleading, because it doesn't work at all 😆, due to compiletest unconditionally passing `RUSTC_BOOTSTRAP=1` to all executed tests. `act-as-stable` fixes that. The last two commits demonstrate how we could replace run-make tests that tested different output on stable/nightly with UI tests. I suppose that this mode might be interesting for other people outside of `rust-lang/rust`, but if you don't want that, I can gate it behind `-Zui-testing`. r? jieyouxu
…uwer Rollup of 8 pull requests Successful merges: - #163575 (core: Add examples and assembly tests for `abort_immediate`) - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests) - #163338 (MIR move elimination [4/6]: MoveElimination) - #163701 (add ReadDir::dir to get the directory handle of the underlying directory) - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`) - #164509 (layout invariant: turn delayed bug back into proper assertion) - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules) - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
…-real-2, r=jieyouxu Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests Right now, it is [not possible](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707) to test how the compiler behaves on the stable toolchain in UI tests. Even though rust-lang#132993 added a mechanism to emulate stable rustc on the nightly channel, using the `RUSTC_BOOTSTRAP=-1` environment variable, this mechanism is not currently usable within compiletest and UI tests directly, because compiletest unconditionally passes several unstable `-Z` flags that are load-bearing for the testing infra itself to work (notably `-Zui-testing` and friends). That is quite annoying, because we do in fact want to test stable behavior in a couple of tests, but today we have to write those as `run-make` tests (latest example: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707), even if the tested situation is very simple. Those are harder to read, write and maintain than UI tests and they do not support blessing outputs as well as UI tests. Recently, I at least added rust-lang#163444 as a way of centralizing the logic of testing a stable `rustc` in a run-make test, but that does not really help with the fact that we still have to use run-make tests for it, even when a normal UI test would do. For rust-lang#162848, I would also like to have a way of passing `-Zthreads=1` to all run-make tests, even if they are testing stable `rustc`, but that's not easily possible, because those tests are using `RUSTC_BOOTSTRAP=-1`. This PR proposes to add a new mode to `RUSTC_BOOTSTRAP`, with the value of `-allow-unstable-compiler-flags=<flags>`. This can be used to emulate the behavior of stable rustc, while still allowing passing *specific* unstable flags to the compiler. The stability check in the compiler is thus now separated into two questions: - Are we an unstable/nightly build? - Can we accept specific unstable compiler flags? The latter is checked only at a few places, so the necessary change to the compiler is rather small (IMO). To demonstrate how this would be used, I also implemented a new directive into compiletest in this PR, `act-as-stable`. That can be used in a UI test to emulate stable rustc. Some tests before used `only-stable` to "achieve" this, which is very misleading, because it doesn't work at all 😆, due to compiletest unconditionally passing `RUSTC_BOOTSTRAP=1` to all executed tests. `act-as-stable` fixes that. The last two commits demonstrate how we could replace run-make tests that tested different output on stable/nightly with UI tests. I suppose that this mode might be interesting for other people outside of `rust-lang/rust`, but if you don't want that, I can gate it behind `-Zui-testing`. r? jieyouxu
…uwer Rollup of 14 pull requests Successful merges: - #163575 (core: Add examples and assembly tests for `abort_immediate`) - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests) - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs) - #163338 (MIR move elimination [4/6]: MoveElimination) - #163701 (add ReadDir::dir to get the directory handle of the underlying directory) - #164488 (Don't try to skip anything in `Skip::advance_by(0)`) - #164578 (Don't ignore unknown LLVM diagnostics) - #164611 (Improve bit permutation codegen) - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`) - #162668 (document that `!` does bitwise and logical negation) - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons) - #164509 (layout invariant: turn delayed bug back into proper assertion) - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules) - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
…-real-2, r=jieyouxu Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests Right now, it is [not possible](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707) to test how the compiler behaves on the stable toolchain in UI tests. Even though rust-lang#132993 added a mechanism to emulate stable rustc on the nightly channel, using the `RUSTC_BOOTSTRAP=-1` environment variable, this mechanism is not currently usable within compiletest and UI tests directly, because compiletest unconditionally passes several unstable `-Z` flags that are load-bearing for the testing infra itself to work (notably `-Zui-testing` and friends). That is quite annoying, because we do in fact want to test stable behavior in a couple of tests, but today we have to write those as `run-make` tests (latest example: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707), even if the tested situation is very simple. Those are harder to read, write and maintain than UI tests and they do not support blessing outputs as well as UI tests. Recently, I at least added rust-lang#163444 as a way of centralizing the logic of testing a stable `rustc` in a run-make test, but that does not really help with the fact that we still have to use run-make tests for it, even when a normal UI test would do. For rust-lang#162848, I would also like to have a way of passing `-Zthreads=1` to all run-make tests, even if they are testing stable `rustc`, but that's not easily possible, because those tests are using `RUSTC_BOOTSTRAP=-1`. This PR proposes to add a new mode to `RUSTC_BOOTSTRAP`, with the value of `-allow-unstable-compiler-flags=<flags>`. This can be used to emulate the behavior of stable rustc, while still allowing passing *specific* unstable flags to the compiler. The stability check in the compiler is thus now separated into two questions: - Are we an unstable/nightly build? - Can we accept specific unstable compiler flags? The latter is checked only at a few places, so the necessary change to the compiler is rather small (IMO). To demonstrate how this would be used, I also implemented a new directive into compiletest in this PR, `act-as-stable`. That can be used in a UI test to emulate stable rustc. Some tests before used `only-stable` to "achieve" this, which is very misleading, because it doesn't work at all 😆, due to compiletest unconditionally passing `RUSTC_BOOTSTRAP=1` to all executed tests. `act-as-stable` fixes that. The last two commits demonstrate how we could replace run-make tests that tested different output on stable/nightly with UI tests. I suppose that this mode might be interesting for other people outside of `rust-lang/rust`, but if you don't want that, I can gate it behind `-Zui-testing`. r? jieyouxu
…uwer Rollup of 13 pull requests Successful merges: - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests) - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs) - #163338 (MIR move elimination [4/6]: MoveElimination) - #163701 (add ReadDir::dir to get the directory handle of the underlying directory) - #164488 (Don't try to skip anything in `Skip::advance_by(0)`) - #164578 (Don't ignore unknown LLVM diagnostics) - #164611 (Improve bit permutation codegen) - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`) - #162668 (document that `!` does bitwise and logical negation) - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons) - #164509 (layout invariant: turn delayed bug back into proper assertion) - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules) - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
…uwer Rollup of 13 pull requests Successful merges: - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests) - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs) - #163338 (MIR move elimination [4/6]: MoveElimination) - #163701 (add ReadDir::dir to get the directory handle of the underlying directory) - #164488 (Don't try to skip anything in `Skip::advance_by(0)`) - #164578 (Don't ignore unknown LLVM diagnostics) - #164611 (Improve bit permutation codegen) - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`) - #162668 (document that `!` does bitwise and logical negation) - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons) - #164509 (layout invariant: turn delayed bug back into proper assertion) - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules) - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
…-real-2, r=jieyouxu Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests Right now, it is [not possible](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707) to test how the compiler behaves on the stable toolchain in UI tests. Even though rust-lang#132993 added a mechanism to emulate stable rustc on the nightly channel, using the `RUSTC_BOOTSTRAP=-1` environment variable, this mechanism is not currently usable within compiletest and UI tests directly, because compiletest unconditionally passes several unstable `-Z` flags that are load-bearing for the testing infra itself to work (notably `-Zui-testing` and friends). That is quite annoying, because we do in fact want to test stable behavior in a couple of tests, but today we have to write those as `run-make` tests (latest example: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707), even if the tested situation is very simple. Those are harder to read, write and maintain than UI tests and they do not support blessing outputs as well as UI tests. Recently, I at least added rust-lang#163444 as a way of centralizing the logic of testing a stable `rustc` in a run-make test, but that does not really help with the fact that we still have to use run-make tests for it, even when a normal UI test would do. For rust-lang#162848, I would also like to have a way of passing `-Zthreads=1` to all run-make tests, even if they are testing stable `rustc`, but that's not easily possible, because those tests are using `RUSTC_BOOTSTRAP=-1`. This PR proposes to add a new mode to `RUSTC_BOOTSTRAP`, with the value of `-allow-unstable-compiler-flags=<flags>`. This can be used to emulate the behavior of stable rustc, while still allowing passing *specific* unstable flags to the compiler. The stability check in the compiler is thus now separated into two questions: - Are we an unstable/nightly build? - Can we accept specific unstable compiler flags? The latter is checked only at a few places, so the necessary change to the compiler is rather small (IMO). To demonstrate how this would be used, I also implemented a new directive into compiletest in this PR, `act-as-stable`. That can be used in a UI test to emulate stable rustc. Some tests before used `only-stable` to "achieve" this, which is very misleading, because it doesn't work at all 😆, due to compiletest unconditionally passing `RUSTC_BOOTSTRAP=1` to all executed tests. `act-as-stable` fixes that. The last two commits demonstrate how we could replace run-make tests that tested different output on stable/nightly with UI tests. I suppose that this mode might be interesting for other people outside of `rust-lang/rust`, but if you don't want that, I can gate it behind `-Zui-testing`. r? jieyouxu
…uwer Rollup of 15 pull requests Successful merges: - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests) - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs) - #163338 (MIR move elimination [4/6]: MoveElimination) - #163701 (add ReadDir::dir to get the directory handle of the underlying directory) - #164488 (Don't try to skip anything in `Skip::advance_by(0)`) - #164611 (Improve bit permutation codegen) - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`) - #148842 (Avoid incorrect lifetime suggestion involving `sym::anon`) - #162668 (document that `!` does bitwise and logical negation) - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons) - #164509 (layout invariant: turn delayed bug back into proper assertion) - #164540 (Minor optimizations around macro parsing) - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules) - #164595 (Allow attributes in function trait parameters) - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
…-real-2, r=jieyouxu Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests Right now, it is [not possible](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707) to test how the compiler behaves on the stable toolchain in UI tests. Even though rust-lang#132993 added a mechanism to emulate stable rustc on the nightly channel, using the `RUSTC_BOOTSTRAP=-1` environment variable, this mechanism is not currently usable within compiletest and UI tests directly, because compiletest unconditionally passes several unstable `-Z` flags that are load-bearing for the testing infra itself to work (notably `-Zui-testing` and friends). That is quite annoying, because we do in fact want to test stable behavior in a couple of tests, but today we have to write those as `run-make` tests (latest example: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707), even if the tested situation is very simple. Those are harder to read, write and maintain than UI tests and they do not support blessing outputs as well as UI tests. Recently, I at least added rust-lang#163444 as a way of centralizing the logic of testing a stable `rustc` in a run-make test, but that does not really help with the fact that we still have to use run-make tests for it, even when a normal UI test would do. For rust-lang#162848, I would also like to have a way of passing `-Zthreads=1` to all run-make tests, even if they are testing stable `rustc`, but that's not easily possible, because those tests are using `RUSTC_BOOTSTRAP=-1`. This PR proposes to add a new mode to `RUSTC_BOOTSTRAP`, with the value of `-allow-unstable-compiler-flags=<flags>`. This can be used to emulate the behavior of stable rustc, while still allowing passing *specific* unstable flags to the compiler. The stability check in the compiler is thus now separated into two questions: - Are we an unstable/nightly build? - Can we accept specific unstable compiler flags? The latter is checked only at a few places, so the necessary change to the compiler is rather small (IMO). To demonstrate how this would be used, I also implemented a new directive into compiletest in this PR, `act-as-stable`. That can be used in a UI test to emulate stable rustc. Some tests before used `only-stable` to "achieve" this, which is very misleading, because it doesn't work at all 😆, due to compiletest unconditionally passing `RUSTC_BOOTSTRAP=1` to all executed tests. `act-as-stable` fixes that. The last two commits demonstrate how we could replace run-make tests that tested different output on stable/nightly with UI tests. I suppose that this mode might be interesting for other people outside of `rust-lang/rust`, but if you don't want that, I can gate it behind `-Zui-testing`. r? jieyouxu
…uwer Rollup of 14 pull requests Successful merges: - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests) - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs) - #163701 (add ReadDir::dir to get the directory handle of the underlying directory) - #164488 (Don't try to skip anything in `Skip::advance_by(0)`) - #164611 (Improve bit permutation codegen) - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`) - #148842 (Avoid incorrect lifetime suggestion involving `sym::anon`) - #162668 (document that `!` does bitwise and logical negation) - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons) - #164509 (layout invariant: turn delayed bug back into proper assertion) - #164540 (Minor optimizations around macro parsing) - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules) - #164595 (Allow attributes in function trait parameters) - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
…uwer Rollup of 14 pull requests Successful merges: - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests) - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs) - #163701 (add ReadDir::dir to get the directory handle of the underlying directory) - #164488 (Don't try to skip anything in `Skip::advance_by(0)`) - #164611 (Improve bit permutation codegen) - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`) - #148842 (Avoid incorrect lifetime suggestion involving `sym::anon`) - #162668 (document that `!` does bitwise and logical negation) - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons) - #164509 (layout invariant: turn delayed bug back into proper assertion) - #164540 (Minor optimizations around macro parsing) - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules) - #164595 (Allow attributes in function trait parameters) - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology)
…-real-2, r=jieyouxu Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests Right now, it is [not possible](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707) to test how the compiler behaves on the stable toolchain in UI tests. Even though rust-lang#132993 added a mechanism to emulate stable rustc on the nightly channel, using the `RUSTC_BOOTSTRAP=-1` environment variable, this mechanism is not currently usable within compiletest and UI tests directly, because compiletest unconditionally passes several unstable `-Z` flags that are load-bearing for the testing infra itself to work (notably `-Zui-testing` and friends). That is quite annoying, because we do in fact want to test stable behavior in a couple of tests, but today we have to write those as `run-make` tests (latest example: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707), even if the tested situation is very simple. Those are harder to read, write and maintain than UI tests and they do not support blessing outputs as well as UI tests. Recently, I at least added rust-lang#163444 as a way of centralizing the logic of testing a stable `rustc` in a run-make test, but that does not really help with the fact that we still have to use run-make tests for it, even when a normal UI test would do. For rust-lang#162848, I would also like to have a way of passing `-Zthreads=1` to all run-make tests, even if they are testing stable `rustc`, but that's not easily possible, because those tests are using `RUSTC_BOOTSTRAP=-1`. This PR proposes to add a new mode to `RUSTC_BOOTSTRAP`, with the value of `-allow-unstable-compiler-flags=<flags>`. This can be used to emulate the behavior of stable rustc, while still allowing passing *specific* unstable flags to the compiler. The stability check in the compiler is thus now separated into two questions: - Are we an unstable/nightly build? - Can we accept specific unstable compiler flags? The latter is checked only at a few places, so the necessary change to the compiler is rather small (IMO). To demonstrate how this would be used, I also implemented a new directive into compiletest in this PR, `act-as-stable`. That can be used in a UI test to emulate stable rustc. Some tests before used `only-stable` to "achieve" this, which is very misleading, because it doesn't work at all 😆, due to compiletest unconditionally passing `RUSTC_BOOTSTRAP=1` to all executed tests. `act-as-stable` fixes that. The last two commits demonstrate how we could replace run-make tests that tested different output on stable/nightly with UI tests. I suppose that this mode might be interesting for other people outside of `rust-lang/rust`, but if you don't want that, I can gate it behind `-Zui-testing`. r? jieyouxu
…uwer Rollup of 19 pull requests Successful merges: - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests) - #163668 (Remap syntax contexts and expansion ids for det. metadata encoding) - #160404 (fd-views: AsRef<File>&Co. for BorrowedFd) - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs) - #163317 (Stop useless caching of post-LTO artifact caching for fat LTO) - #163701 (add ReadDir::dir to get the directory handle of the underlying directory) - #164488 (Don't try to skip anything in `Skip::advance_by(0)`) - #164507 (Encode HashMap and HashSet in deterministic order when an encoder requires determinism) - #164611 (Improve bit permutation codegen) - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`) - #148842 (Avoid incorrect lifetime suggestion involving `sym::anon`) - #162668 (document that `!` does bitwise and logical negation) - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons) - #164509 (layout invariant: turn delayed bug back into proper assertion) - #164540 (Minor optimizations around macro parsing) - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules) - #164595 (Allow attributes in function trait parameters) - #164641 (Stabilize `slice_split_once`) - #164646 (Adjust rustfmt subtree sync docs to not use `--allow-noop` for now)
Rollup of 20 pull requests Successful merges: - #163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests) - #163668 (Remap syntax contexts and expansion ids for det. metadata encoding) - #163104 ([debuginfo] Emit `usize` and `isize` as typedefs) - #163317 (Stop useless caching of post-LTO artifact caching for fat LTO) - #163701 (add ReadDir::dir to get the directory handle of the underlying directory) - #164488 (Don't try to skip anything in `Skip::advance_by(0)`) - #164507 (Encode HashMap and HashSet in deterministic order when an encoder requires determinism) - #164611 (Improve bit permutation codegen) - #164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`) - #148842 (Avoid incorrect lifetime suggestion involving `sym::anon`) - #162668 (document that `!` does bitwise and logical negation) - #164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons) - #164509 (layout invariant: turn delayed bug back into proper assertion) - #164540 (Minor optimizations around macro parsing) - #164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules) - #164595 (Allow attributes in function trait parameters) - #164616 (Add test for VecDeque with a custom allocator) - #164629 (arch::breakpoint: avoid confusing 'equivalent' terminology) - #164641 (Stabilize `slice_split_once`) - #164646 (Adjust rustfmt subtree sync docs to not use `--allow-noop` for now)
Rollup merge of #163664 - Kobzol:bootstrap-but-this-time-for-real-2, r=jieyouxu Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests Right now, it is [not possible](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707) to test how the compiler behaves on the stable toolchain in UI tests. Even though #132993 added a mechanism to emulate stable rustc on the nightly channel, using the `RUSTC_BOOTSTRAP=-1` environment variable, this mechanism is not currently usable within compiletest and UI tests directly, because compiletest unconditionally passes several unstable `-Z` flags that are load-bearing for the testing infra itself to work (notably `-Zui-testing` and friends). That is quite annoying, because we do in fact want to test stable behavior in a couple of tests, but today we have to write those as `run-make` tests (latest example: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707), even if the tested situation is very simple. Those are harder to read, write and maintain than UI tests and they do not support blessing outputs as well as UI tests. Recently, I at least added #163444 as a way of centralizing the logic of testing a stable `rustc` in a run-make test, but that does not really help with the fact that we still have to use run-make tests for it, even when a normal UI test would do. For #162848, I would also like to have a way of passing `-Zthreads=1` to all run-make tests, even if they are testing stable `rustc`, but that's not easily possible, because those tests are using `RUSTC_BOOTSTRAP=-1`. This PR proposes to add a new mode to `RUSTC_BOOTSTRAP`, with the value of `-allow-unstable-compiler-flags=<flags>`. This can be used to emulate the behavior of stable rustc, while still allowing passing *specific* unstable flags to the compiler. The stability check in the compiler is thus now separated into two questions: - Are we an unstable/nightly build? - Can we accept specific unstable compiler flags? The latter is checked only at a few places, so the necessary change to the compiler is rather small (IMO). To demonstrate how this would be used, I also implemented a new directive into compiletest in this PR, `act-as-stable`. That can be used in a UI test to emulate stable rustc. Some tests before used `only-stable` to "achieve" this, which is very misleading, because it doesn't work at all 😆, due to compiletest unconditionally passing `RUSTC_BOOTSTRAP=1` to all executed tests. `act-as-stable` fixes that. The last two commits demonstrate how we could replace run-make tests that tested different output on stable/nightly with UI tests. I suppose that this mode might be interesting for other people outside of `rust-lang/rust`, but if you don't want that, I can gate it behind `-Zui-testing`. r? jieyouxu
Rollup of 20 pull requests Successful merges: - rust-lang/rust#163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests) - rust-lang/rust#163668 (Remap syntax contexts and expansion ids for det. metadata encoding) - rust-lang/rust#163104 ([debuginfo] Emit `usize` and `isize` as typedefs) - rust-lang/rust#163317 (Stop useless caching of post-LTO artifact caching for fat LTO) - rust-lang/rust#163701 (add ReadDir::dir to get the directory handle of the underlying directory) - rust-lang/rust#164488 (Don't try to skip anything in `Skip::advance_by(0)`) - rust-lang/rust#164507 (Encode HashMap and HashSet in deterministic order when an encoder requires determinism) - rust-lang/rust#164611 (Improve bit permutation codegen) - rust-lang/rust#164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`) - rust-lang/rust#148842 (Avoid incorrect lifetime suggestion involving `sym::anon`) - rust-lang/rust#162668 (document that `!` does bitwise and logical negation) - rust-lang/rust#164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons) - rust-lang/rust#164509 (layout invariant: turn delayed bug back into proper assertion) - rust-lang/rust#164540 (Minor optimizations around macro parsing) - rust-lang/rust#164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules) - rust-lang/rust#164595 (Allow attributes in function trait parameters) - rust-lang/rust#164616 (Add test for VecDeque with a custom allocator) - rust-lang/rust#164629 (arch::breakpoint: avoid confusing 'equivalent' terminology) - rust-lang/rust#164641 (Stabilize `slice_split_once`) - rust-lang/rust#164646 (Adjust rustfmt subtree sync docs to not use `--allow-noop` for now)
Rollup of 20 pull requests Successful merges: - rust-lang/rust#163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests) - rust-lang/rust#163668 (Remap syntax contexts and expansion ids for det. metadata encoding) - rust-lang/rust#163104 ([debuginfo] Emit `usize` and `isize` as typedefs) - rust-lang/rust#163317 (Stop useless caching of post-LTO artifact caching for fat LTO) - rust-lang/rust#163701 (add ReadDir::dir to get the directory handle of the underlying directory) - rust-lang/rust#164488 (Don't try to skip anything in `Skip::advance_by(0)`) - rust-lang/rust#164507 (Encode HashMap and HashSet in deterministic order when an encoder requires determinism) - rust-lang/rust#164611 (Improve bit permutation codegen) - rust-lang/rust#164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`) - rust-lang/rust#148842 (Avoid incorrect lifetime suggestion involving `sym::anon`) - rust-lang/rust#162668 (document that `!` does bitwise and logical negation) - rust-lang/rust#164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons) - rust-lang/rust#164509 (layout invariant: turn delayed bug back into proper assertion) - rust-lang/rust#164540 (Minor optimizations around macro parsing) - rust-lang/rust#164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules) - rust-lang/rust#164595 (Allow attributes in function trait parameters) - rust-lang/rust#164616 (Add test for VecDeque with a custom allocator) - rust-lang/rust#164629 (arch::breakpoint: avoid confusing 'equivalent' terminology) - rust-lang/rust#164641 (Stabilize `slice_split_once`) - rust-lang/rust#164646 (Adjust rustfmt subtree sync docs to not use `--allow-noop` for now)
Rollup of 20 pull requests Successful merges: - rust-lang/rust#163664 (Add new `RUSTC_BOOTSTRAP=-allow-unstable-compiler-flags` mode for testing stable compiler behavior in UI tests) - rust-lang/rust#163668 (Remap syntax contexts and expansion ids for det. metadata encoding) - rust-lang/rust#163104 ([debuginfo] Emit `usize` and `isize` as typedefs) - rust-lang/rust#163317 (Stop useless caching of post-LTO artifact caching for fat LTO) - rust-lang/rust#163701 (add ReadDir::dir to get the directory handle of the underlying directory) - rust-lang/rust#164488 (Don't try to skip anything in `Skip::advance_by(0)`) - rust-lang/rust#164507 (Encode HashMap and HashSet in deterministic order when an encoder requires determinism) - rust-lang/rust#164611 (Improve bit permutation codegen) - rust-lang/rust#164612 (std: Combine `is_powerpc64_feature_detected` into `is_powerpc_feature_detected`) - rust-lang/rust#148842 (Avoid incorrect lifetime suggestion involving `sym::anon`) - rust-lang/rust#162668 (document that `!` does bitwise and logical negation) - rust-lang/rust#164264 (lint: suggest `fXX::is_nan` for unsuffixed NaN comparisons) - rust-lang/rust#164509 (layout invariant: turn delayed bug back into proper assertion) - rust-lang/rust#164540 (Minor optimizations around macro parsing) - rust-lang/rust#164594 (rustdoc: Correctly handle inner `deprecated` attribute on modules) - rust-lang/rust#164595 (Allow attributes in function trait parameters) - rust-lang/rust#164616 (Add test for VecDeque with a custom allocator) - rust-lang/rust#164629 (arch::breakpoint: avoid confusing 'equivalent' terminology) - rust-lang/rust#164641 (Stabilize `slice_split_once`) - rust-lang/rust#164646 (Adjust rustfmt subtree sync docs to not use `--allow-noop` for now)
View all comments
Right now, it is not possible to test how the compiler behaves on the stable toolchain in UI tests. Even though #132993 added a mechanism to emulate stable rustc on the nightly channel, using the
RUSTC_BOOTSTRAP=-1environment variable, this mechanism is not currently usable within compiletest and UI tests directly, because compiletest unconditionally passes several unstable-Zflags that are load-bearing for the testing infra itself to work (notably-Zui-testingand friends).That is quite annoying, because we do in fact want to test stable behavior in a couple of tests, but today we have to write those as
run-maketests (latest example: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20stable.20vs.20nightly.20behavior.20in.20UI.20tests/with/628206707), even if the tested situation is very simple. Those are harder to read, write and maintain than UI tests and they do not support blessing outputs as well as UI tests. Recently, I at least added #163444 as a way of centralizing the logic of testing a stablerustcin a run-make test, but that does not really help with the fact that we still have to use run-make tests for it, even when a normal UI test would do.For #162848, I would also like to have a way of passing
-Zthreads=1to all run-make tests, even if they are testing stablerustc, but that's not easily possible, because those tests are usingRUSTC_BOOTSTRAP=-1.This PR proposes to add a new mode to
RUSTC_BOOTSTRAP, with the value of-allow-unstable-compiler-flags=<flags>. This can be used to emulate the behavior of stable rustc, while still allowing passing specific unstable flags to the compiler.The stability check in the compiler is thus now separated into two questions:
The latter is checked only at a few places, so the necessary change to the compiler is rather small (IMO).
To demonstrate how this would be used, I also implemented a new directive into compiletest in this PR,
act-as-stable. That can be used in a UI test to emulate stable rustc. Some tests before usedonly-stableto "achieve" this, which is very misleading, because it doesn't work at all 😆, due to compiletest unconditionally passingRUSTC_BOOTSTRAP=1to all executed tests.act-as-stablefixes that.The last two commits demonstrate how we could replace run-make tests that tested different output on stable/nightly with UI tests.
I suppose that this mode might be interesting for other people outside of
rust-lang/rust, but if you don't want that, I can gate it behind-Zui-testing.r? jieyouxu