@@ -15,7 +15,7 @@ clear as to what is going on.
15
15
16
16
Here's a brief summary:
17
17
18
- * ` extern crate ` is no longer needed
18
+ * ` extern crate ` is no longer needed in 99% of circumstances.
19
19
* The ` crate ` keyword refers to the current crate.
20
20
* Absolute paths begin with a crate name, where the keyword ` crate `
21
21
refers to the current crate.
@@ -66,6 +66,32 @@ keep doing what you were doing there as well.
66
66
> One small note here: ` cargo fix ` will not currently automate this change. We may
67
67
> have it do this for you in the future.
68
68
69
+ #### An exception
70
+
71
+ There's one exception to this rule, and that's the "sysroot" crates. These are the
72
+ crates distributed with Rust itself. We'd eventually like to remove the requirement
73
+ for ` extern crate ` for them as well, but it hasn't shipped yet.
74
+
75
+ You'll need to use ` extern crate ` for:
76
+
77
+ * ` proc_macro `
78
+
79
+ Additionally, you would need to use it for:
80
+
81
+ * ` core `
82
+ * ` std `
83
+
84
+ However, ` extern crate std; ` is already implicit, and with ` #![no_std] ` ,
85
+ ` extern crate core; ` is already implicit. You'll only need these in highly
86
+ specialized situations.
87
+
88
+ Finally, on nightly, you'll need it for crates like:
89
+
90
+ * ` alloc `
91
+ * ` test `
92
+
93
+ #### Macros
94
+
69
95
One other use for ` extern crate ` was to import macros; that's no longer needed.
70
96
Check [ the macro section] ( ../macros/macro-changes.html ) for more.
71
97
0 commit comments