Remove env macro use from ui tests. (#16580)

`env` requires that the test machine has the variable defined.

changelog: none
This commit is contained in:
Samuel Tardieu
2026-02-17 12:38:57 +00:00
committed by GitHub
3 changed files with 18 additions and 6 deletions
+8 -2
View File
@@ -114,6 +114,12 @@ fn issue16322(item: String) {
}
fn issue16458() {
macro_rules! m {
() => {
""
};
}
macro_rules! partly_comes_from_macro {
($i:ident: $ty:ty, $def:expr) => {
let _ = {
@@ -125,7 +131,7 @@ fn issue16458() {
}
partly_comes_from_macro! {
required_version: String, env!("HOME").to_string()
required_version: String, m!().to_string()
}
macro_rules! all_comes_from_macro {
@@ -141,6 +147,6 @@ fn issue16458() {
};
}
all_comes_from_macro! {
required_version: String, env!("HOME").to_string();
required_version: String, m!().to_string();
}
}
+8 -2
View File
@@ -114,6 +114,12 @@ fn issue16322(item: String) {
}
fn issue16458() {
macro_rules! m {
() => {
""
};
}
macro_rules! partly_comes_from_macro {
($i:ident: $ty:ty, $def:expr) => {
let _ = {
@@ -125,7 +131,7 @@ macro_rules! partly_comes_from_macro {
}
partly_comes_from_macro! {
required_version: String, env!("HOME").to_string()
required_version: String, m!().to_string()
}
macro_rules! all_comes_from_macro {
@@ -141,6 +147,6 @@ macro_rules! all_comes_from_macro {
};
}
all_comes_from_macro! {
required_version: String, env!("HOME").to_string();
required_version: String, m!().to_string();
}
}
+2 -2
View File
@@ -56,13 +56,13 @@ LL | if item == t!(frohes_neu_Jahr).to_string() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t!(frohes_neu_Jahr)`
error: this creates an owned instance just for comparison
--> tests/ui/cmp_owned/with_suggestion.rs:135:51
--> tests/ui/cmp_owned/with_suggestion.rs:141:51
|
LL | let res = <$ty>::default() == "$def".to_string();
| ^^^^^^^^^^^^^^^^^^ help: try: `"$def"`
...
LL | / all_comes_from_macro! {
LL | | required_version: String, env!("HOME").to_string();
LL | | required_version: String, m!().to_string();
LL | | }
| |_____- in this macro invocation
|