Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
90bb5cacb5c1a5fe20ba821d28e7eb7a21e35d09
rust/tests/ui/iterators/iterator-sum-array-15673.rs

10 lines
167 B
Rust
Raw Normal View History

[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives
2024-02-16 20:02:50 +00:00
//@ run-pass
Add `#![allow(..)]` for a slew of lints of migrated run-pass tests, to silence stderr output.
2018-08-31 15:02:01 +02:00
#![allow(stable_features)]
Fallout in tests and docs from feature renamings
2015-06-10 13:33:52 -07:00
#![feature(iter_arith)]
Require feature attributes, and add them where necessary
2015-03-05 18:33:58 -08:00
Add tests for a few resolved issues
2014-10-02 21:52:06 +02:00
fn main() {
Allow use of `[_ ; n]` syntax for fixed length and repeating arrays. This does NOT break any existing programs because the `[_, ..n]` syntax is also supported.
2014-12-20 15:20:51 +13:00
let x: [u64; 3] = [1, 2, 3];
Make `sum` and `product` inherent methods on `Iterator` In addition to being nicer, this also allows you to use `sum` and `product` for iterators yielding custom types aside from the standard integers. Due to removing the `AdditiveIterator` and `MultiplicativeIterator` trait, this is a breaking change. [breaking-change]
2015-04-06 17:43:50 +02:00
assert_eq!(6, (0..3).map(|i| x[i]).sum::<u64>());
Add tests for a few resolved issues
2014-10-02 21:52:06 +02:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 8499ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API