File tree 2 files changed +31
-67
lines changed
2 files changed +31
-67
lines changed Original file line number Diff line number Diff line change @@ -128,14 +128,18 @@ impl Sysroot {
128
128
}
129
129
130
130
if let Some ( alloc) = sysroot. by_name ( "alloc" ) {
131
- if let Some ( core) = sysroot. by_name ( "core" ) {
132
- sysroot. crates [ alloc] . deps . push ( core) ;
131
+ for dep in ALLOC_DEPS . trim ( ) . lines ( ) {
132
+ if let Some ( dep) = sysroot. by_name ( dep) {
133
+ sysroot. crates [ alloc] . deps . push ( dep)
134
+ }
133
135
}
134
136
}
135
137
136
138
if let Some ( proc_macro) = sysroot. by_name ( "proc_macro" ) {
137
- if let Some ( std) = sysroot. by_name ( "std" ) {
138
- sysroot. crates [ proc_macro] . deps . push ( std) ;
139
+ for dep in PROC_MACRO_DEPS . trim ( ) . lines ( ) {
140
+ if let Some ( dep) = sysroot. by_name ( dep) {
141
+ sysroot. crates [ proc_macro] . deps . push ( dep)
142
+ }
139
143
}
140
144
}
141
145
@@ -239,24 +243,27 @@ fn get_rust_src(sysroot_path: &AbsPath) -> Option<AbsPathBuf> {
239
243
240
244
const SYSROOT_CRATES : & str = "
241
245
alloc
246
+ backtrace
242
247
core
243
248
panic_abort
244
249
panic_unwind
245
250
proc_macro
246
251
profiler_builtins
247
252
std
248
253
stdarch/crates/std_detect
249
- term
250
254
test
251
255
unwind" ;
252
256
257
+ const ALLOC_DEPS : & str = "core" ;
258
+
253
259
const STD_DEPS : & str = "
254
260
alloc
255
- core
256
- panic_abort
257
261
panic_unwind
262
+ panic_abort
263
+ core
258
264
profiler_builtins
265
+ unwind
259
266
std_detect
260
- term
261
- test
262
- unwind ";
267
+ test" ;
268
+
269
+ const PROC_MACRO_DEPS : & str = "std ";
Original file line number Diff line number Diff line change @@ -1566,10 +1566,10 @@ fn rust_project_hello_world_project_model() {
1566
1566
},
1567
1567
Dependency {
1568
1568
crate_id: CrateId(
1569
- 1 ,
1569
+ 3 ,
1570
1570
),
1571
1571
name: CrateName(
1572
- "core ",
1572
+ "panic_unwind ",
1573
1573
),
1574
1574
prelude: true,
1575
1575
},
@@ -1584,10 +1584,10 @@ fn rust_project_hello_world_project_model() {
1584
1584
},
1585
1585
Dependency {
1586
1586
crate_id: CrateId(
1587
- 3 ,
1587
+ 1 ,
1588
1588
),
1589
1589
name: CrateName(
1590
- "panic_unwind ",
1590
+ "core ",
1591
1591
),
1592
1592
prelude: true,
1593
1593
},
@@ -1602,40 +1602,31 @@ fn rust_project_hello_world_project_model() {
1602
1602
},
1603
1603
Dependency {
1604
1604
crate_id: CrateId(
1605
- 7 ,
1605
+ 9 ,
1606
1606
),
1607
1607
name: CrateName(
1608
- "std_detect ",
1608
+ "unwind ",
1609
1609
),
1610
1610
prelude: true,
1611
1611
},
1612
1612
Dependency {
1613
1613
crate_id: CrateId(
1614
- 8 ,
1614
+ 7 ,
1615
1615
),
1616
1616
name: CrateName(
1617
- "term ",
1617
+ "std_detect ",
1618
1618
),
1619
1619
prelude: true,
1620
1620
},
1621
1621
Dependency {
1622
1622
crate_id: CrateId(
1623
- 9 ,
1623
+ 8 ,
1624
1624
),
1625
1625
name: CrateName(
1626
1626
"test",
1627
1627
),
1628
1628
prelude: true,
1629
1629
},
1630
- Dependency {
1631
- crate_id: CrateId(
1632
- 10,
1633
- ),
1634
- name: CrateName(
1635
- "unwind",
1636
- ),
1637
- prelude: true,
1638
- },
1639
1630
],
1640
1631
proc_macro: Err(
1641
1632
"no proc macro loaded for sysroot crate",
@@ -1687,40 +1678,6 @@ fn rust_project_hello_world_project_model() {
1687
1678
),
1688
1679
edition: Edition2018,
1689
1680
version: None,
1690
- display_name: Some(
1691
- CrateDisplayName {
1692
- crate_name: CrateName(
1693
- "term",
1694
- ),
1695
- canonical_name: "term",
1696
- },
1697
- ),
1698
- cfg_options: CfgOptions(
1699
- [],
1700
- ),
1701
- potential_cfg_options: CfgOptions(
1702
- [],
1703
- ),
1704
- env: Env {
1705
- entries: {},
1706
- },
1707
- dependencies: [],
1708
- proc_macro: Err(
1709
- "no proc macro loaded for sysroot crate",
1710
- ),
1711
- origin: Lang(
1712
- Other,
1713
- ),
1714
- is_proc_macro: false,
1715
- },
1716
- CrateId(
1717
- 9,
1718
- ): CrateData {
1719
- root_file_id: FileId(
1720
- 10,
1721
- ),
1722
- edition: Edition2018,
1723
- version: None,
1724
1681
display_name: Some(
1725
1682
CrateDisplayName {
1726
1683
crate_name: CrateName(
@@ -1748,10 +1705,10 @@ fn rust_project_hello_world_project_model() {
1748
1705
is_proc_macro: false,
1749
1706
},
1750
1707
CrateId(
1751
- 10 ,
1708
+ 9 ,
1752
1709
): CrateData {
1753
1710
root_file_id: FileId(
1754
- 11 ,
1711
+ 10 ,
1755
1712
),
1756
1713
edition: Edition2018,
1757
1714
version: None,
@@ -1782,10 +1739,10 @@ fn rust_project_hello_world_project_model() {
1782
1739
is_proc_macro: false,
1783
1740
},
1784
1741
CrateId(
1785
- 11 ,
1742
+ 10 ,
1786
1743
): CrateData {
1787
1744
root_file_id: FileId(
1788
- 12 ,
1745
+ 11 ,
1789
1746
),
1790
1747
edition: Edition2018,
1791
1748
version: None,
@@ -1836,7 +1793,7 @@ fn rust_project_hello_world_project_model() {
1836
1793
},
1837
1794
Dependency {
1838
1795
crate_id: CrateId(
1839
- 9 ,
1796
+ 8 ,
1840
1797
),
1841
1798
name: CrateName(
1842
1799
"test",
You can’t perform that action at this time.
0 commit comments