]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0152.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0152.md
1 A lang item was redefined.
2
3 Erroneous code example:
4
5 ```compile_fail,E0152
6 #![feature(lang_items)]
7
8 #[lang = "owned_box"]
9 struct Foo<T>(T); // error: duplicate lang item found: `owned_box`
10 ```
11
12 Lang items are already implemented in the standard library. Unless you are
13 writing a free-standing application (e.g., a kernel), you do not need to provide
14 them yourself.
15
16 You can build a free-standing crate by adding `#![no_std]` to the crate
17 attributes:
18
19 ```ignore (only-for-syntax-highlight)
20 #![no_std]
21 ```
22
23 See also the [unstable book][1].
24
25 [1]: https://doc.rust-lang.org/unstable-book/language-features/lang-items.html#writing-an-executable-without-stdlib