From 2545867b4142fefbf980b976c9bc416d4e89bf85 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Fri, 12 Apr 2019 05:18:36 +0000 Subject: [PATCH 1/4] Re-export core::str::{EscapeDebug, EscapeDefault, EscapeUnicode} in std --- src/liballoc/str.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index a36804bddff..f10a01d44c8 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -68,6 +68,8 @@ pub use core::str::pattern; pub use core::str::EncodeUtf16; #[stable(feature = "split_ascii_whitespace", since = "1.34.0")] pub use core::str::SplitAsciiWhitespace; +#[stable(feature = "str_escape", since = "1.34.0")] +pub use core::str::{EscapeDebug, EscapeDefault, EscapeUnicode}; #[unstable(feature = "slice_concat_ext", reason = "trait should not have to exist", From 64dc041511852441ebc071c6fdf1e110e80b7b97 Mon Sep 17 00:00:00 2001 From: Marc Date: Mon, 15 Apr 2019 13:19:38 +1200 Subject: [PATCH 2/4] Remove collection-specific `with_capacity` doc from `std::collections` Fixes #59931 --- src/libstd/collections/mod.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libstd/collections/mod.rs b/src/libstd/collections/mod.rs index 286ce2d389b..15c2532f8b4 100644 --- a/src/libstd/collections/mod.rs +++ b/src/libstd/collections/mod.rs @@ -150,10 +150,9 @@ //! Any `with_capacity` constructor will instruct the collection to allocate //! enough space for the specified number of elements. Ideally this will be for //! exactly that many elements, but some implementation details may prevent -//! this. [`Vec`] and [`VecDeque`] can be relied on to allocate exactly the -//! requested amount, though. Use `with_capacity` when you know exactly how many -//! elements will be inserted, or at least have a reasonable upper-bound on that -//! number. +//! this. See collection-specific documentation for details. In general, use +//! `with_capacity` when you know exactly how many elements will be inserted, or +//! at least have a reasonable upper-bound on that number. //! //! When anticipating a large influx of elements, the `reserve` family of //! methods can be used to hint to the collection how much room it should make From dbbf87583b24284af95425d2dccb6236440d86b0 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Wed, 17 Apr 2019 22:07:13 +1200 Subject: [PATCH 3/4] Remove nrc from toolstate pings --- src/tools/publish_toolstate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/publish_toolstate.py b/src/tools/publish_toolstate.py index 93d7aa5c1ec..7d359fdcaca 100755 --- a/src/tools/publish_toolstate.py +++ b/src/tools/publish_toolstate.py @@ -16,8 +16,8 @@ except ImportError: MAINTAINERS = { 'miri': '@oli-obk @RalfJung @eddyb', 'clippy-driver': '@Manishearth @llogiq @mcarton @oli-obk @phansch', - 'rls': '@nrc @Xanewok', - 'rustfmt': '@nrc @topecongiro', + 'rls': '@Xanewok', + 'rustfmt': '@topecongiro', 'book': '@carols10cents @steveklabnik', 'nomicon': '@frewsxcv @Gankro', 'reference': '@steveklabnik @Havvy @matthewjasper @ehuss', From 5f7055988b52e61040130a1f0747440a3a249467 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Wed, 17 Apr 2019 13:19:58 +0300 Subject: [PATCH 4/4] Resolve inconsistency in error messages between "parameter" and "variable". --- src/librustc_resolve/lib.rs | 4 ++-- src/test/ui/bad/bad-type-env-capture.stderr | 2 +- .../ui/const-generics/const-param-from-outer-fn.stderr | 2 +- src/test/ui/error-codes/E0401.stderr | 4 ++-- src/test/ui/inner-static-type-parameter.stderr | 2 +- src/test/ui/issues/issue-3021-c.stderr | 4 ++-- src/test/ui/issues/issue-3214.stderr | 2 +- src/test/ui/issues/issue-5997-enum.stderr | 2 +- src/test/ui/issues/issue-5997-struct.stderr | 2 +- src/test/ui/nested-ty-params.stderr | 4 ++-- .../ui/resolve/resolve-type-param-in-item-in-trait.stderr | 8 ++++---- src/test/ui/type/type-arg-out-of-scope.stderr | 4 ++-- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 864fc2ebaec..83416eaa062 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -234,12 +234,12 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver<'_>, }, Def::TyParam(def_id) => { if let Some(span) = resolver.definitions.opt_span(def_id) { - err.span_label(span, "type variable from outer function"); + err.span_label(span, "type parameter from outer function"); } } Def::ConstParam(def_id) => { if let Some(span) = resolver.definitions.opt_span(def_id) { - err.span_label(span, "const variable from outer function"); + err.span_label(span, "const parameter from outer function"); } } _ => { diff --git a/src/test/ui/bad/bad-type-env-capture.stderr b/src/test/ui/bad/bad-type-env-capture.stderr index a459c00634a..6f24c0d8699 100644 --- a/src/test/ui/bad/bad-type-env-capture.stderr +++ b/src/test/ui/bad/bad-type-env-capture.stderr @@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/bad-type-env-capture.rs:2:15 | LL | fn foo() { - | - type variable from outer function + | - type parameter from outer function LL | fn bar(b: T) { } | --- ^ use of generic parameter from outer function | | diff --git a/src/test/ui/const-generics/const-param-from-outer-fn.stderr b/src/test/ui/const-generics/const-param-from-outer-fn.stderr index e37b34fac33..f0b7562f621 100644 --- a/src/test/ui/const-generics/const-param-from-outer-fn.stderr +++ b/src/test/ui/const-generics/const-param-from-outer-fn.stderr @@ -8,7 +8,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/const-param-from-outer-fn.rs:6:9 | LL | fn foo() { - | - const variable from outer function + | - const parameter from outer function LL | fn bar() -> u32 { | --- try adding a local generic parameter in this method instead LL | X diff --git a/src/test/ui/error-codes/E0401.stderr b/src/test/ui/error-codes/E0401.stderr index 7c54e5b4edb..1d9dfe46722 100644 --- a/src/test/ui/error-codes/E0401.stderr +++ b/src/test/ui/error-codes/E0401.stderr @@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/E0401.rs:4:39 | LL | fn foo(x: T) { - | - type variable from outer function + | - type parameter from outer function LL | fn bfnr, W: Fn()>(y: T) { | --------------------------- ^ use of generic parameter from outer function | | @@ -12,7 +12,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/E0401.rs:9:16 | LL | fn foo(x: T) { - | - type variable from outer function + | - type parameter from outer function ... LL | fn baz $DIR/inner-static-type-parameter.rs:6:19 | LL | fn foo() { - | --- - type variable from outer function + | --- - type parameter from outer function | | | try adding a local generic parameter in this method instead LL | static a: Bar = Bar::What; diff --git a/src/test/ui/issues/issue-3021-c.stderr b/src/test/ui/issues/issue-3021-c.stderr index cef30acd602..8764ac8a856 100644 --- a/src/test/ui/issues/issue-3021-c.stderr +++ b/src/test/ui/issues/issue-3021-c.stderr @@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/issue-3021-c.rs:4:24 | LL | fn siphash() { - | - type variable from outer function + | - type parameter from outer function ... LL | fn g(&self, x: T) -> T; | - ^ use of generic parameter from outer function @@ -13,7 +13,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/issue-3021-c.rs:4:30 | LL | fn siphash() { - | - type variable from outer function + | - type parameter from outer function ... LL | fn g(&self, x: T) -> T; | - ^ use of generic parameter from outer function diff --git a/src/test/ui/issues/issue-3214.stderr b/src/test/ui/issues/issue-3214.stderr index 9c2585688e9..fa04ec12b74 100644 --- a/src/test/ui/issues/issue-3214.stderr +++ b/src/test/ui/issues/issue-3214.stderr @@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/issue-3214.rs:3:12 | LL | fn foo() { - | --- - type variable from outer function + | --- - type parameter from outer function | | | try adding a local generic parameter in this method instead LL | struct Foo { diff --git a/src/test/ui/issues/issue-5997-enum.stderr b/src/test/ui/issues/issue-5997-enum.stderr index 5c778143e13..1c58b9c3911 100644 --- a/src/test/ui/issues/issue-5997-enum.stderr +++ b/src/test/ui/issues/issue-5997-enum.stderr @@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/issue-5997-enum.rs:2:16 | LL | fn f() -> bool { - | - - type variable from outer function + | - - type parameter from outer function | | | try adding a local generic parameter in this method instead LL | enum E { V(Z) } diff --git a/src/test/ui/issues/issue-5997-struct.stderr b/src/test/ui/issues/issue-5997-struct.stderr index cb1b5146b6c..5b388d16d75 100644 --- a/src/test/ui/issues/issue-5997-struct.stderr +++ b/src/test/ui/issues/issue-5997-struct.stderr @@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/issue-5997-struct.rs:2:14 | LL | fn f() -> bool { - | - - type variable from outer function + | - - type parameter from outer function | | | try adding a local generic parameter in this method instead LL | struct S(T); diff --git a/src/test/ui/nested-ty-params.stderr b/src/test/ui/nested-ty-params.stderr index 37adeffb9b0..f6741b5e5e8 100644 --- a/src/test/ui/nested-ty-params.stderr +++ b/src/test/ui/nested-ty-params.stderr @@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/nested-ty-params.rs:3:16 | LL | fn hd(v: Vec ) -> U { - | - type variable from outer function + | - type parameter from outer function LL | fn hd1(w: [U]) -> U { return w[0]; } | --- ^ use of generic parameter from outer function | | @@ -12,7 +12,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/nested-ty-params.rs:3:23 | LL | fn hd(v: Vec ) -> U { - | - type variable from outer function + | - type parameter from outer function LL | fn hd1(w: [U]) -> U { return w[0]; } | --- ^ use of generic parameter from outer function | | diff --git a/src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr b/src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr index f6b8abf4057..10a703ee093 100644 --- a/src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr +++ b/src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr @@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/resolve-type-param-in-item-in-trait.rs:8:22 | LL | trait TraitA { - | - type variable from outer function + | - type parameter from outer function LL | fn outer(&self) { | ----- try adding a local generic parameter in this method instead LL | enum Foo { @@ -13,7 +13,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/resolve-type-param-in-item-in-trait.rs:16:23 | LL | trait TraitB { - | - type variable from outer function + | - type parameter from outer function LL | fn outer(&self) { | ----- try adding a local generic parameter in this method instead LL | struct Foo(A); @@ -23,7 +23,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/resolve-type-param-in-item-in-trait.rs:23:28 | LL | trait TraitC { - | - type variable from outer function + | - type parameter from outer function LL | fn outer(&self) { | ----- try adding a local generic parameter in this method instead LL | struct Foo { a: A } @@ -33,7 +33,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/resolve-type-param-in-item-in-trait.rs:30:22 | LL | trait TraitD { - | - type variable from outer function + | - type parameter from outer function LL | fn outer(&self) { LL | fn foo(a: A) { } | ------ ^ use of generic parameter from outer function diff --git a/src/test/ui/type/type-arg-out-of-scope.stderr b/src/test/ui/type/type-arg-out-of-scope.stderr index 645cbb33abe..ea991069c08 100644 --- a/src/test/ui/type/type-arg-out-of-scope.stderr +++ b/src/test/ui/type/type-arg-out-of-scope.stderr @@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/type-arg-out-of-scope.rs:3:25 | LL | fn foo(x: T) { - | - type variable from outer function + | - type parameter from outer function LL | fn bar(f: Box T>) { } | --- ^ use of generic parameter from outer function | | @@ -12,7 +12,7 @@ error[E0401]: can't use generic parameters from outer function --> $DIR/type-arg-out-of-scope.rs:3:31 | LL | fn foo(x: T) { - | - type variable from outer function + | - type parameter from outer function LL | fn bar(f: Box T>) { } | --- ^ use of generic parameter from outer function | |