2024-03-01 15:37:56 -06:00
|
|
|
error[E0599]: no method named `map` found for reference `&'static [i32]` in the current scope
|
|
|
|
--> $DIR/issue-94581.rs:7:35
|
2022-03-08 12:04:20 -06:00
|
|
|
|
|
2024-03-01 15:37:56 -06:00
|
|
|
LL | let _sqsum: i32 = get_slice().map(|i| i * i).sum();
|
|
|
|
| ^^^ `&'static [i32]` is not an iterator
|
2022-03-08 12:04:20 -06:00
|
|
|
|
|
2024-03-01 15:37:56 -06:00
|
|
|
help: call `.into_iter()` first
|
|
|
|
|
|
|
|
|
LL | let _sqsum: i32 = get_slice().into_iter().map(|i| i * i).sum();
|
|
|
|
| ++++++++++++
|
2022-03-08 12:04:20 -06:00
|
|
|
|
2023-11-21 09:44:16 -06:00
|
|
|
error: aborting due to 1 previous error
|
2022-03-08 12:04:20 -06:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0599`.
|