Skip to content

Commit d99026e

Browse files
authored
Rollup merge of rust-lang#66435 - JohnTitor:fix-spelling, r=Centril
Correct `const_in_array_repeat_expressions` feature name Fixes rust-lang#66433 r? @estebank
2 parents c6cdbe9 + 759c7e4 commit d99026e

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/librustc/traits/error_reporting.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2176,15 +2176,15 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
21762176
err.note(&format!("required by cast to type `{}`",
21772177
self.ty_to_string(target)));
21782178
}
2179-
ObligationCauseCode::RepeatVec(suggest_const_in_array_repeat_expression) => {
2179+
ObligationCauseCode::RepeatVec(suggest_const_in_array_repeat_expressions) => {
21802180
err.note("the `Copy` trait is required because the \
21812181
repeated element will be copied");
2182-
if suggest_const_in_array_repeat_expression {
2182+
if suggest_const_in_array_repeat_expressions {
21832183
err.note("this array initializer can be evaluated at compile-time, for more \
21842184
information, see issue \
21852185
https://github.com/rust-lang/rust/issues/49147");
21862186
if tcx.sess.opts.unstable_features.is_nightly_build() {
2187-
err.help("add `#![feature(const_in_array_repeat_expression)]` to the \
2187+
err.help("add `#![feature(const_in_array_repeat_expressions)]` to the \
21882188
crate attributes to enable");
21892189
}
21902190
}

src/librustc/traits/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub enum ObligationCauseCode<'tcx> {
206206
SizedReturnType,
207207
/// Yield type must be Sized
208208
SizedYieldType,
209-
/// [T,..n] --> T must be Copy. If `true`, suggest `const_in_array_repeat_expression` feature
209+
/// [T,..n] --> T must be Copy. If `true`, suggest `const_in_array_repeat_expressions` feature
210210
/// flag.
211211
RepeatVec(bool),
212212

src/librustc_mir/borrow_check/nll/type_check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1987,7 +1987,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19871987
let span = body.source_info(location).span;
19881988
let ty = operand.ty(body, tcx);
19891989
if !self.infcx.type_is_copy_modulo_regions(self.param_env, ty, span) {
1990-
// To determine if `const_in_array_repeat_expression` feature gate should
1990+
// To determine if `const_in_array_repeat_expressions` feature gate should
19911991
// be mentioned, need to check if the rvalue is promotable.
19921992
let should_suggest =
19931993
should_suggest_const_in_array_repeat_expressions_attribute(

src/librustc_mir/transform/promote_consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ pub fn promote_candidates<'tcx>(
11851185
promotions
11861186
}
11871187

1188-
/// This function returns `true` if the `const_in_array_repeat_expression` feature attribute should
1188+
/// This function returns `true` if the `const_in_array_repeat_expressions` feature attribute should
11891189
/// be suggested. This function is probably quite expensive, it shouldn't be run in the happy path.
11901190
/// Feature attribute should be suggested if `operand` can be promoted and the feature is not
11911191
/// enabled.

src/test/ui/feature-gates/feature-gate-const_in_array_repeat_expressions.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | let arr: [Option<String>; 2] = [None::<String>; 2];
88
<std::option::Option<T> as std::marker::Copy>
99
= note: the `Copy` trait is required because the repeated element will be copied
1010
= note: this array initializer can be evaluated at compile-time, for more information, see issue https://github.com/rust-lang/rust/issues/49147
11-
= help: add `#![feature(const_in_array_repeat_expression)]` to the crate attributes to enable
11+
= help: add `#![feature(const_in_array_repeat_expressions)]` to the crate attributes to enable
1212

1313
error[E0277]: the trait bound `std::option::Option<std::string::String>: std::marker::Copy` is not satisfied
1414
--> $DIR/feature-gate-const_in_array_repeat_expressions.rs:14:36

0 commit comments

Comments
 (0)