-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix error message for env!
when env var is not valid Unicode
#122663
Conversation
Some changes occurred in run-make tests. cc @jieyouxu |
tests/run-make/non-utf8-env/Makefile
Outdated
# ignore-cross-compile | ||
|
||
all: | ||
(NOT_UTF8_VAR=$$(printf "\377") $(RUSTC) non_utf8_env.rs 2>&1 && exit 1 || exit 0) | diff - non_utf8_env.stderr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to write this new run-make
test in Rust instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jieyouxu Done
767bee7
to
9156164
Compare
The run-make-support library was changed cc @jieyouxu |
☔ The latest upstream changes (presumably #122460) made this pull request unmergeable. Please resolve the merge conflicts. |
@beetrees Could you resolve a conflict? It looks good to me basically. |
@rustbot author |
9156164
to
0bbaa25
Compare
Thanks! @bors r+ rollup |
☀️ Test successful - checks-actions |
Finished benchmarking commit (7f84ede): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 669.457s -> 667.101s (-0.35%) |
Currently (without this PR) the
env!
macro emits anenvironment variable `name` not defined at compile time
error when the environment variable is defined, but not a valid Unicode string. This PR introduces a separate more accurate error message, and a test to verify this behaviour.For reference, before this PR, the new test would have outputted:
whereas with this PR, the test ouputs: