Rollup merge of #106236 - Ezrashaw:add-test+docs-e0519-e0514, r=GuillaumeGomez

docs/test: add docs and a UI test for `E0514` and `E0519`

No UI test on `E0514`, it would need to compile with a different `rustc` version.

r? `@GuillaumeGomez`
This commit is contained in:
Matthias Krüger 2022-12-29 18:24:32 +01:00 committed by GitHub
commit 51534b897e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 94 additions and 4 deletions

View file

@ -0,0 +1,8 @@
// no need to create a new aux file, we can use an existing.
// aux-build: crateresolve1-1.rs
// set same metadata as `crateresolve1`
#![crate_name = "crateresolve1"]
#![crate_type = "lib"]
extern crate crateresolve1; //~ ERROR E0519

View file

@ -0,0 +1,9 @@
error[E0519]: the current crate is indistinguishable from one of its dependencies: it has the same crate-name `crateresolve1` and was compiled with the same `-C metadata` arguments. This will result in symbol conflicts between the two.
--> $DIR/E0519.rs:8:1
|
LL | extern crate crateresolve1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0519`.

View file

@ -11,8 +11,8 @@ use regex::Regex;
// A few of those error codes can't be tested but all the others can and *should* be tested!
const EXEMPTED_FROM_TEST: &[&str] = &[
"E0313", "E0461", "E0465", "E0476", "E0490", "E0514", "E0519", "E0523", "E0554", "E0640",
"E0717", "E0729", "E0789",
"E0313", "E0461", "E0465", "E0476", "E0490", "E0514", "E0523", "E0554", "E0640", "E0717",
"E0729", "E0789",
];
// Some error codes don't have any tests apparently...