From 1b487a890695e7d6dfbfe5dcd7d4fa0e8ca8003f Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 27 Aug 2014 21:46:52 -0400 Subject: Implement generalized object and type parameter bounds (Fixes #16462) --- src/libstd/path/mod.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/libstd/path') diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs index 50441cb534d..6a10be84a62 100644 --- a/src/libstd/path/mod.rs +++ b/src/libstd/path/mod.rs @@ -825,12 +825,20 @@ pub trait GenericPathUnsafe { unsafe fn push_unchecked(&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) -- cgit 1.4.1-3-g733a5