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 55//@ forbid-output: compiler_builtins
66//@ forbid-output: object
77
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+
813struct VecReader ( Vec < u8 > ) ;
914
1015impl std:: io:: Read for VecReader {
@@ -14,7 +19,12 @@ impl std::io::Read for VecReader {
1419 }
1520}
1621
22+ extern crate public_dep;
23+ use public_dep:: B ;
24+
1725fn main ( ) {
1826 let _ = u8:: cast_from_lossy ( 9 ) ;
1927 //~^ 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`
2030}
Original file line number Diff line number Diff line change 11error[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
33 |
44LL | self.0.read(buf)
55 | ^^^^
@@ -10,11 +10,17 @@ LL | self.0.read_at(buf)
1010 | +++
1111
1212error[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
1414 |
1515LL | let _ = u8::cast_from_lossy(9);
1616 | ^^^^^^^^^^^^^^^ function or associated item not found in `u8`
1717
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
1925
2026For more information about this error, try `rustc --explain E0599`.
You can’t perform that action at this time.
0 commit comments