Closed
Description
When trying to access the len of a Vec I forgot the parens. This led to an error message about using a private field which confused me. (Thanks to the IRC for helping me find the problem!)
Code:
use std::vec::Vec;
fn main() {
let xs: Vec<i32> = Vec::new();
xs.len;
}
Error:
baderror.rs:5:2: 5:8 error: field `len` of struct `collections::vec::Vec` is private
baderror.rs:5 xs.len;
^~~~~~
error: aborting due to previous error
Illegal instruction