]> git.proxmox.com Git - rustc.git/blame - src/librustc_borrowck/diagnostics.rs
Imported Upstream version 1.2.0+dfsg1
[rustc.git] / src / librustc_borrowck / diagnostics.rs
CommitLineData
1a4d82fc 1// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
223e47cc
LB
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
9346a6ac 11#![allow(non_snake_case)]
c34b1796 12
62682a34
SL
13register_long_diagnostics! {
14
15E0381: r##"
16It is not allowed to use or capture an uninitialized variable. For example:
17
18```
19fn main() {
20 let x: i32;
21 let y = x; // error, use of possibly uninitialized variable
22```
23
24To fix this, ensure that any declared variables are initialized before being
25used.
26"##
27
28}
29
9346a6ac 30register_diagnostics! {
62682a34
SL
31 E0373, // closure may outlive current fn, but it borrows {}, which is owned by current fn
32 E0382, // use of partially/collaterally moved value
33 E0383, // partial reinitialization of uninitialized structure
34 E0384, // reassignment of immutable variable
35 E0385, // {} in an aliasable location
36 E0386, // {} in an immutable container
37 E0387, // {} in a captured outer variable in an `Fn` closure
38 E0388, // {} in a static location
39 E0389 // {} in a `&` reference
223e47cc 40}