You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::io::prelude::{Read};
use std::fs::File;
fn main() {
let mut file = File::open("").unwrap();
let mut temp = Vec::new();
file.read_to_string(&mut temp).unwrap();
}
Mismatched type error, stating that expected type is &mut std::string::String, found type &mut std::vec::Vec<_>
Instead, this happened:
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'index out of bounds: the len is 11 but the index is 13', ../src/libcollections/vec.rs:1167
I tried this code:
https://is.gd/g8Qo3H
I expected to see this happen:
Mismatched type error, stating that expected type is
&mut std::string::String
, found type&mut std::vec::Vec<_>
Instead, this happened:
Meta
Backtrace:
The text was updated successfully, but these errors were encountered: