-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfe3188
commit e315bbf
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
trait PrivTrait { | ||
fn priv_fn(&self); | ||
} | ||
|
||
pub struct ImplPrivTrait; | ||
|
||
impl PrivTrait for ImplPrivTrait { | ||
fn priv_fn(&self) {} | ||
} | ||
|
||
pub struct Wrapper<T>(T); | ||
|
||
pub trait PubTrait { | ||
fn pub_fn(&self); | ||
} | ||
|
||
impl<T: PrivTrait> PubTrait for Wrapper<T> { | ||
fn pub_fn(&self) { | ||
self.0.priv_fn() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// aux-build:foreign-priv-aux.rs | ||
// build-pass | ||
|
||
#![crate_type = "lib"] | ||
|
||
extern crate foreign_priv_aux; | ||
|
||
use foreign_priv_aux::{ImplPrivTrait, PubTrait, Wrapper}; | ||
|
||
pub fn foo(x: Wrapper<ImplPrivTrait>) { | ||
x.pub_fn(); | ||
} |