@@ -845,6 +845,20 @@ extern crate std; // equivalent to: extern crate std as std;
845
845
extern crate std as ruststd; // linking to 'std' under another name
846
846
```
847
847
848
+ When naming Rust crates, hyphens are disallowed. However, Cargo packages may
849
+ make use of them. In such case, when ` cargo.toml ` doesn't specify a crate name,
850
+ Cargo will transparently replace ` - ` with ` _ ` (Refer to [ RFC 940] for more
851
+ details).
852
+
853
+ Here is an example:
854
+
855
+ ``` {.ignore}
856
+ // Importing the Cargo package hello-world/
857
+ extern crate hello_world; // The crate name replaced the hyphen
858
+ ```
859
+
860
+ [ RFC 940 ] : https://github.com/rust-lang/rfcs/blob/master/text/0940-hyphens-considered-harmful.md
861
+
848
862
#### Use declarations
849
863
850
864
A _ use declaration_ creates one or more local name bindings synonymous with
@@ -3720,9 +3734,9 @@ Since `'static` "lives longer" than `'a`, `&'static str` is a subtype of
3720
3734
3721
3735
## Type coercions
3722
3736
3723
- Coercions are defined in [ RFC401 ] . A coercion is implicit and has no syntax.
3737
+ Coercions are defined in [ RFC 401 ] . A coercion is implicit and has no syntax.
3724
3738
3725
- [ RFC401 ] : https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
3739
+ [ RFC 401 ] : https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
3726
3740
3727
3741
### Coercion sites
3728
3742
@@ -3862,7 +3876,7 @@ Coercion is allowed between the following types:
3862
3876
3863
3877
In the future, coerce_inner will be recursively extended to tuples and
3864
3878
structs. In addition, coercions from sub-traits to super-traits will be
3865
- added. See [ RFC401 ] for more details.
3879
+ added. See [ RFC 401 ] for more details.
3866
3880
3867
3881
# Special traits
3868
3882
0 commit comments