Fix error message for env! when env var is not valid Unicode#122663
Fix error message for env! when env var is not valid Unicode#122663bors merged 1 commit intorust-lang:masterfrom
env! when env var is not valid Unicode#122663Conversation
|
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.
Is it possible to write this new run-make test in Rust instead?
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 timeerror 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: