From a3998ad6e59a6a833e27e9ea6691d3ecd1e877a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Huchet?= Date: Thu, 4 May 2017 11:11:14 +0200 Subject: [PATCH 1/6] Join method returns a thread::Result --- src/libstd/thread/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 4e49c485f109f..7fc43a341a8f7 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -66,7 +66,7 @@ //! let res = child.join(); //! ``` //! -//! The [`join`] method returns a [`Result`] containing [`Ok`] of the final +//! The [`join`] method returns a [`thread::Result`] containing [`Ok`] of the final //! value produced by the child thread, or [`Err`] of the value given to //! a call to [`panic!`] if the child panicked. //! From 3a07155a9df03ced8c077990a3af0eb7b40d5c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Huchet?= Date: Thu, 4 May 2017 11:33:26 +0200 Subject: [PATCH 2/6] create link to Result --- src/libstd/thread/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 7fc43a341a8f7..719b50d119635 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -159,6 +159,7 @@ //! [`panic!`]: ../../std/macro.panic.html //! [`Builder`]: ../../std/thread/struct.Builder.html //! [`thread::current`]: ../../std/thread/fn.current.html +//! [`thread::Result`]: ../../std/thread/struct.Result.html //! [`Thread`]: ../../std/thread/struct.Thread.html //! [`park`]: ../../std/thread/fn.park.html //! [`unpark`]: ../../std/thread/struct.Thread.html#method.unpark From 93e179a8c132f6aa9790b198cdcdd441424b4a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Huchet?= Date: Thu, 4 May 2017 14:04:03 +0200 Subject: [PATCH 3/6] Update mod.rs --- src/libstd/thread/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 719b50d119635..8e7eaa77cd709 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -159,7 +159,7 @@ //! [`panic!`]: ../../std/macro.panic.html //! [`Builder`]: ../../std/thread/struct.Builder.html //! [`thread::current`]: ../../std/thread/fn.current.html -//! [`thread::Result`]: ../../std/thread/struct.Result.html +//! [`thread::Result`]: ../../std/thread/type.Result.html //! [`Thread`]: ../../std/thread/struct.Thread.html //! [`park`]: ../../std/thread/fn.park.html //! [`unpark`]: ../../std/thread/struct.Thread.html#method.unpark From 05329e578014ee1e9a0a45658e5fba60f6b06e83 Mon Sep 17 00:00:00 2001 From: Tommy Ip Date: Thu, 4 May 2017 13:14:39 +0100 Subject: [PATCH 4/6] Remove use of `Self: Sized` from libsyntax The bound is not required for compiling but it prevents using `next_token()` from a trait object. Fixes #33506. --- src/libsyntax/parse/lexer/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index c2e5763237d3c..7d2a1b3c4a4d2 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -73,7 +73,7 @@ fn mk_sp(lo: BytePos, hi: BytePos) -> Span { } impl<'a> StringReader<'a> { - fn next_token(&mut self) -> TokenAndSpan where Self: Sized { + fn next_token(&mut self) -> TokenAndSpan { let res = self.try_next_token(); self.unwrap_or_abort(res) } From 7b94d6cf19d1a9af23483d366217b010ed66b78d Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Thu, 4 May 2017 11:53:24 -0400 Subject: [PATCH 5/6] Simplify types in `std::option` doc comment example. --- src/libcore/option.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 1a48f27762580..515f49d6f0bdd 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -66,14 +66,14 @@ //! not ([`None`]). //! //! ``` -//! let optional: Option> = None; -//! check_optional(&optional); +//! let optional = None; +//! check_optional(optional); //! -//! let optional: Option> = Some(Box::new(9000)); -//! check_optional(&optional); +//! let optional = Some(Box::new(9000)); +//! check_optional(optional); //! -//! fn check_optional(optional: &Option>) { -//! match *optional { +//! fn check_optional(optional: Option>) { +//! match optional { //! Some(ref p) => println!("has value {}", p), //! None => println!("has no value"), //! } From 0f6d4ac88dfd2ea086a49e9991a67b36902de7c0 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 4 May 2017 13:14:24 -0400 Subject: [PATCH 6/6] kill some unused fields in TyCtxt --- src/librustc/ty/context.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 42528aac633cb..c782bea72f4b4 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -482,14 +482,6 @@ pub struct GlobalCtxt<'tcx> { /// about. pub used_mut_nodes: RefCell, - /// The set of external nominal types whose implementations have been read. - /// This is used for lazy resolution of methods. - pub populated_external_types: RefCell, - - /// The set of external primitive types whose implementations have been read. - /// FIXME(arielb1): why is this separate from populated_external_types? - pub populated_external_primitive_impls: RefCell, - /// Maps any item's def-id to its stability index. pub stability: RefCell>, @@ -767,8 +759,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { lang_items: lang_items, used_unsafe: RefCell::new(NodeSet()), used_mut_nodes: RefCell::new(NodeSet()), - populated_external_types: RefCell::new(DefIdSet()), - populated_external_primitive_impls: RefCell::new(DefIdSet()), stability: RefCell::new(stability), selection_cache: traits::SelectionCache::new(), evaluation_cache: traits::EvaluationCache::new(),