about summary refs log tree commit diff
path: root/src/libstd/path
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2014-08-27 21:46:52 -0400
committerNiko Matsakis <niko@alum.mit.edu>2014-08-27 21:46:52 -0400
commit1b487a890695e7d6dfbfe5dcd7d4fa0e8ca8003f (patch)
tree552fabade603ab0d148a49ae3cf1abd3f399740a /src/libstd/path
parent3ee047ae1ffab454270bc1859b3beef3556ef8f9 (diff)
downloadrust-1b487a890695e7d6dfbfe5dcd7d4fa0e8ca8003f.tar.gz
rust-1b487a890695e7d6dfbfe5dcd7d4fa0e8ca8003f.zip
Implement generalized object and type parameter bounds (Fixes #16462)
Diffstat (limited to 'src/libstd/path')
-rw-r--r--src/libstd/path/mod.rs10
1 files changed, 9 insertions, 1 deletions
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<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)