diff options
Diffstat (limited to 'tests/ui/annotate-snippet')
| -rw-r--r-- | tests/ui/annotate-snippet/auxiliary/other_file.rs | 6 | ||||
| -rw-r--r-- | tests/ui/annotate-snippet/multiple-files.rs | 8 | ||||
| -rw-r--r-- | tests/ui/annotate-snippet/multiple-files.stderr | 11 |
3 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/annotate-snippet/auxiliary/other_file.rs b/tests/ui/annotate-snippet/auxiliary/other_file.rs new file mode 100644 index 00000000000..6f5f412d086 --- /dev/null +++ b/tests/ui/annotate-snippet/auxiliary/other_file.rs @@ -0,0 +1,6 @@ +pub struct WithPrivateMethod; + +impl WithPrivateMethod { + /// Private to get an error involving two files + fn private_method(&self) {} +} diff --git a/tests/ui/annotate-snippet/multiple-files.rs b/tests/ui/annotate-snippet/multiple-files.rs new file mode 100644 index 00000000000..981cdbb10a9 --- /dev/null +++ b/tests/ui/annotate-snippet/multiple-files.rs @@ -0,0 +1,8 @@ +// aux-build:other_file.rs +// compile-flags: --error-format human-annotate-rs -Z unstable-options + +extern crate other_file; + +fn main() { + other_file::WithPrivateMethod.private_method(); +} diff --git a/tests/ui/annotate-snippet/multiple-files.stderr b/tests/ui/annotate-snippet/multiple-files.stderr new file mode 100644 index 00000000000..4236ec811d0 --- /dev/null +++ b/tests/ui/annotate-snippet/multiple-files.stderr @@ -0,0 +1,11 @@ +error[E0624]: method `private_method` is private + --> $DIR/multiple-files.rs:7:35 + | +LL | other_file::WithPrivateMethod.private_method(); + | ^^^^^^^^^^^^^^ private method + | + ::: $DIR/auxiliary/other_file.rs:5:5 + | +LL | fn private_method(&self) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^ private method defined here + | |
