From 4698b9fc432faf7b2d2beb136335786f9c637adf Mon Sep 17 00:00:00 2001 From: Mads Ravn Date: Fri, 7 Apr 2023 00:15:11 +0200 Subject: [PATCH 1/2] Updating Wake example to use new 'pin!' macro --- library/alloc/src/task.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/alloc/src/task.rs b/library/alloc/src/task.rs index 9d8e309a978d9..5d9772b878b03 100644 --- a/library/alloc/src/task.rs +++ b/library/alloc/src/task.rs @@ -39,6 +39,7 @@ use crate::sync::Arc; /// use std::sync::Arc; /// use std::task::{Context, Poll, Wake}; /// use std::thread::{self, Thread}; +/// use core::pin::pin; /// /// /// A waker that wakes up the current thread when called. /// struct ThreadWaker(Thread); @@ -52,7 +53,7 @@ use crate::sync::Arc; /// /// Run a future to completion on the current thread. /// fn block_on(fut: impl Future) -> T { /// // Pin the future so it can be polled. -/// let mut fut = Box::pin(fut); +/// let mut fut = pin!(fut); /// /// // Create a new context to be passed to the future. /// let t = thread::current(); From 7711ce82910bb4c1e520760a4f455e7f056d8946 Mon Sep 17 00:00:00 2001 From: Mads Ravn Date: Sun, 9 Apr 2023 22:35:15 +0200 Subject: [PATCH 2/2] './configure' now checks if 'config.toml' exists before writing to that destination --- src/bootstrap/configure.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index abd28b4005d0b..5a056d364ca5b 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -521,6 +521,10 @@ def write_config_toml(writer, section_order, targets, sections): else: writer = write_uncommented(sections[section], writer) +def quit_if_file_exists(file): + if os.path.isfile(file): + p("Existing '" + file + "' detected. EXIING") + quit() if __name__ == "__main__": p("processing command line") @@ -528,6 +532,8 @@ def write_config_toml(writer, section_order, targets, sections): # TOML we're going to write out p("") section_order, sections, targets = parse_args(sys.argv[1:]) + # If 'config.toml' already exists, exit the script at this point + quit_if_file_exists('config.toml') # Now that we've built up our `config.toml`, write it all out in the same # order that we read it in.