diff options
| author | bors <bors@rust-lang.org> | 2020-09-02 01:29:28 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-09-02 01:29:28 +0000 |
| commit | e36e4bd0f7e722d3c97d1ca45387e58f81e4e8ea (patch) | |
| tree | 505c8905fbf0db875c1be97477b65cac833bb653 /compiler/rustc_error_codes/src | |
| parent | 130359cb05246fcacdde61baa2613419ef6570c7 (diff) | |
| parent | 4dd75f8049b722ea8bd4ff9d7c6c4a438161bad6 (diff) | |
| download | rust-e36e4bd0f7e722d3c97d1ca45387e58f81e4e8ea.tar.gz rust-e36e4bd0f7e722d3c97d1ca45387e58f81e4e8ea.zip | |
Auto merge of #76231 - tmandry:rollup-ilvs9fq, r=tmandry
Rollup of 14 pull requests Successful merges: - #74880 (Add trailing comma support to matches macro) - #76074 (Add new `-Z dump-mir-spanview` option) - #76088 (Add more examples to lexicographic cmp on Iterators.) - #76099 (Add info about `!` and `impl Trait`) - #76126 (Use "Fira Sans" for crate list font) - #76132 (Factor out StmtKind::MacCall fields into `MacCallStmt` struct) - #76143 (Give a better error message for duplicate built-in macros) - #76158 (Stabilise link-self-contained option) - #76201 (Move to intra-doc links for library/core/src/panic.rs) - #76206 (Make all methods of `std::net::Ipv6Addr` const) - #76207 (# Move to intra-doc links for library/core/src/clone.rs) - #76212 (Document lint missing_doc_code_examples is nightly-only) - #76218 (lexer: Tiny improvement to shebang detection) - #76221 (Clean up header in `iter` docs for `for` loops) Failed merges: r? @ghost
Diffstat (limited to 'compiler/rustc_error_codes/src')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0773.md | 38 |
2 files changed, 39 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes.rs b/compiler/rustc_error_codes/src/error_codes.rs index 4e5e77f80c2..789a1fc35a6 100644 --- a/compiler/rustc_error_codes/src/error_codes.rs +++ b/compiler/rustc_error_codes/src/error_codes.rs @@ -454,6 +454,7 @@ E0768: include_str!("./error_codes/E0768.md"), E0769: include_str!("./error_codes/E0769.md"), E0770: include_str!("./error_codes/E0770.md"), E0771: include_str!("./error_codes/E0771.md"), +E0773: include_str!("./error_codes/E0773.md"), ; // E0006, // merged with E0005 // E0008, // cannot bind by-move into a pattern guard diff --git a/compiler/rustc_error_codes/src/error_codes/E0773.md b/compiler/rustc_error_codes/src/error_codes/E0773.md new file mode 100644 index 00000000000..b19a58bf33d --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0773.md @@ -0,0 +1,38 @@ +A builtin-macro was defined more than once. + +Erroneous code example: + +```compile_fail,E0773 +#![feature(decl_macro)] +#![feature(rustc_attrs)] + +#[rustc_builtin_macro] +pub macro test($item:item) { + /* compiler built-in */ +} + +mod inner { + #[rustc_builtin_macro] + pub macro test($item:item) { + /* compiler built-in */ + } +} +``` + +To fix the issue, remove the duplicate declaration: + +``` +#![feature(decl_macro)] +#![feature(rustc_attrs)] + +#[rustc_builtin_macro] +pub macro test($item:item) { + /* compiler built-in */ +} +``` + +In very rare edge cases, this may happen when loading `core` or `std` twice, +once with `check` metadata and once with `build` metadata. +For more information, see [#75176]. + +[#75176]: https://github.com/rust-lang/rust/pull/75176#issuecomment-683234468 |
