- Feature Name:
const if
- Start Date: 2024-12-21
- RFC PR: rust-lang/rfcs#0000
- Rust Issue: rust-lang/rust#0000
const if
allows type-checked conditional compilation.
const if
const if
allows type-checked conditional compilation.
diff --git a/src/config.c b/src/config.c | |
index de3be1c..d482e7c 100644 | |
--- a/src/config.c | |
+++ b/src/config.c | |
@@ -17,6 +17,7 @@ | |
#include <unistd.h> | |
#include <libgen.h> | |
+#include "config.h" | |
#include "keyd.h" |
rustc src/main.rs -Ztreat-err-as-bug=3 | |
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `borrowck_returned_lifetime_short`: | |
the fluent string has an argument `category_desc` that was not found. | |
help: no arguments are available | |
the fluent string has an argument `free_region_name` that was not found. | |
help: no arguments are available | |
the fluent string has an argument `outlived_fr_name` that was not found. | |
help: no arguments are available | |
', compiler/rustc_errors/src/emitter.rs:2397:77 | |
stack backtrace: |
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs | |
index 5bc4d164265..211d45e022e 100644 | |
--- a/src/tools/compiletest/src/runtest.rs | |
+++ b/src/tools/compiletest/src/runtest.rs | |
@@ -1939,6 +1939,17 @@ fn make_compile_args( | |
// Use a single thread for efficiency and a deterministic error message order | |
rustc.arg("-Zthreads=1"); | |
+ // Hide libstd sources from ui tests to make sure we generate the stderr | |
+ // output that users will see. |
Checking stage0 compiler artifacts {rustc_middle} (x86_64-unknown-linux-gnu) | |
Checking rustc_middle v0.0.0 (/home/jyn/src/rust/compiler/rustc_middle) | |
time: 0.635; rss: 51MB -> 310MB ( +259MB) expand_crate | |
time: 0.635; rss: 51MB -> 310MB ( +259MB) macro_expand_crate | |
time: 0.018; rss: 310MB -> 310MB ( +0MB) AST_validation | |
time: 0.127; rss: 312MB -> 346MB ( +33MB) late_resolve_crate | |
time: 0.011; rss: 346MB -> 346MB ( +0MB) resolve_check_unused | |
time: 0.021; rss: 346MB -> 346MB ( +0MB) resolve_postprocess | |
time: 0.173; rss: 310MB -> 346MB ( +35MB) resolve_crate | |
time: 0.011; rss: 346MB -> 346MB ( +0MB) complete_gated_feature_checking |
#!/usr/bin/env python3 | |
import re | |
import sys | |
def sizeof_fmt(num, suffix="B"): | |
for unit in ["", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi"]: | |
if abs(num) < 1024.0: | |
return f"{num:3.1f}{unit}{suffix}" | |
num /= 1024.0 | |
return f"{num:.1f}Yi{suffix}" |
#!/usr/bin/env bash | |
set -x | |
error() { | |
echo "$@" >&2 | |
} | |
usage() { | |
error "usage: $0 <src> <dest>" |
PS C:\Users\Joshua Nelson\src\rust2> git worktree add ../rust5 | |
Preparing worktree (new branch 'rust5') | |
Updating files: 100% (38772/38772), done. | |
HEAD is now at e4330295d9b Give a more helpful error for "trimmed_def_paths construted" | |
PS C:\Users\Joshua Nelson\src\rust2> cd ../rust5 | |
PS C:\Users\Joshua Nelson\src\rust5> ./x.ps1 build --dry-run | |
downloading https://static.rust-lang.org/dist/2022-11-01/rust-std-beta-x86_64-pc-windows-msvc.tar.xz | |
#################################################################################################################### 100.0% | |
extracting C:\Users\Joshua Nelson\src\rust5\build\cache\2022-11-01\rust-std-beta-x86_64-pc-windows-msvc.tar.xz | |
downloading https://static.rust-lang.org/dist/2022-11-01/rustc-beta-x86_64-pc-windows-msvc.tar.xz |
Building rustbuild | |
Finished dev [unoptimized] target(s) in 0.04s | |
Building stage0 library artifacts (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu) | |
Finished release [optimized] target(s) in 38.39s | |
Copying stage0 library from stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu / aarch64-unknown-linux-gnu) | |
Building stage0 compiler artifacts (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu) | |
Finished release [optimized] target(s) in 2m 46s | |
Copying stage0 rustc from stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu / aarch64-unknown-linux-gnu) | |
Assembling stage1 compiler (aarch64-unknown-linux-gnu) | |
Building stage0 tool clippy-driver (aarch64-unknown-linux-gnu) |