Skip to content

Commit 6e5c64e

Browse files
committed
revert
1 parent 2bebdf0 commit 6e5c64e

File tree

4 files changed

+17
-81
lines changed

4 files changed

+17
-81
lines changed
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
//@ edition: 2021
22

3-
pub trait TraitA {
4-
fn a();
5-
}
6-
7-
pub trait TraitB {
8-
fn b();
9-
}
10-
11-
pub trait TraitC {
12-
fn c();
3+
pub trait Foo {
4+
fn foo();
135
}

tests/ui/typeck/auxiliary/suggest-trait-reexported-as-not-doc-visible-b.rs

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,13 @@
22
//@ edition: 2021
33
//@ aux-crate:suggest_trait_reexported_as_not_doc_visible_a=suggest-trait-reexported-as-not-doc-visible-a.rs
44

5-
#[doc(hidden)]
6-
pub use suggest_trait_reexported_as_not_doc_visible_a::TraitA;
7-
8-
#[doc(hidden)]
9-
pub mod __DocHidden {
10-
pub use suggest_trait_reexported_as_not_doc_visible_a::TraitB;
11-
12-
pub mod Inner {
13-
pub use suggest_trait_reexported_as_not_doc_visible_a::TraitC;
14-
}
15-
}
5+
pub struct Bar;
166

17-
impl suggest_trait_reexported_as_not_doc_visible_a::TraitA for Foo {
18-
fn a() {}
7+
impl __DocHidden::Foo for Bar {
8+
fn foo() {}
199
}
2010

21-
impl __DocHidden::TraitB for Foo {
22-
fn b() {}
23-
}
24-
25-
impl __DocHidden::Inner::TraitC for Foo {
26-
fn c() {}
11+
#[doc(hidden)]
12+
pub mod __DocHidden {
13+
pub use suggest_trait_reexported_as_not_doc_visible_a::Foo;
2714
}
28-
29-
pub struct Foo;

tests/ui/typeck/suggest-trait-reexported-as-not-doc-visible.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
//@ aux-crate:suggest_trait_reexported_as_not_doc_visible_a=suggest-trait-reexported-as-not-doc-visible-a.rs
44
//@ aux-crate:suggest_trait_reexported_as_not_doc_visible_b=suggest-trait-reexported-as-not-doc-visible-b.rs
55

6-
use suggest_trait_reexported_as_not_doc_visible_b::Foo;
6+
use suggest_trait_reexported_as_not_doc_visible_b::Bar;
77

88
fn main() {
9-
Foo::a();
10-
//~ no function or associated item named `a` found for struct `Foo` in the current scope [E0599]
11-
Foo::b();
12-
Foo::c();
9+
Bar::foo();
10+
//~^ ERROR: no function or associated item named `foo` found for struct `Bar` in the current scope [E0599]
1311
}
Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,15 @@
1-
error[E0599]: no function or associated item named `a` found for struct `Foo` in the current scope
1+
error[E0599]: no function or associated item named `foo` found for struct `Bar` in the current scope
22
--> $DIR/suggest-trait-reexported-as-not-doc-visible.rs:9:10
33
|
4-
LL | Foo::a();
5-
| ^ function or associated item not found in `Foo`
4+
LL | Bar::foo();
5+
| ^^^ function or associated item not found in `Bar`
66
|
77
= help: items from traits can only be used if the trait is in scope
8-
help: trait `TraitA` which provides `a` is implemented but not in scope; perhaps you want to import it
8+
help: trait `Foo` which provides `foo` is implemented but not in scope; perhaps you want to import it
99
|
10-
LL + use suggest_trait_reexported_as_not_doc_visible_b::TraitA;
11-
|
12-
help: there is an associated function `b` with a similar name
13-
|
14-
LL - Foo::a();
15-
LL + Foo::b();
16-
|
17-
18-
error[E0599]: no function or associated item named `b` found for struct `Foo` in the current scope
19-
--> $DIR/suggest-trait-reexported-as-not-doc-visible.rs:10:10
20-
|
21-
LL | Foo::b();
22-
| ^ function or associated item not found in `Foo`
23-
|
24-
= help: items from traits can only be used if the trait is in scope
25-
help: trait `TraitB` which provides `b` is implemented but not in scope; perhaps you want to import it
26-
|
27-
LL + use suggest_trait_reexported_as_not_doc_visible_a::TraitB;
28-
|
29-
help: there is an associated function `a` with a similar name
30-
|
31-
LL - Foo::b();
32-
LL + Foo::a();
33-
|
34-
35-
error[E0599]: no function or associated item named `c` found for struct `Foo` in the current scope
36-
--> $DIR/suggest-trait-reexported-as-not-doc-visible.rs:11:10
37-
|
38-
LL | Foo::c();
39-
| ^ function or associated item not found in `Foo`
40-
|
41-
= help: items from traits can only be used if the trait is in scope
42-
help: trait `TraitC` which provides `c` is implemented but not in scope; perhaps you want to import it
43-
|
44-
LL + use suggest_trait_reexported_as_not_doc_visible_a::TraitC;
45-
|
46-
help: there is an associated function `a` with a similar name
47-
|
48-
LL - Foo::c();
49-
LL + Foo::a();
10+
LL + use suggest_trait_reexported_as_not_doc_visible_a::Foo;
5011
|
5112

52-
error: aborting due to 3 previous errors
13+
error: aborting due to 1 previous error
5314

5415
For more information about this error, try `rustc --explain E0599`.

0 commit comments

Comments
 (0)