From 5731ca3078318a66a13208133d8839a9f9f92629 Mon Sep 17 00:00:00 2001 From: Erik Price Date: Mon, 9 Dec 2013 23:16:18 -0800 Subject: Make 'self lifetime illegal. Also remove all instances of 'self within the codebase. This fixes #10889. --- src/libstd/path/mod.rs | 16 ++++++++-------- src/libstd/path/posix.rs | 14 +++++++------- src/libstd/path/windows.rs | 20 ++++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) (limited to 'src/libstd/path') diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs index 303bb470991..53948dc8309 100644 --- a/src/libstd/path/mod.rs +++ b/src/libstd/path/mod.rs @@ -523,18 +523,18 @@ pub trait GenericPathUnsafe { } /// Helper struct for printing paths with format!() -pub struct Display<'self, P> { - priv path: &'self P, +pub struct Display<'a, P> { + priv path: &'a P, priv filename: bool } -impl<'self, P: GenericPath> fmt::Default for Display<'self, P> { +impl<'a, P: GenericPath> fmt::Default for Display<'a, P> { fn fmt(d: &Display

, f: &mut fmt::Formatter) { d.with_str(|s| f.pad(s)) } } -impl<'self, P: GenericPath> ToStr for Display<'self, P> { +impl<'a, P: GenericPath> ToStr for Display<'a, P> { /// Returns the path as a string /// /// If the path is not UTF-8, invalid sequences with be replaced with the @@ -551,7 +551,7 @@ impl<'self, P: GenericPath> ToStr for Display<'self, P> { } } -impl<'self, P: GenericPath> Display<'self, P> { +impl<'a, P: GenericPath> Display<'a, P> { /// Provides the path as a string to a closure /// /// If the path is not UTF-8, invalid sequences will be replaced with the @@ -570,7 +570,7 @@ impl<'self, P: GenericPath> Display<'self, P> { } } -impl<'self> BytesContainer for &'self str { +impl<'a> BytesContainer for &'a str { #[inline] fn container_as_bytes<'a>(&'a self) -> &'a [u8] { self.as_bytes() @@ -584,7 +584,7 @@ impl<'self> BytesContainer for &'self str { Some(*self) } #[inline] - fn is_str(_: Option<&'self str>) -> bool { true } + fn is_str(_: Option<&'a str>) -> bool { true } } impl BytesContainer for ~str { @@ -625,7 +625,7 @@ impl BytesContainer for @str { fn is_str(_: Option<@str>) -> bool { true } } -impl<'self> BytesContainer for &'self [u8] { +impl<'a> BytesContainer for &'a [u8] { #[inline] fn container_as_bytes<'a>(&'a self) -> &'a [u8] { *self diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index 10ce06f7e03..3f2535765dd 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -25,16 +25,16 @@ use vec::{CopyableVector, RSplitIterator, SplitIterator, Vector, VectorVector}; use super::{BytesContainer, GenericPath, GenericPathUnsafe}; /// Iterator that yields successive components of a Path as &[u8] -pub type ComponentIter<'self> = SplitIterator<'self, u8>; +pub type ComponentIter<'a> = SplitIterator<'a, u8>; /// Iterator that yields components of a Path in reverse as &[u8] -pub type RevComponentIter<'self> = RSplitIterator<'self, u8>; +pub type RevComponentIter<'a> = RSplitIterator<'a, u8>; /// Iterator that yields successive components of a Path as Option<&str> -pub type StrComponentIter<'self> = Map<'self, &'self [u8], Option<&'self str>, - ComponentIter<'self>>; +pub type StrComponentIter<'a> = Map<'a, &'a [u8], Option<&'a str>, + ComponentIter<'a>>; /// Iterator that yields components of a Path in reverse as Option<&str> -pub type RevStrComponentIter<'self> = Map<'self, &'self [u8], Option<&'self str>, - RevComponentIter<'self>>; +pub type RevStrComponentIter<'a> = Map<'a, &'a [u8], Option<&'a str>, + RevComponentIter<'a>>; /// Represents a POSIX file path #[deriving(Clone, DeepClone)] @@ -103,7 +103,7 @@ impl BytesContainer for Path { } } -impl<'self> BytesContainer for &'self Path { +impl<'a> BytesContainer for &'a Path { #[inline] fn container_as_bytes<'a>(&'a self) -> &'a [u8] { self.as_vec() diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index b7a0d685f12..114f675cdba 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -27,21 +27,21 @@ use super::{contains_nul, BytesContainer, GenericPath, GenericPathUnsafe}; /// /// Each component is yielded as Option<&str> for compatibility with PosixPath, but /// every component in WindowsPath is guaranteed to be Some. -pub type StrComponentIter<'self> = Map<'self, &'self str, Option<&'self str>, - CharSplitIterator<'self, char>>; +pub type StrComponentIter<'a> = Map<'a, &'a str, Option<&'a str>, + CharSplitIterator<'a, char>>; /// Iterator that yields components of a Path in reverse as &str /// /// Each component is yielded as Option<&str> for compatibility with PosixPath, but /// every component in WindowsPath is guaranteed to be Some. -pub type RevStrComponentIter<'self> = Invert, - CharSplitIterator<'self, char>>>; +pub type RevStrComponentIter<'a> = Invert, + CharSplitIterator<'a, char>>>; /// Iterator that yields successive components of a Path as &[u8] -pub type ComponentIter<'self> = Map<'self, Option<&'self str>, &'self [u8], - StrComponentIter<'self>>; +pub type ComponentIter<'a> = Map<'a, Option<&'a str>, &'a [u8], + StrComponentIter<'a>>; /// Iterator that yields components of a Path in reverse as &[u8] -pub type RevComponentIter<'self> = Map<'self, Option<&'self str>, &'self [u8], - RevStrComponentIter<'self>>; +pub type RevComponentIter<'a> = Map<'a, Option<&'a str>, &'a [u8], + RevStrComponentIter<'a>>; /// Represents a Windows path // Notes for Windows path impl: @@ -138,7 +138,7 @@ impl BytesContainer for Path { fn is_str(_: Option) -> bool { true } } -impl<'self> BytesContainer for &'self Path { +impl<'a> BytesContainer for &'a Path { #[inline] fn container_as_bytes<'a>(&'a self) -> &'a [u8] { self.as_vec() @@ -152,7 +152,7 @@ impl<'self> BytesContainer for &'self Path { self.as_str() } #[inline] - fn is_str(_: Option<&'self Path>) -> bool { true } + fn is_str(_: Option<&'a Path>) -> bool { true } } impl GenericPathUnsafe for Path { -- cgit 1.4.1-3-g733a5