mirror of https://github.com/rust-lang/rustlings
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
538 B
Rust
46 lines
538 B
Rust
7 years ago
|
// variables4.rs
|
||
9 years ago
|
// Make me compile! Scroll down for hints :)
|
||
9 years ago
|
|
||
|
fn main() {
|
||
|
let x: i32;
|
||
|
println!("Number {}", x);
|
||
|
}
|
||
9 years ago
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
// Oops! In this exercise, we have a variable binding that we've created on
|
||
7 years ago
|
// line 5, and we're trying to use it on line 6, but we haven't given it a
|
||
9 years ago
|
// value. We can't print out something that isn't there; try giving x a value!
|
||
|
// This is an error that can cause bugs that's very easy to make in any
|
||
|
// programming language -- thankfully the Rust compiler has caught this for us!
|