|
4 | 4 | // and https://github.com/rust-lang/rust/pull/134880#issuecomment-2596386111
|
5 | 5 | //
|
6 | 6 | // ignore-tidy-linelength
|
| 7 | +//@ aux-build: defines_and_reexports.rs |
| 8 | +extern crate defines_and_reexports; |
7 | 9 |
|
8 | 10 | mod priv_mod {
|
9 | 11 | pub struct InPrivMod;
|
@@ -36,5 +38,37 @@ pub type U2 = InPubMod2;
|
36 | 38 | //@ is "$.index[*][?(@.name=='U3')].inner.type_alias.type.resolved_path.name" '"pub_mod::InPubMod"'
|
37 | 39 | pub type U3 = InPubMod3;
|
38 | 40 |
|
39 |
| -// Check we only have paths for structs at there origonal path |
| 41 | +// Check we only have paths for structs at their original path |
40 | 42 | //@ ismany "$.paths[*][?(@.crate_id==0 && @.kind=='struct')].path" '["path_name", "priv_mod", "InPrivMod"]' '["path_name", "pub_mod", "InPubMod"]'
|
| 43 | + |
| 44 | +pub use defines_and_reexports::{InPrivMod as XPrivMod, InPubMod as XPubMod}; |
| 45 | +use defines_and_reexports::{InPrivMod as XPrivMod2, InPubMod as XPubMod2}; |
| 46 | + |
| 47 | +//@ is "$.index[*][?(@.name=='X0')].inner.type_alias.type.resolved_path.name" '"defines_and_reexports::m1::InPubMod"' |
| 48 | +pub type X0 = defines_and_reexports::m1::InPubMod; |
| 49 | +//@ is "$.index[*][?(@.name=='X1')].inner.type_alias.type.resolved_path.name" '"defines_and_reexports::InPubMod"' |
| 50 | +pub type X1 = defines_and_reexports::InPubMod; |
| 51 | +//@ is "$.index[*][?(@.name=='X2')].inner.type_alias.type.resolved_path.name" '"defines_and_reexports::InPubMod2"' |
| 52 | +pub type X2 = defines_and_reexports::InPubMod2; |
| 53 | +//@ is "$.index[*][?(@.name=='X3')].inner.type_alias.type.resolved_path.name" '"XPubMod"' |
| 54 | +pub type X3 = XPubMod; |
| 55 | +// N.B. This isn't the path as used *or* the original path! |
| 56 | +//@ is "$.index[*][?(@.name=='X4')].inner.type_alias.type.resolved_path.name" '"defines_and_reexports::InPubMod"' |
| 57 | +pub type X4 = XPubMod2; |
| 58 | + |
| 59 | +//@ is "$.index[*][?(@.name=='Y1')].inner.type_alias.type.resolved_path.name" '"defines_and_reexports::InPrivMod"' |
| 60 | +pub type Y1 = defines_and_reexports::InPrivMod; |
| 61 | +//@ is "$.index[*][?(@.name=='Y2')].inner.type_alias.type.resolved_path.name" '"defines_and_reexports::InPrivMod2"' |
| 62 | +pub type Y2 = defines_and_reexports::InPrivMod2; |
| 63 | +//@ is "$.index[*][?(@.name=='Y3')].inner.type_alias.type.resolved_path.name" '"XPrivMod"' |
| 64 | +pub type Y3 = XPrivMod; |
| 65 | +//@ is "$.index[*][?(@.name=='Y4')].inner.type_alias.type.resolved_path.name" '"defines_and_reexports::InPrivMod"' |
| 66 | +pub type Y4 = XPrivMod2; |
| 67 | + |
| 68 | +// For foreign items, $.paths contains the *origional* path, even if it's not publicly |
| 69 | +// assessable. This should probably be changed. |
| 70 | + |
| 71 | +//@ has "$.paths[*].path" '["defines_and_reexports", "m1", "InPubMod"]' |
| 72 | +//@ has "$.paths[*].path" '["defines_and_reexports", "m2", "InPrivMod"]' |
| 73 | +//@ !has "$.paths[*].path" '["defines_and_reexports", "InPubMod"]' |
| 74 | +//@ !has "$.paths[*].path" '["defines_and_reexports", "InPrivMod"]' |
0 commit comments