From 090040bf4037a094e50b03d79e4baf5cd89c912b Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 5 May 2014 18:56:44 -0700 Subject: librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, except for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change] --- src/liblog/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/liblog/lib.rs') diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index a32a42636b6..035a81f4143 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -158,7 +158,7 @@ pub static WARN: u32 = 2; /// Error log level pub static ERROR: u32 = 1; -local_data_key!(local_logger: ~Logger:Send) +local_data_key!(local_logger: Box) /// A trait used to represent an interface to a task-local logger. Each task /// can have its own custom logger which can respond to logging messages @@ -229,7 +229,7 @@ pub fn log(level: u32, loc: &'static LogLocation, args: &fmt::Arguments) { // frob the slot while we're doing the logging. This will destroy any logger // set during logging. let mut logger = local_data::pop(local_logger).unwrap_or_else(|| { - box DefaultLogger { handle: io::stderr() } as ~Logger:Send + box DefaultLogger { handle: io::stderr() } as Box }); logger.log(&LogRecord { level: LogLevel(level), @@ -249,7 +249,7 @@ pub fn log_level() -> u32 { unsafe { LOG_LEVEL } } /// Replaces the task-local logger with the specified logger, returning the old /// logger. -pub fn set_logger(logger: ~Logger:Send) -> Option<~Logger:Send> { +pub fn set_logger(logger: Box) -> Option> { let prev = local_data::pop(local_logger); local_data::set(local_logger, logger); return prev; @@ -351,7 +351,7 @@ fn init() { // Schedule the cleanup for this global for when the runtime exits. rt::at_exit(proc() { assert!(!DIRECTIVES.is_null()); - let _directives: ~Vec = + let _directives: Box> = cast::transmute(DIRECTIVES); DIRECTIVES = 0 as *Vec; }); -- cgit 1.4.1-3-g733a5