Commit c25ef5c
committed
Implicitely inject
The core library is made accessible through the `core` identifier in
every crate unless the crate opt out with the `#![no_core]` attribute.
This commit implicitely inject this extern crate when required.
gcc/rust/ChangeLog:
* ast/rust-ast.cc (Crate::inject_extern_crate): Add a function to
inject an extern crate item to a crate.
* ast/rust-ast.h: Add function prototype for inject_extern_crate.
* rust-session-manager.cc (has_attribute): Add helper to determine if
a crate has a given inner attribute.
(Session::compile_crate): Add a step to inject the core extern crate
when the no_core attribute is missing.
* util/rust-attribute-values.h: Add the no_core attribute value.
Signed-off-by: Pierre-Emmanuel Patry <[email protected]>extern crate core
1 parent d47331f commit c25ef5c
File tree
4 files changed
+26
-0
lines changed- gcc/rust
- ast
- util
4 files changed
+26
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
238 | 246 | | |
239 | 247 | | |
240 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2116 | 2116 | | |
2117 | 2117 | | |
2118 | 2118 | | |
| 2119 | + | |
| 2120 | + | |
2119 | 2121 | | |
2120 | 2122 | | |
2121 | 2123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
165 | 175 | | |
166 | 176 | | |
167 | 177 | | |
| |||
658 | 668 | | |
659 | 669 | | |
660 | 670 | | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
661 | 676 | | |
662 | 677 | | |
663 | 678 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
0 commit comments