diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2015-02-13 22:58:37 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2015-02-18 08:19:21 +1100 |
| commit | d7b5bc3c2f673ac3edd818cb7bd42555c2cbc2a2 (patch) | |
| tree | 9fc5d0740225f18a41e9dda8ef5bfbc132a858c2 /src/libterm | |
| parent | cae969e2a755bd7e8ec22758a8a02146ddb599a4 (diff) | |
| download | rust-d7b5bc3c2f673ac3edd818cb7bd42555c2cbc2a2.tar.gz rust-d7b5bc3c2f673ac3edd818cb7bd42555c2cbc2a2.zip | |
Update the libraries to reflect Send loosing the 'static bound.
In most places this preserves the current API by adding an explicit `'static` bound. Notably absent are some impls like `unsafe impl<T: Send> Send for Foo<T>` and the `std::thread` module. It is likely that it will be possible to remove these after auditing the code to ensure restricted lifetimes are safe. More progress on #22251.
Diffstat (limited to 'src/libterm')
| -rw-r--r-- | src/libterm/terminfo/mod.rs | 7 | ||||
| -rw-r--r-- | src/libterm/win.rs | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/libterm/terminfo/mod.rs b/src/libterm/terminfo/mod.rs index 758191a6e11..b978d2d8054 100644 --- a/src/libterm/terminfo/mod.rs +++ b/src/libterm/terminfo/mod.rs @@ -72,7 +72,7 @@ pub struct TerminfoTerminal<T> { ti: Box<TermInfo> } -impl<T: Writer+Send> Terminal<T> for TerminfoTerminal<T> { +impl<T: Writer+Send+'static> Terminal<T> for TerminfoTerminal<T> { fn fg(&mut self, color: color::Color) -> IoResult<bool> { let color = self.dim_if_necessary(color); if self.num_colors > color { @@ -164,11 +164,11 @@ impl<T: Writer+Send> Terminal<T> for TerminfoTerminal<T> { fn get_mut<'a>(&'a mut self) -> &'a mut T { &mut self.out } } -impl<T: Writer+Send> UnwrappableTerminal<T> for TerminfoTerminal<T> { +impl<T: Writer+Send+'static> UnwrappableTerminal<T> for TerminfoTerminal<T> { fn unwrap(self) -> T { self.out } } -impl<T: Writer+Send> TerminfoTerminal<T> { +impl<T: Writer+Send+'static> TerminfoTerminal<T> { /// Returns `None` whenever the terminal cannot be created for some /// reason. pub fn new(out: T) -> Option<Box<Terminal<T>+Send+'static>> { @@ -229,4 +229,3 @@ impl<T: Writer> Writer for TerminfoTerminal<T> { self.out.flush() } } - diff --git a/src/libterm/win.rs b/src/libterm/win.rs index a56613681c8..e93b956dc7c 100644 --- a/src/libterm/win.rs +++ b/src/libterm/win.rs @@ -86,7 +86,7 @@ fn bits_to_color(bits: u16) -> color::Color { color | (bits & 0x8) // copy the hi-intensity bit } -impl<T: Writer+Send> WinConsole<T> { +impl<T: Writer+Send+'static> WinConsole<T> { fn apply(&mut self) { let _unused = self.buf.flush(); let mut accum: libc::WORD = 0; @@ -139,7 +139,7 @@ impl<T: Writer> Writer for WinConsole<T> { } } -impl<T: Writer+Send> Terminal<T> for WinConsole<T> { +impl<T: Writer+Send+'static> Terminal<T> for WinConsole<T> { fn fg(&mut self, color: color::Color) -> IoResult<bool> { self.foreground = color; self.apply(); @@ -192,6 +192,6 @@ impl<T: Writer+Send> Terminal<T> for WinConsole<T> { fn get_mut<'a>(&'a mut self) -> &'a mut T { &mut self.buf } } -impl<T: Writer+Send> UnwrappableTerminal<T> for WinConsole<T> { +impl<T: Writer+Send+'static> UnwrappableTerminal<T> for WinConsole<T> { fn unwrap(self) -> T { self.buf } } |
