Skip to content

Commit 9387927

Browse files
committed
Auto merge of #60054 - Centril:rollup-o40xxaa, r=Centril
Rollup of 4 pull requests Successful merges: - #59908 (Re-export core::str::{EscapeDebug, EscapeDefault, EscapeUnicode} in std) - #59984 (Remove collection-specific `with_capacity` documentation from `std::collections`) - #60036 (Remove nrc from toolstate pings) - #60037 (Resolve inconsistency in error messages between "parameter" and "variable".) Failed merges: r? @ghost
2 parents 3c3d3c1 + 42b3cf1 commit 9387927

15 files changed

+27
-26
lines changed

src/liballoc/str.rs

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ pub use core::str::pattern;
6868
pub use core::str::EncodeUtf16;
6969
#[stable(feature = "split_ascii_whitespace", since = "1.34.0")]
7070
pub use core::str::SplitAsciiWhitespace;
71+
#[stable(feature = "str_escape", since = "1.34.0")]
72+
pub use core::str::{EscapeDebug, EscapeDefault, EscapeUnicode};
7173

7274
#[unstable(feature = "slice_concat_ext",
7375
reason = "trait should not have to exist",

src/librustc_resolve/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,12 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver<'_>,
234234
},
235235
Def::TyParam(def_id) => {
236236
if let Some(span) = resolver.definitions.opt_span(def_id) {
237-
err.span_label(span, "type variable from outer function");
237+
err.span_label(span, "type parameter from outer function");
238238
}
239239
}
240240
Def::ConstParam(def_id) => {
241241
if let Some(span) = resolver.definitions.opt_span(def_id) {
242-
err.span_label(span, "const variable from outer function");
242+
err.span_label(span, "const parameter from outer function");
243243
}
244244
}
245245
_ => {

src/libstd/collections/mod.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,9 @@
150150
//! Any `with_capacity` constructor will instruct the collection to allocate
151151
//! enough space for the specified number of elements. Ideally this will be for
152152
//! exactly that many elements, but some implementation details may prevent
153-
//! this. [`Vec`] and [`VecDeque`] can be relied on to allocate exactly the
154-
//! requested amount, though. Use `with_capacity` when you know exactly how many
155-
//! elements will be inserted, or at least have a reasonable upper-bound on that
156-
//! number.
153+
//! this. See collection-specific documentation for details. In general, use
154+
//! `with_capacity` when you know exactly how many elements will be inserted, or
155+
//! at least have a reasonable upper-bound on that number.
157156
//!
158157
//! When anticipating a large influx of elements, the `reserve` family of
159158
//! methods can be used to hint to the collection how much room it should make

src/test/ui/bad/bad-type-env-capture.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function
22
--> $DIR/bad-type-env-capture.rs:2:15
33
|
44
LL | fn foo<T>() {
5-
| - type variable from outer function
5+
| - type parameter from outer function
66
LL | fn bar(b: T) { }
77
| --- ^ use of generic parameter from outer function
88
| |

src/test/ui/const-generics/const-param-from-outer-fn.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0401]: can't use generic parameters from outer function
88
--> $DIR/const-param-from-outer-fn.rs:6:9
99
|
1010
LL | fn foo<const X: u32>() {
11-
| - const variable from outer function
11+
| - const parameter from outer function
1212
LL | fn bar() -> u32 {
1313
| --- try adding a local generic parameter in this method instead
1414
LL | X

src/test/ui/error-codes/E0401.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function
22
--> $DIR/E0401.rs:4:39
33
|
44
LL | fn foo<T>(x: T) {
5-
| - type variable from outer function
5+
| - type parameter from outer function
66
LL | fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
77
| --------------------------- ^ use of generic parameter from outer function
88
| |
@@ -12,7 +12,7 @@ error[E0401]: can't use generic parameters from outer function
1212
--> $DIR/E0401.rs:9:16
1313
|
1414
LL | fn foo<T>(x: T) {
15-
| - type variable from outer function
15+
| - type parameter from outer function
1616
...
1717
LL | fn baz<U,
1818
| --- try adding a local generic parameter in this method instead

src/test/ui/inner-static-type-parameter.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function
22
--> $DIR/inner-static-type-parameter.rs:6:19
33
|
44
LL | fn foo<T>() {
5-
| --- - type variable from outer function
5+
| --- - type parameter from outer function
66
| |
77
| try adding a local generic parameter in this method instead
88
LL | static a: Bar<T> = Bar::What;

src/test/ui/issues/issue-3021-c.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function
22
--> $DIR/issue-3021-c.rs:4:24
33
|
44
LL | fn siphash<T>() {
5-
| - type variable from outer function
5+
| - type parameter from outer function
66
...
77
LL | fn g(&self, x: T) -> T;
88
| - ^ use of generic parameter from outer function
@@ -13,7 +13,7 @@ error[E0401]: can't use generic parameters from outer function
1313
--> $DIR/issue-3021-c.rs:4:30
1414
|
1515
LL | fn siphash<T>() {
16-
| - type variable from outer function
16+
| - type parameter from outer function
1717
...
1818
LL | fn g(&self, x: T) -> T;
1919
| - ^ use of generic parameter from outer function

src/test/ui/issues/issue-3214.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function
22
--> $DIR/issue-3214.rs:3:12
33
|
44
LL | fn foo<T>() {
5-
| --- - type variable from outer function
5+
| --- - type parameter from outer function
66
| |
77
| try adding a local generic parameter in this method instead
88
LL | struct Foo {

src/test/ui/issues/issue-5997-enum.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function
22
--> $DIR/issue-5997-enum.rs:2:16
33
|
44
LL | fn f<Z>() -> bool {
5-
| - - type variable from outer function
5+
| - - type parameter from outer function
66
| |
77
| try adding a local generic parameter in this method instead
88
LL | enum E { V(Z) }

src/test/ui/issues/issue-5997-struct.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function
22
--> $DIR/issue-5997-struct.rs:2:14
33
|
44
LL | fn f<T>() -> bool {
5-
| - - type variable from outer function
5+
| - - type parameter from outer function
66
| |
77
| try adding a local generic parameter in this method instead
88
LL | struct S(T);

src/test/ui/nested-ty-params.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function
22
--> $DIR/nested-ty-params.rs:3:16
33
|
44
LL | fn hd<U>(v: Vec<U> ) -> U {
5-
| - type variable from outer function
5+
| - type parameter from outer function
66
LL | fn hd1(w: [U]) -> U { return w[0]; }
77
| --- ^ use of generic parameter from outer function
88
| |
@@ -12,7 +12,7 @@ error[E0401]: can't use generic parameters from outer function
1212
--> $DIR/nested-ty-params.rs:3:23
1313
|
1414
LL | fn hd<U>(v: Vec<U> ) -> U {
15-
| - type variable from outer function
15+
| - type parameter from outer function
1616
LL | fn hd1(w: [U]) -> U { return w[0]; }
1717
| --- ^ use of generic parameter from outer function
1818
| |

src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function
22
--> $DIR/resolve-type-param-in-item-in-trait.rs:8:22
33
|
44
LL | trait TraitA<A> {
5-
| - type variable from outer function
5+
| - type parameter from outer function
66
LL | fn outer(&self) {
77
| ----- try adding a local generic parameter in this method instead
88
LL | enum Foo<B> {
@@ -13,7 +13,7 @@ error[E0401]: can't use generic parameters from outer function
1313
--> $DIR/resolve-type-param-in-item-in-trait.rs:16:23
1414
|
1515
LL | trait TraitB<A> {
16-
| - type variable from outer function
16+
| - type parameter from outer function
1717
LL | fn outer(&self) {
1818
| ----- try adding a local generic parameter in this method instead
1919
LL | struct Foo<B>(A);
@@ -23,7 +23,7 @@ error[E0401]: can't use generic parameters from outer function
2323
--> $DIR/resolve-type-param-in-item-in-trait.rs:23:28
2424
|
2525
LL | trait TraitC<A> {
26-
| - type variable from outer function
26+
| - type parameter from outer function
2727
LL | fn outer(&self) {
2828
| ----- try adding a local generic parameter in this method instead
2929
LL | struct Foo<B> { a: A }
@@ -33,7 +33,7 @@ error[E0401]: can't use generic parameters from outer function
3333
--> $DIR/resolve-type-param-in-item-in-trait.rs:30:22
3434
|
3535
LL | trait TraitD<A> {
36-
| - type variable from outer function
36+
| - type parameter from outer function
3737
LL | fn outer(&self) {
3838
LL | fn foo<B>(a: A) { }
3939
| ------ ^ use of generic parameter from outer function

src/test/ui/type/type-arg-out-of-scope.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0401]: can't use generic parameters from outer function
22
--> $DIR/type-arg-out-of-scope.rs:3:25
33
|
44
LL | fn foo<T>(x: T) {
5-
| - type variable from outer function
5+
| - type parameter from outer function
66
LL | fn bar(f: Box<FnMut(T) -> T>) { }
77
| --- ^ use of generic parameter from outer function
88
| |
@@ -12,7 +12,7 @@ error[E0401]: can't use generic parameters from outer function
1212
--> $DIR/type-arg-out-of-scope.rs:3:31
1313
|
1414
LL | fn foo<T>(x: T) {
15-
| - type variable from outer function
15+
| - type parameter from outer function
1616
LL | fn bar(f: Box<FnMut(T) -> T>) { }
1717
| --- ^ use of generic parameter from outer function
1818
| |

src/tools/publish_toolstate.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
MAINTAINERS = {
1717
'miri': '@oli-obk @RalfJung @eddyb',
1818
'clippy-driver': '@Manishearth @llogiq @mcarton @oli-obk @phansch',
19-
'rls': '@nrc @Xanewok',
20-
'rustfmt': '@nrc @topecongiro',
19+
'rls': '@Xanewok',
20+
'rustfmt': '@topecongiro',
2121
'book': '@carols10cents @steveklabnik',
2222
'nomicon': '@frewsxcv @Gankro',
2323
'reference': '@steveklabnik @Havvy @matthewjasper @ehuss',

0 commit comments

Comments
 (0)