File tree Expand file tree Collapse file tree 4 files changed +33
-3
lines changed Expand file tree Collapse file tree 4 files changed +33
-3
lines changed Original file line number Diff line number Diff line change
1
+ pub trait A {
2
+ fn foo ( ) { }
3
+ }
Original file line number Diff line number Diff line change
1
+ //@ aux-crate:priv:private_dep=private-dep.rs
2
+ //@ compile-flags: -Zunstable-options
3
+
4
+ extern crate private_dep;
5
+ use private_dep:: A ;
6
+
7
+ pub struct B ;
8
+
9
+ impl A for B {
10
+ fn foo ( ) { }
11
+ }
Original file line number Diff line number Diff line change 5
5
//@ forbid-output: compiler_builtins
6
6
//@ forbid-output: object
7
7
8
+ // Check a custom trait to withstand changes in above crates
9
+ //@ aux-crate:public_dep=public-dep.rs
10
+ //@ compile-flags: -Zunstable-options
11
+ //@ forbid-output: private_dep
12
+
8
13
struct VecReader ( Vec < u8 > ) ;
9
14
10
15
impl std:: io:: Read for VecReader {
@@ -14,7 +19,12 @@ impl std::io::Read for VecReader {
14
19
}
15
20
}
16
21
22
+ extern crate public_dep;
23
+ use public_dep:: B ;
24
+
17
25
fn main ( ) {
18
26
let _ = u8:: cast_from_lossy ( 9 ) ;
19
27
//~^ ERROR no function or associated item named `cast_from_lossy` found for type `u8`
28
+ let _ = B :: foo ( ) ;
29
+ //~^ ERROR no function or associated item named `foo` found for struct `B`
20
30
}
Original file line number Diff line number Diff line change 1
1
error[E0599]: no method named `read` found for struct `Vec<u8>` in the current scope
2
- --> $DIR/dont-suggest-private-dependencies.rs:12 :16
2
+ --> $DIR/dont-suggest-private-dependencies.rs:17 :16
3
3
|
4
4
LL | self.0.read(buf)
5
5
| ^^^^
@@ -10,11 +10,17 @@ LL | self.0.read_at(buf)
10
10
| +++
11
11
12
12
error[E0599]: no function or associated item named `cast_from_lossy` found for type `u8` in the current scope
13
- --> $DIR/dont-suggest-private-dependencies.rs:18 :17
13
+ --> $DIR/dont-suggest-private-dependencies.rs:26 :17
14
14
|
15
15
LL | let _ = u8::cast_from_lossy(9);
16
16
| ^^^^^^^^^^^^^^^ function or associated item not found in `u8`
17
17
18
- error: aborting due to 2 previous errors
18
+ error[E0599]: no function or associated item named `foo` found for struct `B` in the current scope
19
+ --> $DIR/dont-suggest-private-dependencies.rs:28:16
20
+ |
21
+ LL | let _ = B::foo();
22
+ | ^^^ function or associated item not found in `B`
23
+
24
+ error: aborting due to 3 previous errors
19
25
20
26
For more information about this error, try `rustc --explain E0599`.
You can’t perform that action at this time.
0 commit comments