From 097126e2840425b7d11f269c39a22c86ef003d6b Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 4 Jan 2020 12:35:23 -0800 Subject: [PATCH 01/17] Omit underscore constants from rustdoc --- src/librustdoc/visit_ast.rs | 26 +++++++++++++++----------- src/test/rustdoc/const-underscore.rs | 7 +++++++ 2 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 src/test/rustdoc/const-underscore.rs diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 959f61644d60d..53deca2180cea 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -9,7 +9,7 @@ use rustc::ty::TyCtxt; use rustc::util::nodemap::{FxHashMap, FxHashSet}; use rustc_span::hygiene::MacroKind; use rustc_span::source_map::Spanned; -use rustc_span::symbol::sym; +use rustc_span::symbol::{kw, sym}; use rustc_span::{self, Span}; use syntax::ast; @@ -513,16 +513,20 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { om.statics.push(s); } hir::ItemKind::Const(type_, expr) => { - let s = Constant { - type_, - expr, - id: item.hir_id, - name: ident.name, - attrs: &item.attrs, - whence: item.span, - vis: &item.vis, - }; - om.constants.push(s); + // Underscore constants do not correspond to a nameable item and + // so are never useful in documentation. + if ident.name != kw::Underscore { + let s = Constant { + type_, + expr, + id: item.hir_id, + name: ident.name, + attrs: &item.attrs, + whence: item.span, + vis: &item.vis, + }; + om.constants.push(s); + } } hir::ItemKind::Trait(is_auto, unsafety, ref generics, ref bounds, ref item_ids) => { let items = item_ids.iter().map(|ti| self.cx.tcx.hir().trait_item(ti.id)).collect(); diff --git a/src/test/rustdoc/const-underscore.rs b/src/test/rustdoc/const-underscore.rs new file mode 100644 index 0000000000000..0d4809409f3a2 --- /dev/null +++ b/src/test/rustdoc/const-underscore.rs @@ -0,0 +1,7 @@ +// compile-flags: --document-private-items + +// @!has const_underscore/constant._.html +const _: () = { + #[no_mangle] + extern "C" fn implementation_detail() {} +}; From 12545c75ff9c9ad72ad50bbbb3cc1f5c04c8037a Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Sun, 5 Jan 2020 00:58:41 +0100 Subject: [PATCH 02/17] Handle multiple error fix suggestions carefuly The existing code seems to assume that substitutions spans are disjoint, which is not always the case. In the example: pub trait AAAA {} pub trait B {} pub trait C {} pub type T = P; , we get three substituions starting from ':' and ending respectively at the end of each trait token. With the former offset calculation, this would cause `underline_start` to eventually become negative before being converted to `usize`... The new version may report erroneous results for non perfectly overlapping substitutions but I don't know if such examples exist. Alternatively, we could detect these cases and trim out overlapping substitutions. --- src/librustc_errors/emitter.rs | 18 +++++++++++++----- ...-67690-type-alias-bound-diagnostic-crash.rs | 8 ++++++++ ...90-type-alias-bound-diagnostic-crash.stderr | 12 ++++++++++++ src/test/ui/type/type-alias-bounds.rs | 2 +- src/test/ui/type/type-alias-bounds.stderr | 6 +++--- 5 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.rs create mode 100644 src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.stderr diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index 541b89e6fce5f..526b4e2971bef 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -1530,7 +1530,7 @@ impl EmitterWriter { // This offset and the ones below need to be signed to account for replacement code // that is shorter than the original code. - let mut offset: isize = 0; + let mut offsets: Vec<(usize, isize)> = Vec::new(); // Only show an underline in the suggestions if the suggestion is not the // entirety of the code being shown and the displayed code is not multiline. if show_underline { @@ -1550,12 +1550,19 @@ impl EmitterWriter { .map(|ch| unicode_width::UnicodeWidthChar::width(ch).unwrap_or(1)) .sum(); + let offset: isize = offsets + .iter() + .filter_map( + |(start, v)| if span_start_pos <= *start { None } else { Some(v) }, + ) + .sum(); let underline_start = (span_start_pos + start) as isize + offset; let underline_end = (span_start_pos + start + sub_len) as isize + offset; + assert!(underline_start >= 0 && underline_end >= 0); for p in underline_start..underline_end { buffer.putc( row_num, - max_line_num_len + 3 + p as usize, + ((max_line_num_len + 3) as isize + p) as usize, '^', Style::UnderlinePrimary, ); @@ -1565,7 +1572,7 @@ impl EmitterWriter { for p in underline_start - 1..underline_start + 1 { buffer.putc( row_num, - max_line_num_len + 3 + p as usize, + ((max_line_num_len + 3) as isize + p) as usize, '-', Style::UnderlineSecondary, ); @@ -1582,8 +1589,9 @@ impl EmitterWriter { // length of the code to be substituted let snippet_len = span_end_pos as isize - span_start_pos as isize; // For multiple substitutions, use the position *after* the previous - // substitutions have happened. - offset += full_sub_len - snippet_len; + // substitutions have happened, only when further substitutions are + // located strictly after. + offsets.push((span_end_pos, full_sub_len - snippet_len)); } row_num += 1; } diff --git a/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.rs b/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.rs new file mode 100644 index 0000000000000..68aadcf605384 --- /dev/null +++ b/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.rs @@ -0,0 +1,8 @@ +// Regression test for issue #67690 +// Rustc endless loop out-of-memory and consequent SIGKILL in generic new type + +// check-pass +pub type T = P; +//~^ WARN bounds on generic parameters are not enforced in type aliases + +fn main() {} diff --git a/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.stderr b/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.stderr new file mode 100644 index 0000000000000..37b51b50b964e --- /dev/null +++ b/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.stderr @@ -0,0 +1,12 @@ +warning: bounds on generic parameters are not enforced in type aliases + --> $DIR/issue-67690-type-alias-bound-diagnostic-crash.rs:5:15 + | +LL | pub type T = P; + | ^^^^ ^^^^ ^^^^ + | + = note: `#[warn(type_alias_bounds)]` on by default +help: the bound will not be checked when the type alias is used, and should be removed + | +LL | pub type T

= P; + | -- + diff --git a/src/test/ui/type/type-alias-bounds.rs b/src/test/ui/type/type-alias-bounds.rs index 06705a2ebf5dd..65b79650d4d72 100644 --- a/src/test/ui/type/type-alias-bounds.rs +++ b/src/test/ui/type/type-alias-bounds.rs @@ -1,6 +1,6 @@ // Test `ignored_generic_bounds` lint warning about bounds in type aliases. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] use std::rc::Rc; diff --git a/src/test/ui/type/type-alias-bounds.stderr b/src/test/ui/type/type-alias-bounds.stderr index c381d30c64f14..e4d3753f8a59a 100644 --- a/src/test/ui/type/type-alias-bounds.stderr +++ b/src/test/ui/type/type-alias-bounds.stderr @@ -8,7 +8,7 @@ LL | type SVec = Vec; help: the bound will not be checked when the type alias is used, and should be removed | LL | type SVec = Vec; - | -- -- + | -- warning: where clauses are not enforced in type aliases --> $DIR/type-alias-bounds.rs:10:21 @@ -30,7 +30,7 @@ LL | type VVec<'b, 'a: 'b + 'b> = (&'b u32, Vec<&'a i32>); help: the bound will not be checked when the type alias is used, and should be removed | LL | type VVec<'b, 'a> = (&'b u32, Vec<&'a i32>); - | -- -- + | -- warning: bounds on generic parameters are not enforced in type aliases --> $DIR/type-alias-bounds.rs:14:18 @@ -41,7 +41,7 @@ LL | type WVec<'b, T: 'b + 'b> = (&'b u32, Vec); help: the bound will not be checked when the type alias is used, and should be removed | LL | type WVec<'b, T> = (&'b u32, Vec); - | -- -- + | -- warning: where clauses are not enforced in type aliases --> $DIR/type-alias-bounds.rs:16:25 From e2305d0055805effb9d6200f995ad825aa0c56e1 Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Sun, 5 Jan 2020 23:19:42 +0000 Subject: [PATCH 03/17] rustdoc: HTML escape const values --- src/librustdoc/html/format.rs | 17 ++++++++++++++--- src/librustdoc/html/render.rs | 4 ++-- src/test/rustdoc/const-generics/const-impl.rs | 7 +++++++ src/test/rustdoc/show-const-contents.rs | 3 +++ 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 96b841046ff22..9a34b60805b50 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -15,6 +15,7 @@ use rustc::util::nodemap::FxHashSet; use rustc_target::spec::abi::Abi; use crate::clean::{self, PrimitiveType}; +use crate::html::escape::Escape; use crate::html::item_type::ItemType; use crate::html::render::{self, cache, CURRENT_DEPTH}; @@ -314,8 +315,14 @@ impl clean::Lifetime { } impl clean::Constant { - crate fn print(&self) -> &str { - &self.expr + crate fn print(&self) -> impl fmt::Display + '_ { + display_fn(move |f| { + if f.alternate() { + f.write_str(&self.expr) + } else { + write!(f, "{}", Escape(&self.expr)) + } + }) } } @@ -689,7 +696,11 @@ fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter<'_>, use_absolute: bool) -> clean::Array(ref t, ref n) => { primitive_link(f, PrimitiveType::Array, "[")?; fmt::Display::fmt(&t.print(), f)?; - primitive_link(f, PrimitiveType::Array, &format!("; {}]", n)) + if f.alternate() { + primitive_link(f, PrimitiveType::Array, &format!("; {}]", n)) + } else { + primitive_link(f, PrimitiveType::Array, &format!("; {}]", Escape(n))) + } } clean::Never => primitive_link(f, PrimitiveType::Never, "!"), clean::RawPointer(m, ref t) => { diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index ad059463aa43a..24cb8a856b9ce 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -2279,7 +2279,7 @@ fn item_constant(w: &mut Buffer, cx: &Context, it: &clean::Item, c: &clean::Cons ); if c.value.is_some() || c.is_literal { - write!(w, " = {expr};", expr = c.expr); + write!(w, " = {expr};", expr = Escape(&c.expr)); } else { write!(w, ";"); } @@ -2292,7 +2292,7 @@ fn item_constant(w: &mut Buffer, cx: &Context, it: &clean::Item, c: &clean::Cons if value_lowercase != expr_lowercase && value_lowercase.trim_end_matches("i32") != expr_lowercase { - write!(w, " // {value}", value = value); + write!(w, " // {value}", value = Escape(value)); } } } diff --git a/src/test/rustdoc/const-generics/const-impl.rs b/src/test/rustdoc/const-generics/const-impl.rs index 819adfeb9c775..7361b22b74798 100644 --- a/src/test/rustdoc/const-generics/const-impl.rs +++ b/src/test/rustdoc/const-generics/const-impl.rs @@ -30,3 +30,10 @@ impl VSet { Self { inner: Vec::new() } } } + +pub struct Escape; + +// @has foo/struct.Escape.html '//h3[@id="impl"]/code' 'impl Escape<{ r#""# }>' +impl Escape<{ r#""# }> { + pub fn f() {} +} diff --git a/src/test/rustdoc/show-const-contents.rs b/src/test/rustdoc/show-const-contents.rs index 6d95f7827a1d7..e84f6e52c75aa 100644 --- a/src/test/rustdoc/show-const-contents.rs +++ b/src/test/rustdoc/show-const-contents.rs @@ -62,3 +62,6 @@ macro_rules! int_module { // @has show_const_contents/constant.MIN.html '= i16::min_value(); // -32_768i16' int_module!(i16); + +// @has show_const_contents/constant.ESCAPE.html //pre '= r#""#;' +pub const ESCAPE: &str = r#""#; From 8f94d9bb0828a2dfcc1dd3258de7775b9bae2cc8 Mon Sep 17 00:00:00 2001 From: varkor Date: Mon, 6 Jan 2020 00:11:27 +0000 Subject: [PATCH 04/17] Fix ICE in const pretty printing and resolve FIXME Consts now have a `fmt::Display` impl, so we can just use that to pretty-print. --- src/librustc/ty/print/obsolete.rs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/librustc/ty/print/obsolete.rs b/src/librustc/ty/print/obsolete.rs index 7c3579d59205e..f5b0090a8aae1 100644 --- a/src/librustc/ty/print/obsolete.rs +++ b/src/librustc/ty/print/obsolete.rs @@ -165,19 +165,12 @@ impl DefPathBasedNames<'tcx> { } // Pushes the the name of the specified const to the provided string. - // If `debug` is true, usually-unprintable consts (such as `Infer`) will be printed, - // as well as the unprintable types of constants (see `push_type_name` for more details). - pub fn push_const_name(&self, c: &Const<'tcx>, output: &mut String, debug: bool) { - if let ty::ConstKind::Value(_) = c.val { - // FIXME(const_generics): we could probably do a better job here. - write!(output, "{:?}", c).unwrap() - } else if debug { - write!(output, "{:?}", c).unwrap() - } else { - bug!("DefPathBasedNames: trying to create const name for unexpected const: {:?}", c,); - } + // If `debug` is true, the unprintable types of constants will be printed with `fmt::Debug` + // (see `push_type_name` for more details). + pub fn push_const_name(&self, ct: &Const<'tcx>, output: &mut String, debug: bool) { + write!(output, "{}", ct).unwrap(); output.push_str(": "); - self.push_type_name(c.ty, output, debug); + self.push_type_name(ct.ty, output, debug); } pub fn push_def_path(&self, def_id: DefId, output: &mut String) { From e6d95ce0b88bddd9cbb54bd272ba7c48601ba7a0 Mon Sep 17 00:00:00 2001 From: Grachev Mikhail Date: Mon, 6 Jan 2020 15:18:03 +0300 Subject: [PATCH 05/17] Formatting an example for method Vec.retain --- src/liballoc/vec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 93a51ccb20737..e3e6d950953a7 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1054,7 +1054,7 @@ impl Vec { /// /// ``` /// let mut vec = vec![1, 2, 3, 4]; - /// vec.retain(|&x| x%2 == 0); + /// vec.retain(|&x| x % 2 == 0); /// assert_eq!(vec, [2, 4]); /// ``` /// From 24c6cd80c3b44c5c9a33733e2524afb3e015ee92 Mon Sep 17 00:00:00 2001 From: dylan_DPC Date: Mon, 30 Dec 2019 17:29:03 +0530 Subject: [PATCH 06/17] stabilise remove_item --- src/liballoc/vec.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index a27a13847d6a2..73c310bb2bfed 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1696,7 +1696,6 @@ impl Vec { /// # Examples /// /// ``` - /// # #![feature(vec_remove_item)] /// let mut vec = vec![1, 2, 3, 1]; /// /// vec.remove_item(&1); From 0a739ce0a5200f2d1360fef126a93b5c1e8205ba Mon Sep 17 00:00:00 2001 From: dylan_DPC Date: Mon, 30 Dec 2019 17:57:00 +0530 Subject: [PATCH 07/17] remove usage of feature gate --- src/librustc/lib.rs | 1 - src/librustdoc/lib.rs | 1 - src/tools/compiletest/src/main.rs | 1 - 3 files changed, 3 deletions(-) diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index ce8263f81a72f..37761c17f5243 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -50,7 +50,6 @@ #![feature(thread_local)] #![feature(trace_macros)] #![feature(trusted_len)] -#![feature(vec_remove_item)] #![feature(stmt_expr_attributes)] #![feature(integer_atomics)] #![feature(test)] diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index c8a32306194df..2effbdaec6b5d 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -10,7 +10,6 @@ #![feature(nll)] #![feature(set_stdio)] #![feature(test)] -#![feature(vec_remove_item)] #![feature(ptr_offset_from)] #![feature(crate_visibility_modifier)] #![feature(const_fn)] diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index 487c1d5fb93a6..da1e3760e010d 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -1,6 +1,5 @@ #![crate_name = "compiletest"] #![feature(test)] -#![feature(vec_remove_item)] #![deny(warnings)] extern crate test; From 99fda5c1cec9ab67c3da197b5679408d2e51d093 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 6 Jan 2020 15:28:12 +0100 Subject: [PATCH 08/17] Clean up E0178 explanation --- src/librustc_error_codes/error_codes/E0178.md | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0178.md b/src/librustc_error_codes/error_codes/E0178.md index 07980ad83f1b5..0c6f918632f47 100644 --- a/src/librustc_error_codes/error_codes/E0178.md +++ b/src/librustc_error_codes/error_codes/E0178.md @@ -1,16 +1,27 @@ -In types, the `+` type operator has low precedence, so it is often necessary -to use parentheses. +The `+` type operator was used in an ambiguous context. -For example: +Erroneous code example: ```compile_fail,E0178 trait Foo {} struct Bar<'a> { - w: &'a Foo + Copy, // error, use &'a (Foo + Copy) - x: &'a Foo + 'a, // error, use &'a (Foo + 'a) - y: &'a mut Foo + 'a, // error, use &'a mut (Foo + 'a) - z: fn() -> Foo + 'a, // error, use fn() -> (Foo + 'a) + x: &'a Foo + 'a, // error! + y: &'a mut Foo + 'a, // error! + z: fn() -> Foo + 'a, // error! +} +``` + +In types, the `+` type operator has low precedence, so it is often necessary +to use parentheses: + +``` +trait Foo {} + +struct Bar<'a> { + x: &'a (Foo + 'a), // ok! + y: &'a mut (Foo + 'a), // ok! + z: fn() -> (Foo + 'a), // ok! } ``` From a7727c59ac0b80fbbd7b3ab045260727ab64ce21 Mon Sep 17 00:00:00 2001 From: Andy Russell Date: Mon, 6 Jan 2020 09:51:23 -0500 Subject: [PATCH 09/17] fire "non_camel_case_types" for associated types --- src/librustc_lint/nonstandard_style.rs | 6 ++++++ src/test/ui/issues/issue-17732.rs | 1 + src/test/ui/issues/issue-35600.rs | 2 ++ src/test/ui/lint/lint-non-camel-case-types.rs | 1 + src/test/ui/lint/lint-non-camel-case-types.stderr | 10 ++++++++-- 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/librustc_lint/nonstandard_style.rs b/src/librustc_lint/nonstandard_style.rs index a97061c50ae45..524de2cf40a83 100644 --- a/src/librustc_lint/nonstandard_style.rs +++ b/src/librustc_lint/nonstandard_style.rs @@ -142,6 +142,12 @@ impl EarlyLintPass for NonCamelCaseTypes { } } + fn check_trait_item(&mut self, cx: &EarlyContext<'_>, it: &ast::AssocItem) { + if let ast::AssocItemKind::TyAlias(..) = it.kind { + self.check_case(cx, "associated type", &it.ident); + } + } + fn check_variant(&mut self, cx: &EarlyContext<'_>, v: &ast::Variant) { self.check_case(cx, "variant", &v.ident); } diff --git a/src/test/ui/issues/issue-17732.rs b/src/test/ui/issues/issue-17732.rs index 5e11fc4fcfb58..8f63d5baef875 100644 --- a/src/test/ui/issues/issue-17732.rs +++ b/src/test/ui/issues/issue-17732.rs @@ -1,5 +1,6 @@ // check-pass #![allow(dead_code)] +#![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 trait Person { diff --git a/src/test/ui/issues/issue-35600.rs b/src/test/ui/issues/issue-35600.rs index 9d74726d279e5..f0bab6010d724 100644 --- a/src/test/ui/issues/issue-35600.rs +++ b/src/test/ui/issues/issue-35600.rs @@ -1,5 +1,7 @@ // run-pass +#![allow(non_camel_case_types)] #![allow(unused_variables)] + trait Foo { type bar; fn bar(); diff --git a/src/test/ui/lint/lint-non-camel-case-types.rs b/src/test/ui/lint/lint-non-camel-case-types.rs index d3b119a944109..acd5c5df9e8f6 100644 --- a/src/test/ui/lint/lint-non-camel-case-types.rs +++ b/src/test/ui/lint/lint-non-camel-case-types.rs @@ -23,6 +23,7 @@ enum Foo5 { } trait foo6 { //~ ERROR trait `foo6` should have an upper camel case name + type foo7; //~ ERROR associated type `foo7` should have an upper camel case name fn dummy(&self) { } } diff --git a/src/test/ui/lint/lint-non-camel-case-types.stderr b/src/test/ui/lint/lint-non-camel-case-types.stderr index 177f8c8fe9b63..f82eefed4368a 100644 --- a/src/test/ui/lint/lint-non-camel-case-types.stderr +++ b/src/test/ui/lint/lint-non-camel-case-types.stderr @@ -46,11 +46,17 @@ error: trait `foo6` should have an upper camel case name LL | trait foo6 { | ^^^^ help: convert the identifier to upper camel case (notice the capitalization): `Foo6` +error: associated type `foo7` should have an upper camel case name + --> $DIR/lint-non-camel-case-types.rs:26:10 + | +LL | type foo7; + | ^^^^ help: convert the identifier to upper camel case (notice the capitalization): `Foo7` + error: type parameter `ty` should have an upper camel case name - --> $DIR/lint-non-camel-case-types.rs:29:6 + --> $DIR/lint-non-camel-case-types.rs:30:6 | LL | fn f(_: ty) {} | ^^ help: convert the identifier to upper camel case: `Ty` -error: aborting due to 8 previous errors +error: aborting due to 9 previous errors From 6bec8e997270bed18546b350336d88879b91ff78 Mon Sep 17 00:00:00 2001 From: dylan_DPC Date: Mon, 6 Jan 2020 20:37:49 +0530 Subject: [PATCH 10/17] stabilise it --- src/liballoc/vec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 73c310bb2bfed..bc0cd6eff3708 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1702,7 +1702,7 @@ impl Vec { /// /// assert_eq!(vec, vec![2, 3, 1]); /// ``` - #[unstable(feature = "vec_remove_item", reason = "recently added", issue = "40062")] + #[stable(feature = "vec_remove_item", since = "1.42.0")] pub fn remove_item(&mut self, item: &V) -> Option where T: PartialEq, From d9a7db901e33940cb2ccda6afe21b9916e66d9d2 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Mon, 23 Dec 2019 12:54:54 -0500 Subject: [PATCH 11/17] Add an unstable conversion from thread ID to u64 We see multiple cases inside rustc and ecosystem code where ThreadId is transmuted to u64, exploiting the underlying detail. This is suboptimal (can break unexpectedly if we change things in std). It is unlikely that ThreadId will ever need to be larger than u64 -- creating even 2^32 threads over the course of a program is quite hard, 2^64 is even harder. As such, we do not choose to return a larger sized type (e.g. u128). If we choose to shrink ThreadId in the future, or otherwise change its internals, it is likely that a mapping to u64 will still be applicable (though may become more complex). --- src/libstd/thread/mod.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index b17418911380d..0dc43c7e6510a 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -1072,6 +1072,19 @@ impl ThreadId { ThreadId(NonZeroU64::new(id).unwrap()) } } + + /// This returns a numeric identifier for the thread identified by this + /// `ThreadId`. + /// + /// As noted in the documentation for the type itself, it is essentially an + /// opaque ID, but is guaranteed to be unique for each thread. The returned + /// value is entirely opaque -- only equality testing is stable. Note that + /// it is not guaranteed which values new threads will return, and this may + /// change across Rust versions. + #[unstable(feature = "thread_id_value", issue = "67939")] + pub fn as_u64(&self) -> u64 { + self.0.get() + } } //////////////////////////////////////////////////////////////////////////////// From 0113cacda2d08c135603bcb83da393252317e6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Str=C3=B8mberg?= Date: Mon, 6 Jan 2020 17:25:17 +0100 Subject: [PATCH 12/17] Missing module std in example. --- src/libstd/net/tcp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs index c33f98bdd8329..dd25d66658c3c 100644 --- a/src/libstd/net/tcp.rs +++ b/src/libstd/net/tcp.rs @@ -70,7 +70,7 @@ pub struct TcpStream(net_imp::TcpStream); /// // ... /// } /// -/// fn main() -> io::Result<()> { +/// fn main() -> std::io::Result<()> { /// let listener = TcpListener::bind("127.0.0.1:80")?; /// /// // accept connections and process them serially From a852941829dc835e9fb0f59b2c1e19aa1439211d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Str=C3=B8mberg?= Date: Mon, 6 Jan 2020 17:38:41 +0100 Subject: [PATCH 13/17] Removed module usage. --- src/libstd/net/tcp.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs index dd25d66658c3c..5023d69240893 100644 --- a/src/libstd/net/tcp.rs +++ b/src/libstd/net/tcp.rs @@ -63,7 +63,6 @@ pub struct TcpStream(net_imp::TcpStream); /// # Examples /// /// ```no_run -/// # use std::io; /// use std::net::{TcpListener, TcpStream}; /// /// fn handle_client(stream: TcpStream) { From 503d06b90dfd8f6055c586c488dbd3a741e9f0c2 Mon Sep 17 00:00:00 2001 From: dylan_DPC Date: Mon, 6 Jan 2020 23:28:47 +0530 Subject: [PATCH 14/17] oh the one that was left behind --- src/liballoc/tests/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs index c1ae67a1a339f..3fdee8bbfdf10 100644 --- a/src/liballoc/tests/lib.rs +++ b/src/liballoc/tests/lib.rs @@ -11,7 +11,6 @@ #![feature(associated_type_bounds)] #![feature(binary_heap_into_iter_sorted)] #![feature(binary_heap_drain_sorted)] -#![feature(vec_remove_item)] use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; From 9462c8babb8743a12ffa467dfc10f7b03a2f77c8 Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Sun, 5 Jan 2020 15:01:00 +0000 Subject: [PATCH 15/17] Improve hygiene of `newtype_index` Also add unit tests --- src/librustc/dep_graph/serialized.rs | 2 +- src/librustc/middle/region.rs | 1 - src/librustc_hir/hir_id.rs | 1 - src/librustc_index/vec.rs | 43 ++++++++-------- src/librustc_index/vec/tests.rs | 51 +++++++++++++++++++ .../borrow_check/constraints/mod.rs | 2 +- .../borrow_check/member_constraints.rs | 2 +- .../type_check/liveness/local_use_map.rs | 2 +- src/librustc_mir/dataflow/impls/borrows.rs | 2 +- src/librustc_mir/dataflow/move_paths/mod.rs | 2 +- src/librustc_session/node_id.rs | 1 - src/librustc_span/symbol.rs | 1 - src/test/ui-fulldeps/newtype_index.rs | 22 -------- 13 files changed, 80 insertions(+), 52 deletions(-) create mode 100644 src/librustc_index/vec/tests.rs delete mode 100644 src/test/ui-fulldeps/newtype_index.rs diff --git a/src/librustc/dep_graph/serialized.rs b/src/librustc/dep_graph/serialized.rs index 640877d3d55c3..45ef52dbf39c2 100644 --- a/src/librustc/dep_graph/serialized.rs +++ b/src/librustc/dep_graph/serialized.rs @@ -2,7 +2,7 @@ use crate::dep_graph::DepNode; use crate::ich::Fingerprint; -use rustc_index::vec::{Idx, IndexVec}; +use rustc_index::vec::IndexVec; rustc_index::newtype_index! { pub struct SerializedDepNodeIndex { .. } diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index b2a5efca92df3..9e9c8bd846473 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -14,7 +14,6 @@ use rustc_hir::Node; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; -use rustc_index::vec::Idx; use rustc_macros::HashStable; use rustc_span::{Span, DUMMY_SP}; diff --git a/src/librustc_hir/hir_id.rs b/src/librustc_hir/hir_id.rs index 462946411718b..6d2ec44576353 100644 --- a/src/librustc_hir/hir_id.rs +++ b/src/librustc_hir/hir_id.rs @@ -56,7 +56,6 @@ impl fmt::Display for HirId { rustc_data_structures::define_id_collections!(HirIdMap, HirIdSet, HirId); rustc_data_structures::define_id_collections!(ItemLocalMap, ItemLocalSet, ItemLocalId); -use rustc_index::vec::Idx; rustc_index::newtype_index! { /// An `ItemLocalId` uniquely identifies something within a given "item-like"; /// that is, within a `hir::Item`, `hir::TraitItem`, or `hir::ImplItem`. There is no diff --git a/src/librustc_index/vec.rs b/src/librustc_index/vec.rs index 1f6a330cdc235..d14bafb44fd5b 100644 --- a/src/librustc_index/vec.rs +++ b/src/librustc_index/vec.rs @@ -120,13 +120,13 @@ macro_rules! newtype_index { impl $type { $v const MAX_AS_U32: u32 = $max; - $v const MAX: $type = $type::from_u32_const($max); + $v const MAX: Self = Self::from_u32_const($max); #[inline] $v fn from_usize(value: usize) -> Self { assert!(value <= ($max as usize)); unsafe { - $type::from_u32_unchecked(value as u32) + Self::from_u32_unchecked(value as u32) } } @@ -134,7 +134,7 @@ macro_rules! newtype_index { $v fn from_u32(value: u32) -> Self { assert!(value <= $max); unsafe { - $type::from_u32_unchecked(value) + Self::from_u32_unchecked(value) } } @@ -152,13 +152,13 @@ macro_rules! newtype_index { ]; unsafe { - $type { private: value } + Self { private: value } } } #[inline] $v const unsafe fn from_u32_unchecked(value: u32) -> Self { - $type { private: value } + Self { private: value } } /// Extracts the value of this index as an integer. @@ -184,14 +184,14 @@ macro_rules! newtype_index { type Output = Self; fn add(self, other: usize) -> Self { - Self::new(self.index() + other) + Self::from_usize(self.index() + other) } } - impl Idx for $type { + impl $crate::vec::Idx for $type { #[inline] fn new(value: usize) -> Self { - Self::from(value) + Self::from_usize(value) } #[inline] @@ -204,39 +204,39 @@ macro_rules! newtype_index { #[inline] fn steps_between(start: &Self, end: &Self) -> Option { ::steps_between( - &Idx::index(*start), - &Idx::index(*end), + &Self::index(*start), + &Self::index(*end), ) } #[inline] fn replace_one(&mut self) -> Self { - ::std::mem::replace(self, Self::new(1)) + ::std::mem::replace(self, Self::from_u32(1)) } #[inline] fn replace_zero(&mut self) -> Self { - ::std::mem::replace(self, Self::new(0)) + ::std::mem::replace(self, Self::from_u32(0)) } #[inline] fn add_one(&self) -> Self { - Self::new(Idx::index(*self) + 1) + Self::from_usize(Self::index(*self) + 1) } #[inline] fn sub_one(&self) -> Self { - Self::new(Idx::index(*self) - 1) + Self::from_usize(Self::index(*self) - 1) } #[inline] fn add_usize(&self, u: usize) -> Option { - Idx::index(*self).checked_add(u).map(Self::new) + Self::index(*self).checked_add(u).map(Self::from_usize) } #[inline] fn sub_usize(&self, u: usize) -> Option { - Idx::index(*self).checked_sub(u).map(Self::new) + Self::index(*self).checked_sub(u).map(Self::from_usize) } } @@ -257,14 +257,14 @@ macro_rules! newtype_index { impl From for $type { #[inline] fn from(value: usize) -> Self { - $type::from_usize(value) + Self::from_usize(value) } } impl From for $type { #[inline] fn from(value: u32) -> Self { - $type::from_u32(value) + Self::from_u32(value) } } @@ -409,7 +409,7 @@ macro_rules! newtype_index { (@decodable $type:ident) => ( impl ::rustc_serialize::Decodable for $type { fn decode(d: &mut D) -> Result { - d.read_u32().map(Self::from) + d.read_u32().map(Self::from_u32) } } ); @@ -500,7 +500,7 @@ macro_rules! newtype_index { const $name:ident = $constant:expr, $($tokens:tt)*) => ( $(#[doc = $doc])* - pub const $name: $type = $type::from_u32_const($constant); + $v const $name: $type = $type::from_u32_const($constant); $crate::newtype_index!( @derives [$($derives,)*] @attrs [$(#[$attrs])*] @@ -839,3 +839,6 @@ impl FnMut<(usize,)> for IntoIdx { I::new(n) } } + +#[cfg(test)] +mod tests; diff --git a/src/librustc_index/vec/tests.rs b/src/librustc_index/vec/tests.rs new file mode 100644 index 0000000000000..15c43c72c7b37 --- /dev/null +++ b/src/librustc_index/vec/tests.rs @@ -0,0 +1,51 @@ +#![allow(dead_code)] +newtype_index!(struct MyIdx { MAX = 0xFFFF_FFFA }); + +#[test] +fn index_size_is_optimized() { + use std::mem::size_of; + + assert_eq!(size_of::(), 4); + // Uses 0xFFFF_FFFB + assert_eq!(size_of::>(), 4); + // Uses 0xFFFF_FFFC + assert_eq!(size_of::>>(), 4); + // Uses 0xFFFF_FFFD + assert_eq!(size_of::>>>(), 4); + // Uses 0xFFFF_FFFE + assert_eq!(size_of::>>>>(), 4); + // Uses 0xFFFF_FFFF + assert_eq!(size_of::>>>>>(), 4); + // Uses a tag + assert_eq!(size_of::>>>>>>(), 8); +} + +#[test] +fn range_iterator_iterates_forwards() { + let range = MyIdx::from_u32(1)..MyIdx::from_u32(4); + assert_eq!( + range.collect::>(), + [MyIdx::from_u32(1), MyIdx::from_u32(2), MyIdx::from_u32(3)] + ); +} + +#[test] +fn range_iterator_iterates_backwards() { + let range = MyIdx::from_u32(1)..MyIdx::from_u32(4); + assert_eq!( + range.rev().collect::>(), + [MyIdx::from_u32(3), MyIdx::from_u32(2), MyIdx::from_u32(1)] + ); +} + +#[test] +fn range_count_is_correct() { + let range = MyIdx::from_u32(1)..MyIdx::from_u32(4); + assert_eq!(range.count(), 3); +} + +#[test] +fn range_size_hint_is_correct() { + let range = MyIdx::from_u32(1)..MyIdx::from_u32(4); + assert_eq!(range.size_hint(), (3, Some(3))); +} diff --git a/src/librustc_mir/borrow_check/constraints/mod.rs b/src/librustc_mir/borrow_check/constraints/mod.rs index 48defecd28cb0..ef70b127ac5bd 100644 --- a/src/librustc_mir/borrow_check/constraints/mod.rs +++ b/src/librustc_mir/borrow_check/constraints/mod.rs @@ -1,7 +1,7 @@ use rustc::mir::ConstraintCategory; use rustc::ty::RegionVid; use rustc_data_structures::graph::scc::Sccs; -use rustc_index::vec::{Idx, IndexVec}; +use rustc_index::vec::IndexVec; use std::fmt; use std::ops::Index; diff --git a/src/librustc_mir/borrow_check/member_constraints.rs b/src/librustc_mir/borrow_check/member_constraints.rs index 53fa5b1269849..c95919685bbc7 100644 --- a/src/librustc_mir/borrow_check/member_constraints.rs +++ b/src/librustc_mir/borrow_check/member_constraints.rs @@ -2,7 +2,7 @@ use crate::rustc::ty::{self, Ty}; use rustc::infer::region_constraints::MemberConstraint; use rustc_data_structures::fx::FxHashMap; use rustc_hir::def_id::DefId; -use rustc_index::vec::{Idx, IndexVec}; +use rustc_index::vec::IndexVec; use rustc_span::Span; use std::hash::Hash; use std::ops::Index; diff --git a/src/librustc_mir/borrow_check/type_check/liveness/local_use_map.rs b/src/librustc_mir/borrow_check/type_check/liveness/local_use_map.rs index 7bf355ddbf612..8155aa0ee000a 100644 --- a/src/librustc_mir/borrow_check/type_check/liveness/local_use_map.rs +++ b/src/librustc_mir/borrow_check/type_check/liveness/local_use_map.rs @@ -1,7 +1,7 @@ use rustc::mir::visit::{PlaceContext, Visitor}; use rustc::mir::{Local, Location, ReadOnlyBodyAndCache}; use rustc_data_structures::vec_linked_list as vll; -use rustc_index::vec::{Idx, IndexVec}; +use rustc_index::vec::IndexVec; use crate::util::liveness::{categorize, DefUse}; diff --git a/src/librustc_mir/dataflow/impls/borrows.rs b/src/librustc_mir/dataflow/impls/borrows.rs index 30eccebd3315f..8d51cb2391234 100644 --- a/src/librustc_mir/dataflow/impls/borrows.rs +++ b/src/librustc_mir/dataflow/impls/borrows.rs @@ -4,7 +4,7 @@ use rustc::ty::{self, TyCtxt}; use rustc_data_structures::fx::FxHashMap; use rustc_index::bit_set::BitSet; -use rustc_index::vec::{Idx, IndexVec}; +use rustc_index::vec::IndexVec; use crate::borrow_check::{ places_conflict, BorrowData, BorrowSet, PlaceConflictBias, PlaceExt, RegionInferenceContext, diff --git a/src/librustc_mir/dataflow/move_paths/mod.rs b/src/librustc_mir/dataflow/move_paths/mod.rs index 6450762d351b1..e5cddaf6c66f2 100644 --- a/src/librustc_mir/dataflow/move_paths/mod.rs +++ b/src/librustc_mir/dataflow/move_paths/mod.rs @@ -2,7 +2,7 @@ use core::slice::Iter; use rustc::mir::*; use rustc::ty::{ParamEnv, Ty, TyCtxt}; use rustc_data_structures::fx::FxHashMap; -use rustc_index::vec::{Enumerated, Idx, IndexVec}; +use rustc_index::vec::{Enumerated, IndexVec}; use rustc_span::Span; use smallvec::SmallVec; diff --git a/src/librustc_session/node_id.rs b/src/librustc_session/node_id.rs index 5e51c5a92ccc4..9fefe908e578e 100644 --- a/src/librustc_session/node_id.rs +++ b/src/librustc_session/node_id.rs @@ -1,4 +1,3 @@ -use rustc_index::vec::Idx; use rustc_serialize::{Decoder, Encoder}; use rustc_span::ExpnId; use std::fmt; diff --git a/src/librustc_span/symbol.rs b/src/librustc_span/symbol.rs index fea72744d31e4..40abc8b2179b8 100644 --- a/src/librustc_span/symbol.rs +++ b/src/librustc_span/symbol.rs @@ -5,7 +5,6 @@ use arena::DroplessArena; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey}; -use rustc_index::vec::Idx; use rustc_macros::{symbols, HashStable_Generic}; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use rustc_serialize::{UseSpecializedDecodable, UseSpecializedEncodable}; diff --git a/src/test/ui-fulldeps/newtype_index.rs b/src/test/ui-fulldeps/newtype_index.rs deleted file mode 100644 index fe68b394e5a5c..0000000000000 --- a/src/test/ui-fulldeps/newtype_index.rs +++ /dev/null @@ -1,22 +0,0 @@ -// run-pass - -#![feature(rustc_private)] - -extern crate rustc_index; -extern crate serialize as rustc_serialize; - -use rustc_index::{newtype_index, vec::Idx}; - -newtype_index!(struct MyIdx { MAX = 0xFFFF_FFFA }); - -use std::mem::size_of; - -fn main() { - assert_eq!(size_of::(), 4); - assert_eq!(size_of::>(), 4); - assert_eq!(size_of::>>(), 4); - assert_eq!(size_of::>>>(), 4); - assert_eq!(size_of::>>>>(), 4); - assert_eq!(size_of::>>>>>(), 4); - assert_eq!(size_of::>>>>>>(), 8); -} From 2905f14b67def26ef003bf224886453cd20bf49a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Fri, 27 Dec 2019 20:09:33 -0800 Subject: [PATCH 16/17] Account for `type X = impl Trait;` in lifetime suggestion --- .../borrow_check/diagnostics/region_errors.rs | 11 ++++++++--- .../multiple-lifetimes/error-handling.stderr | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/librustc_mir/borrow_check/diagnostics/region_errors.rs b/src/librustc_mir/borrow_check/diagnostics/region_errors.rs index 8d534b6ec8e8e..1a1cf578f6021 100644 --- a/src/librustc_mir/borrow_check/diagnostics/region_errors.rs +++ b/src/librustc_mir/borrow_check/diagnostics/region_errors.rs @@ -800,7 +800,7 @@ impl<'tcx> RegionInferenceContext<'tcx> { // If there is a static predicate, then the only sensible suggestion is to replace // fr with `'static`. if has_static_predicate { - diag.help(&format!("consider replacing `{}` with `{}`", fr_name, static_str,)); + diag.help(&format!("consider replacing `{}` with `{}`", fr_name, static_str)); } else { // Otherwise, we should suggest adding a constraint on the return type. let span = infcx.tcx.def_span(*did); @@ -810,7 +810,12 @@ impl<'tcx> RegionInferenceContext<'tcx> { } else { "'_".to_string() }; - + let suggestion = if snippet.ends_with(";") { + // `type X = impl Trait;` + format!("{} + {};", &snippet[..snippet.len() - 1], suggestable_fr_name) + } else { + format!("{} + {}", snippet, suggestable_fr_name) + }; diag.span_suggestion( span, &format!( @@ -818,7 +823,7 @@ impl<'tcx> RegionInferenceContext<'tcx> { `{}`, add `{}` as a bound", fr_name, suggestable_fr_name, ), - format!("{} + {}", snippet, suggestable_fr_name), + suggestion, Applicability::MachineApplicable, ); } diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr index 4c38f0a8a914d..5957ecbdc5faa 100644 --- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr +++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr @@ -7,7 +7,7 @@ LL | fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> { = help: consider replacing `'a` with `'static` help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a bound | -LL | type E<'a, 'b> = impl Sized; + 'a +LL | type E<'a, 'b> = impl Sized + 'a; | error: aborting due to previous error From 518f50c2857e7941852ef2c669c841108a2fbc75 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 6 Jan 2020 19:07:18 -0800 Subject: [PATCH 17/17] Update books --- src/doc/book | 2 +- src/doc/edition-guide | 2 +- src/doc/embedded-book | 2 +- src/doc/nomicon | 2 +- src/doc/reference | 2 +- src/doc/rust-by-example | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/doc/book b/src/doc/book index ef8bb568035de..5c5cfd2e94cd4 160000 --- a/src/doc/book +++ b/src/doc/book @@ -1 +1 @@ -Subproject commit ef8bb568035ded8ddfa30a9309026638cc3c8136 +Subproject commit 5c5cfd2e94cd42632798d9bd3d1116133e128ac9 diff --git a/src/doc/edition-guide b/src/doc/edition-guide index 6601cab466659..1a2390247ad6d 160000 --- a/src/doc/edition-guide +++ b/src/doc/edition-guide @@ -1 +1 @@ -Subproject commit 6601cab4666596494a569f94aa63b7b3230e9769 +Subproject commit 1a2390247ad6d08160e0dd74f40a01a9578659c2 diff --git a/src/doc/embedded-book b/src/doc/embedded-book index c262349302822..9493b7d4dc97e 160000 --- a/src/doc/embedded-book +++ b/src/doc/embedded-book @@ -1 +1 @@ -Subproject commit c26234930282210849256e4ecab925f0f2daf3be +Subproject commit 9493b7d4dc97eda439bd8780f05ad7b234cd1cd7 diff --git a/src/doc/nomicon b/src/doc/nomicon index 8be35b201f9cf..3e6e1001dc6e0 160000 --- a/src/doc/nomicon +++ b/src/doc/nomicon @@ -1 +1 @@ -Subproject commit 8be35b201f9cf0a4c3fcc96c83ac21671dcf3112 +Subproject commit 3e6e1001dc6e095dbd5c88005e80969f60e384e1 diff --git a/src/doc/reference b/src/doc/reference index d8dfe1b005c03..e1157538e86d8 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit d8dfe1b005c03584cd7adc4bfb72b005e7e84744 +Subproject commit e1157538e86d83df0cf95d5e33bd943f80d0248f diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example index b7ac1bc76b7d0..1d59403cb5269 160000 --- a/src/doc/rust-by-example +++ b/src/doc/rust-by-example @@ -1 +1 @@ -Subproject commit b7ac1bc76b7d02a43c83b3a931d226f708aa1ff4 +Subproject commit 1d59403cb5269c190cc52a95584ecc280345495a