Content-Length: 24108 | pFad | https://doc.rust-lang.org/std/string/../error/../string/../vec/../../../error_codes/./E0529.html

E0529 - Error codes index

Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error code E0529

An array or slice pattern was matched against some other type.

Example of erroneous code:

#![allow(unused)]
fn main() {
let r: f32 = 1.0;
match r {
    [a, b] => { // error: expected an array or slice, found `f32`
        println!("a={}, b={}", a, b);
    }
}
}

Ensure that the pattern and the expression being matched on are of consistent types:

#![allow(unused)]
fn main() {
let r = [1.0, 2.0];
match r {
    [a, b] => { // ok!
        println!("a={}, b={}", a, b);
    }
}
}








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/std/string/../error/../string/../vec/../../../error_codes/./E0529.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy