Skip to content

Commit 83cb650

Browse files
committed
add human readable annotations for errors in tests
1 parent a4f7d4d commit 83cb650

11 files changed

Lines changed: 21 additions & 50 deletions

File tree

tests/ui/resolve/open-ns-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ fn main() {
1212
let _ = root_function();
1313
let _ = my_api::root_function();
1414
let _ = my_api::utils::utils_helper();
15-
//~^ ERROR E0433
15+
//~^ ERROR cannot find `utils` in `my_api` [E0433]
1616
let _ = util::util_mod_helper();
1717
let _ = my_api::core::core_fn();
18-
//~^ ERROR E0433
18+
//~^ ERROR cannot find `core` in `my_api` [E0433]
1919
}

tests/ui/resolve/open-ns-10.rs

Lines changed: 0 additions & 25 deletions
This file was deleted.

tests/ui/resolve/open-ns-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
//@ edition: 2024
66

77
use my_api::core::{core_fn, core_fn2};
8-
//~^ ERROR E0432
8+
//~^ ERROR unresolved import `my_api::core` [E0432]
99
use my_api::utils::*;
10-
//~^ ERROR E0432
10+
//~^ ERROR unresolved import `my_api::utils` [E0432]
1111
use my_api::*;
1212

1313
fn main() {

tests/ui/resolve/open-ns-3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
fn main() {
1111
let _ = my_api::utils::root_helper();
1212
let _ = my_api::utils::utils_helper();
13-
//~^ ERROR E0425
13+
//~^ ERROR cannot find function `utils_helper` in module `my_api::utils` [E0425]
1414
}

tests/ui/resolve/open-ns-4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
fn main() {
99
let _ = my_api::root_function();
1010
let _ = my_api::utils::utils_helper();
11-
//~^ ERROR E0433
11+
//~^ ERROR cannot find `utils` in `my_api` [E0433]
1212
}

tests/ui/resolve/open-ns-5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@ aux-crate: my_api::utils=open-ns-my_api_utils.rs
44
//@ compile-flags: -Z namespaced-crates
55
//@ edition: 2024
6-
//@ build-pass
6+
//@ check-pass
77

88
macro_rules! import_and_call {
99
($import_path:path, $fn_name:ident) => {{

tests/ui/resolve/open-ns-6.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@ aux-crate: my_api::utils=open-ns-my_api_utils.rs
44
//@ compile-flags: -Z namespaced-crates
55
//@ edition: 2024
6-
//@ build-pass
6+
//@ check-pass
77

88
use my_api;
99
use my_api::utils::utils_helper;

tests/ui/resolve/open-ns-7.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
//@ edition: 2024
77

88
use my_api::utils::utils_helper;
9-
//~^ ERROR E0432
9+
//~^ ERROR unresolved import `my_api::utils` [E0432]
1010

1111
fn main() {
1212
let _ = my_api::utils::utils_helper();
13-
//~^ ERROR E0433
13+
//~^ ERROR cannot find `utils` in `my_api` [E0433]
1414
}

tests/ui/resolve/open-ns-8.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// Tests that namespaced crate names work inside macros.
1+
// Tests that a macro-generated item has higher precendence than a namespaced crate
22
//@ aux-crate: my_api::utils=open-ns-my_api_utils.rs
33
//@ compile-flags: -Z namespaced-crates
44
//@ edition: 2024
5-
//@ build-pass
5+
//@ check-pass
66

77
macro_rules! define {
88
() => {

tests/ui/resolve/open-ns-9.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
// Tests that namespaced crate names work inside macros.
21
//@ aux-crate: my_api::utils=open-ns-my_api_utils.rs
32
//@ compile-flags: -Z namespaced-crates
43
//@ edition: 2024
5-
//@ build-pass
4+
5+
use my_api::utils::get_u32;
6+
//~^ ERROR `my_api` is ambiguous [E0659]
67

78
macro_rules! define {
89
() => {
@@ -12,18 +13,13 @@ macro_rules! define {
1213
2
1314
}
1415
}
15-
16-
pub mod unique {
17-
pub fn get_u32() -> u32 {
18-
2
19-
}
20-
}
2116
}
2217
};
2318
}
2419

20+
define!();
21+
2522
fn main() {
26-
define!();
27-
let res1 = my_api::unique::get_u32();
28-
assert_eq!(res1, 2);
23+
let val = get_u32();
24+
assert_eq!(val, 2);
2925
}

0 commit comments

Comments
 (0)