diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index e31aaaa196985..f3b04b55a35c5 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -3155,7 +3155,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { } else { // FIXME: we may suggest array::repeat instead err.help("consider using `core::array::from_fn` to initialize the array"); - err.help("see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html# for more information"); + err.help("see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information"); } if self.tcx.sess.is_nightly_build() diff --git a/tests/ui/array-slice-vec/repeat_empty_ok.stderr b/tests/ui/array-slice-vec/repeat_empty_ok.stderr index bc3a68c905d4f..c272d47d9617f 100644 --- a/tests/ui/array-slice-vec/repeat_empty_ok.stderr +++ b/tests/ui/array-slice-vec/repeat_empty_ok.stderr @@ -6,7 +6,7 @@ LL | let headers = [Header{value: &[]}; 128]; | = note: the `Copy` trait is required because this value will be copied for each element of the array = help: consider using `core::array::from_fn` to initialize the array - = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html# for more information + = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information help: consider annotating `Header<'_>` with `#[derive(Copy)]` | LL + #[derive(Copy)] @@ -21,7 +21,7 @@ LL | let headers = [Header{value: &[0]}; 128]; | = note: the `Copy` trait is required because this value will be copied for each element of the array = help: consider using `core::array::from_fn` to initialize the array - = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html# for more information + = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information help: consider annotating `Header<'_>` with `#[derive(Copy)]` | LL + #[derive(Copy)] diff --git a/tests/ui/const-generics/issues/issue-61336-2.stderr b/tests/ui/const-generics/issues/issue-61336-2.stderr index 9064c2d0b94f7..b0864689f7400 100644 --- a/tests/ui/const-generics/issues/issue-61336-2.stderr +++ b/tests/ui/const-generics/issues/issue-61336-2.stderr @@ -6,7 +6,7 @@ LL | [x; { N }] | = note: the `Copy` trait is required because this value will be copied for each element of the array = help: consider using `core::array::from_fn` to initialize the array - = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html# for more information + = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information help: consider restricting type parameter `T` | LL | fn g(x: T) -> [T; N] { diff --git a/tests/ui/const-generics/issues/issue-61336.stderr b/tests/ui/const-generics/issues/issue-61336.stderr index 9935d6c168918..111afbda343f7 100644 --- a/tests/ui/const-generics/issues/issue-61336.stderr +++ b/tests/ui/const-generics/issues/issue-61336.stderr @@ -6,7 +6,7 @@ LL | [x; N] | = note: the `Copy` trait is required because this value will be copied for each element of the array = help: consider using `core::array::from_fn` to initialize the array - = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html# for more information + = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information help: consider restricting type parameter `T` | LL | fn g(x: T) -> [T; N] { diff --git a/tests/ui/consts/const-blocks/migrate-fail.stderr b/tests/ui/consts/const-blocks/migrate-fail.stderr index 95fece0ae8ae2..3c116026e5804 100644 --- a/tests/ui/consts/const-blocks/migrate-fail.stderr +++ b/tests/ui/consts/const-blocks/migrate-fail.stderr @@ -7,7 +7,7 @@ LL | let arr: [Option; 2] = [x; 2]; = note: required for `Option` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array = help: consider using `core::array::from_fn` to initialize the array - = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html# for more information + = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information help: consider annotating `Bar` with `#[derive(Copy)]` | LL + #[derive(Copy)] @@ -23,7 +23,7 @@ LL | let arr: [Option; 2] = [x; 2]; = note: required for `Option` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array = help: consider using `core::array::from_fn` to initialize the array - = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html# for more information + = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information help: consider annotating `Bar` with `#[derive(Copy)]` | LL + #[derive(Copy)] diff --git a/tests/ui/consts/const-blocks/nll-fail.stderr b/tests/ui/consts/const-blocks/nll-fail.stderr index ed1dc78f77dba..ff2b62da66828 100644 --- a/tests/ui/consts/const-blocks/nll-fail.stderr +++ b/tests/ui/consts/const-blocks/nll-fail.stderr @@ -7,7 +7,7 @@ LL | let arr: [Option; 2] = [x; 2]; = note: required for `Option` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array = help: consider using `core::array::from_fn` to initialize the array - = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html# for more information + = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information help: consider annotating `Bar` with `#[derive(Copy)]` | LL + #[derive(Copy)] @@ -23,7 +23,7 @@ LL | let arr: [Option; 2] = [x; 2]; = note: required for `Option` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array = help: consider using `core::array::from_fn` to initialize the array - = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html# for more information + = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information help: consider annotating `Bar` with `#[derive(Copy)]` | LL + #[derive(Copy)] diff --git a/tests/ui/repeat-expr/repeat-to-run-dtor-twice.stderr b/tests/ui/repeat-expr/repeat-to-run-dtor-twice.stderr index f3fe8c10c0251..1f7487e68be8a 100644 --- a/tests/ui/repeat-expr/repeat-to-run-dtor-twice.stderr +++ b/tests/ui/repeat-expr/repeat-to-run-dtor-twice.stderr @@ -6,7 +6,7 @@ LL | let _ = [ a; 5 ]; | = note: the `Copy` trait is required because this value will be copied for each element of the array = help: consider using `core::array::from_fn` to initialize the array - = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html# for more information + = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information help: consider annotating `Foo` with `#[derive(Copy)]` | LL + #[derive(Copy)] diff --git a/tests/ui/trait-bounds/issue-119530-sugg-from-fn.stderr b/tests/ui/trait-bounds/issue-119530-sugg-from-fn.stderr index f394c4cf027e2..9217637901b85 100644 --- a/tests/ui/trait-bounds/issue-119530-sugg-from-fn.stderr +++ b/tests/ui/trait-bounds/issue-119530-sugg-from-fn.stderr @@ -6,7 +6,7 @@ LL | let string_arr = [foo(); 64]; | = note: the `Copy` trait is required because this value will be copied for each element of the array = help: consider using `core::array::from_fn` to initialize the array - = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html# for more information + = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information error: aborting due to 1 previous error