Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra # from url in suggestion #120285

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/array-slice-vec/repeat_empty_ok.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/const-generics/issues/issue-61336-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/const-generics/issues/issue-61336.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/consts/const-blocks/migrate-fail.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | let arr: [Option<Bar>; 2] = [x; 2];
= note: required for `Option<Bar>` 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)]
Expand All @@ -23,7 +23,7 @@ LL | let arr: [Option<Bar>; 2] = [x; 2];
= note: required for `Option<Bar>` 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)]
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/consts/const-blocks/nll-fail.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | let arr: [Option<Bar>; 2] = [x; 2];
= note: required for `Option<Bar>` 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)]
Expand All @@ -23,7 +23,7 @@ LL | let arr: [Option<Bar>; 2] = [x; 2];
= note: required for `Option<Bar>` 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)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/repeat-expr/repeat-to-run-dtor-twice.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/trait-bounds/issue-119530-sugg-from-fn.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading