From 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:39 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/diagnostic-width/auxiliary/tab_column_numbers.rs | 6 ++++++ tests/ui/diagnostic-width/tab-column-numbers.rs | 12 ++++++++++++ tests/ui/diagnostic-width/tab-column-numbers.stderr | 14 ++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 tests/ui/diagnostic-width/auxiliary/tab_column_numbers.rs create mode 100644 tests/ui/diagnostic-width/tab-column-numbers.rs create mode 100644 tests/ui/diagnostic-width/tab-column-numbers.stderr (limited to 'tests/ui/diagnostic-width') diff --git a/tests/ui/diagnostic-width/auxiliary/tab_column_numbers.rs b/tests/ui/diagnostic-width/auxiliary/tab_column_numbers.rs new file mode 100644 index 000000000..93418b765 --- /dev/null +++ b/tests/ui/diagnostic-width/auxiliary/tab_column_numbers.rs @@ -0,0 +1,6 @@ +// ignore-tidy-tab + +pub struct S; +impl S { + fn method(&self) {} +} diff --git a/tests/ui/diagnostic-width/tab-column-numbers.rs b/tests/ui/diagnostic-width/tab-column-numbers.rs new file mode 100644 index 000000000..2abb0bcde --- /dev/null +++ b/tests/ui/diagnostic-width/tab-column-numbers.rs @@ -0,0 +1,12 @@ +// Test for #109537: ensure that column numbers are correctly generated when using hard tabs. +// aux-build:tab_column_numbers.rs + +// ignore-tidy-tab + +extern crate tab_column_numbers; + +fn main() { + let s = tab_column_numbers::S; + s.method(); + //~^ ERROR method `method` is private +} diff --git a/tests/ui/diagnostic-width/tab-column-numbers.stderr b/tests/ui/diagnostic-width/tab-column-numbers.stderr new file mode 100644 index 000000000..ea4e1ff52 --- /dev/null +++ b/tests/ui/diagnostic-width/tab-column-numbers.stderr @@ -0,0 +1,14 @@ +error[E0624]: method `method` is private + --> $DIR/tab-column-numbers.rs:10:4 + | +LL | s.method(); + | ^^^^^^ private method + | + ::: $DIR/auxiliary/tab_column_numbers.rs:5:3 + | +LL | fn method(&self) {} + | ---------------- private method defined here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0624`. -- cgit v1.2.3