summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0152.md
blob: d862766571df6d0e7e58f1ad0fdca90ae4bd4d2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
A lang item was redefined.

Erroneous code example:

```compile_fail,E0152
#![feature(lang_items)]

#[lang = "owned_box"]
struct Foo<T>(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 [this section of the Rustonomicon][beneath std].

[beneath std]: https://doc.rust-lang.org/nomicon/beneath-std.html