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(); 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.