You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rustc can't handle non-UTF-8 input paths, but only when RUST_BACKTRACE is not set #164585
I got the following output (the empty line is not a copy-paste error):
thread 'main' (468943) panicked at /rustc/b6eeb93c992027a03e1fd120b6652546396b142c/library/std/src/env.rs:935:51:
called `Result::unwrap()` on an `Err` value: "\xFF"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
CompletedProcess(args=['rustc', b'\xff'], returncode=101)
If I instead set RUST_BACKTRACE=1 before running the script, I get the following output (again, the empty line is not a copy-paste error. And for this one, in my terminal, the error message is bolded and has color):
error: argument 1 is not valid Unicode: "\xFF"
CompletedProcess(args=['rustc', b'\xff'], returncode=1)
Seems like whatever is trying to output the error message doesn't like it when RUST_BACKTRACE isn't set. (Also note that the returncode in the two outputs are different.)
I mean the given code is specifically for the backtrace behaviour though, not ui-testing in general. The =val form should work in general since that's handled by our normal argument parsing.
Activity
theemathas commentedon Oct 19, 2026
What on earth is this code doing? (Note the
std::env::args()call.)rust/compiler/rustc_driver_impl/src/lib.rs
Lines 1461 to 1476 in b26b4e7
ChrisDenton commentedon Oct 19, 2026
The nature of the hack aside, the only issue is that it uses
argswhen it should be usingargs_os.maxdexh commentedon Oct 19, 2026
It also doesn't support passing
-Z ui-testing(or-Zui-testing=yes, or anything else that option flags should support)ChrisDenton commentedon Oct 19, 2026
I'm assuming that's semi-intentional since it's an internal only flag and shouldn't be used by anyone (except the UI testing framework).
maxdexh commentedon Oct 19, 2026
It shows up when you
rustc -Zhelp, and it doesn't say it's internal. Is that the next problem?(also notice that the
=valform it shows up as literally doesn't work (and it shows up with spaces))ChrisDenton commentedon Oct 19, 2026
I mean the given code is specifically for the backtrace behaviour though, not
ui-testingin general. The=valform should work in general since that's handled by our normal argument parsing.maxdexh commentedon Oct 19, 2026
Yeah, but that still sounds like buggy behavior, why would the backtrace format depend on how you passed the arg? ^^
ChrisDenton commentedon Oct 19, 2026
It also depends on
CFG_RELEASE_CHANNELwhich is unlikely to be set by anyone who isn't building rustc from source.But I think your position is that the hack added in #110989 shouldn't be a hack, despite the comment claiming it's "good enough"?
maxdexh commentedon Oct 19, 2026
no my claim is that this code is super weird ^^