Improve slug name error
This commit is contained in:
parent
d494502f64
commit
e8e47e0873
4 changed files with 77 additions and 50 deletions
|
|
@ -0,0 +1,24 @@
|
|||
// rustc-env:CARGO_CRATE_NAME=rustc_dummy
|
||||
|
||||
#![feature(rustc_private)]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
extern crate rustc_span;
|
||||
use rustc_span::symbol::Ident;
|
||||
use rustc_span::Span;
|
||||
|
||||
extern crate rustc_macros;
|
||||
use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
|
||||
|
||||
extern crate rustc_middle;
|
||||
use rustc_middle::ty::Ty;
|
||||
|
||||
extern crate rustc_errors;
|
||||
use rustc_errors::{Applicability, MultiSpan};
|
||||
|
||||
extern crate rustc_session;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(compiletest_example, code = "E0123")]
|
||||
//~^ ERROR diagnostic slug and crate name do not match
|
||||
struct Hello {}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
error: diagnostic slug and crate name do not match
|
||||
--> $DIR/enforce_slug_naming.rs:22:8
|
||||
|
|
||||
LL | #[diag(compiletest_example, code = "E0123")]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: slug is `compiletest_example` but the crate name is `rustc_dummy`
|
||||
= help: expected a slug starting with `dummy_...`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue