@@ -853,6 +853,20 @@ extern crate std; // equivalent to: extern crate std as std;
853
853
extern crate std as ruststd; // linking to 'std' under another name
854
854
```
855
855
856
+ When naming Rust crates, hyphens are disallowed. However, Cargo packages may
857
+ make use of them. In such case, when ` Cargo.toml ` doesn't specify a crate name,
858
+ Cargo will transparently replace ` - ` with ` _ ` (Refer to [ RFC 940] for more
859
+ details).
860
+
861
+ Here is an example:
862
+
863
+ ``` {.ignore}
864
+ // Importing the Cargo package hello-world
865
+ extern crate hello_world; // hyphen replaced with an underscore
866
+ ```
867
+
868
+ [ RFC 940 ] : https://github.com/rust-lang/rfcs/blob/master/text/0940-hyphens-considered-harmful.md
869
+
856
870
#### Use declarations
857
871
858
872
A _ use declaration_ creates one or more local name bindings synonymous with
@@ -3744,9 +3758,9 @@ Since `'static` "lives longer" than `'a`, `&'static str` is a subtype of
3744
3758
3745
3759
## Type coercions
3746
3760
3747
- Coercions are defined in [ RFC401 ] . A coercion is implicit and has no syntax.
3761
+ Coercions are defined in [ RFC 401 ] . A coercion is implicit and has no syntax.
3748
3762
3749
- [ RFC401 ] : https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
3763
+ [ RFC 401 ] : https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
3750
3764
3751
3765
### Coercion sites
3752
3766
@@ -3886,7 +3900,7 @@ Coercion is allowed between the following types:
3886
3900
3887
3901
In the future, coerce_inner will be recursively extended to tuples and
3888
3902
structs. In addition, coercions from sub-traits to super-traits will be
3889
- added. See [ RFC401 ] for more details.
3903
+ added. See [ RFC 401 ] for more details.
3890
3904
3891
3905
# Special traits
3892
3906
0 commit comments