Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 14f9c63

Browse files
committed
Show that it will pick up the entirely wrong function as a private candidate
1 parent 5e8df95 commit 14f9c63

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

src/tools/tidy/src/ui_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::path::{Path, PathBuf};
1515
const ENTRY_LIMIT: u32 = 900;
1616
// FIXME: The following limits should be reduced eventually.
1717

18-
const ISSUES_ENTRY_LIMIT: u32 = 1674;
18+
const ISSUES_ENTRY_LIMIT: u32 = 1675;
1919

2020
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
2121
"rs", // test source files

tests/ui/issues/issue-53498.stderr renamed to tests/ui/issues/issue-53498.different_name.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0624]: associated function `foo` is private
2-
--> $DIR/issue-53498.rs:16:27
2+
--> $DIR/issue-53498.rs:21:27
33
|
44
LL | fn foo() {}
55
| -------- private associated function defined here

tests/ui/issues/issue-53498.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//@ revisions: same_name different_name
2+
13
pub mod test {
24
pub struct A;
35
pub struct B;
@@ -8,10 +10,15 @@ pub mod test {
810
}
911

1012
impl Foo<B> {
13+
#[cfg(same_name)]
1114
fn foo() {}
15+
#[cfg(different_name)]
16+
fn bar() {}
1217
}
1318
}
1419

1520
fn main() {
16-
test::Foo::<test::B>::foo(); //~ ERROR associated function `foo` is private
21+
test::Foo::<test::B>::foo();
22+
//[same_name]~^ ERROR associated function `foo` is private
23+
//[different_name]~^^ ERROR associated function `foo` is private
1724
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0624]: associated function `foo` is private
2+
--> $DIR/issue-53498.rs:21:27
3+
|
4+
LL | fn foo() {}
5+
| -------- private associated function defined here
6+
...
7+
LL | test::Foo::<test::B>::foo();
8+
| ^^^ private associated function
9+
10+
error: aborting due to 1 previous error
11+
12+
For more information about this error, try `rustc --explain E0624`.

0 commit comments

Comments
 (0)