started: https://doc.rust-lang.org/book/
"##,
+E0602: r##"
+An unknown lint was used on the command line.
+
+Erroneous example:
+
+```ignore
+rustc -D bogus omse_file.rs
+```
+
+Maybe you just misspelled the lint name or the lint doesn't exist anymore.
+Either way, try to update/remove it in order to fix the error.
+"##,
+
}
continue;
}
}
- },
- Err(FindLintError::Removed) => { continue; }
+ }
+ Err(FindLintError::Removed) => continue,
}
}
};
Some(sess.struct_warn(msg))
},
CheckLintNameResult::NoLint => {
- Some(sess.struct_err(&format!("unknown lint: `{}`", lint_name)))
+ Some(struct_err!(sess, E0602, "unknown lint: `{}`", lint_name))
}
};
--- /dev/null
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags:-D bogus
+
+// error-pattern:E0602
+// error-pattern:requested on the command line with `-D bogus`
+
+fn main() {}