rust/tests/ui/eii/privacy2.rs
Esteban Küber c73b3d20c6 Unify wording of resolve error
Remove "failed to resolve" and use the same format we use in other resolution errors "cannot find `name`".

```
error[E0433]: cannot find `nonexistent` in `existent`
  --> $DIR/custom_attr_multisegment_error.rs:5:13
   |
LL | #[existent::nonexistent]
   |             ^^^^^^^^^^^ could not find `nonexistent` in `existent`
```
2026-02-17 16:51:44 +00:00

27 lines
638 B
Rust

//@ aux-build:other_crate_privacy2.rs
// Tests whether name resolution respects privacy properly.
#![feature(extern_item_impls)]
extern crate other_crate_privacy2 as codegen;
// has a span but in the other crate
//~? ERROR `#[eii2]` required, but not found
//~? ERROR `#[eii3]` required, but not found
#[codegen::eii1]
fn eii1_impl(x: u64) {
println!("{x:?}")
}
#[codegen::eii3] //~ ERROR cannot find `eii3` in `codegen`
fn eii3_impl(x: u64) {
println!("{x:?}")
}
// what you would write:
fn main() {
// directly
eii1_impl(21);
// through the alias
codegen::decl1(42); //~ ERROR function `decl1` is private
}