From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../rustc_error_codes/src/error_codes/E0152.md | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 compiler/rustc_error_codes/src/error_codes/E0152.md (limited to 'compiler/rustc_error_codes/src/error_codes/E0152.md') diff --git a/compiler/rustc_error_codes/src/error_codes/E0152.md b/compiler/rustc_error_codes/src/error_codes/E0152.md new file mode 100644 index 000000000..ef17b8b4c --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0152.md @@ -0,0 +1,25 @@ +A lang item was redefined. + +Erroneous code example: + +```compile_fail,E0152 +#![feature(lang_items)] + +#[lang = "owned_box"] +struct Foo(T); // error: duplicate lang item found: `owned_box` +``` + +Lang items are already implemented in the standard library. Unless you are +writing a free-standing application (e.g., a kernel), you do not need to provide +them yourself. + +You can build a free-standing crate by adding `#![no_std]` to the crate +attributes: + +```ignore (only-for-syntax-highlight) +#![no_std] +``` + +See also the [unstable book][1]. + +[1]: https://doc.rust-lang.org/unstable-book/language-features/lang-items.html#writing-an-executable-without-stdlib -- cgit v1.2.3