Implement generalized object and type parameter bounds (Fixes #16462)
This commit is contained in:
parent
3ee047ae1f
commit
1b487a8906
272 changed files with 6783 additions and 3154 deletions
|
|
@ -825,12 +825,20 @@ pub trait GenericPathUnsafe {
|
|||
unsafe fn push_unchecked<T: BytesContainer>(&mut self, path: T);
|
||||
}
|
||||
|
||||
/// Helper struct for printing paths with format!()
|
||||
/// Note: stage0-specific version that lacks bound.
|
||||
#[cfg(stage0)]
|
||||
pub struct Display<'a, P> {
|
||||
path: &'a P,
|
||||
filename: bool
|
||||
}
|
||||
|
||||
/// Helper struct for printing paths with format!()
|
||||
#[cfg(not(stage0))]
|
||||
pub struct Display<'a, P:'a> {
|
||||
path: &'a P,
|
||||
filename: bool
|
||||
}
|
||||
|
||||
impl<'a, P: GenericPath> fmt::Show for Display<'a, P> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
self.as_maybe_owned().as_slice().fmt(f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue