rust/tests
bors 7f84ede33d Auto merge of #122663 - beetrees:non-unicode-env-error, r=TaKO8Ki
Fix error message for `env!` when env var is not valid Unicode

Currently (without this PR) the `env!` macro emits an ```environment 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:
```
error: environment variable `NON_UNICODE_VAR` not defined at compile time
 --> non_unicode_env.rs:2:13
  |
2 |     let _ = env!("NON_UNICODE_VAR");
  |             ^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: use `std::env::var("NON_UNICODE_VAR")` to read the variable at run time
  = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 1 previous error
```

whereas with this PR, the test ouputs:
```
error: environment variable `NON_UNICODE_VAR` is not a valid Unicode string
 --> non_unicode_env.rs:2:13
  |
2 |     let _ = env!("NON_UNICODE_VAR");
  |             ^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 1 previous error
```
2024-04-01 05:18:51 +00:00
..
assembly stabilize ptr.is_aligned, move ptr.is_aligned_to to a new feature gate 2024-03-29 19:59:46 -04:00
auxiliary
codegen Auto merge of #122976 - caibear:optimize_reserve_for_push, r=cuviper 2024-03-30 00:29:24 +00:00
codegen-units Codegen const panic messages as function calls 2024-03-22 09:55:50 -04:00
coverage Eliminate UbCheck for non-standard libraries 2024-03-27 21:02:40 +08:00
coverage-run-rustdoc
debuginfo Add rust-lldb pretty printing for Path and PathBuf 2024-03-29 18:02:26 -06:00
incremental Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
mir-opt Add FileCheck directives to the new tests. 2024-03-30 18:11:41 +01:00
pretty Add MatchKind member to the Match expr for pretty printing & fmt 2024-03-06 00:35:19 -05:00
run-make Fix error message for env! when env var is not valid Unicode 2024-04-01 05:44:45 +01:00
run-make-fulldeps Soft-destabilize RustcEncodable/RustcDecodable 2024-03-22 13:24:35 -07:00
run-pass-valgrind Add test for Apple's -weak_framework linker argument 2024-03-18 23:27:34 +01:00
rustdoc tests 2024-03-14 14:51:01 +01:00
rustdoc-gui chore: fix some comments 2024-03-27 22:32:53 +08:00
rustdoc-js Rollup merge of #122247 - notriddle:notriddle/search-unbox-limit, r=GuillaumeGomez 2024-03-14 15:44:32 +01:00
rustdoc-js-std rustdoc-search: add search query syntax Fn(T) -> U 2024-03-11 22:27:22 -07:00
rustdoc-json
rustdoc-ui Add regression test for #123158 2024-03-28 11:09:08 +01:00
ui Auto merge of #122972 - beetrees:use-align-type, r=fee1-dead 2024-04-01 03:16:45 +00:00
ui-fulldeps Normalize the result of Fields::ty_with_args 2024-03-28 13:22:10 -07:00
COMPILER_TESTS.md