diff options
| author | bors <bors@rust-lang.org> | 2014-12-24 20:47:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-12-24 20:47:12 +0000 |
| commit | 7e11b22713aebd28ceaaa2ecef937c9b9d247c2f (patch) | |
| tree | 10885e6c690c4786c1eddab369ba92090732ddf8 /src/libstd | |
| parent | 14597f980a19aad66cd72e9ac4b6cd43b24ea5f4 (diff) | |
| parent | 85c1a4b1ba09dae786b3554e0ab596814efabe0e (diff) | |
| download | rust-7e11b22713aebd28ceaaa2ecef937c9b9d247c2f.tar.gz rust-7e11b22713aebd28ceaaa2ecef937c9b9d247c2f.zip | |
auto merge of #20117 : lfairy/rust/rename-include-bin, r=alexcrichton
According to [RFC 344][], methods that return `&[u8]` should have names ending in `bytes`. Though `include_bin!` is a macro not a method, it seems reasonable to follow the convention anyway. We keep the old name around for now, but trigger a deprecation warning when it is used. [RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md [breaking-change]
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/macros.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 3d03b5324b9..d90a47ea4ea 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -621,10 +621,14 @@ pub mod builtin { /// # Example /// /// ```rust,ignore - /// let secret_key = include_bin!("secret-key.bin"); + /// let secret_key = include_bytes!("secret-key.bin"); /// ``` #[macro_export] - macro_rules! include_bin { ($file:expr) => ({ /* compiler built-in */ }) } + macro_rules! include_bytes { ($file:expr) => ({ /* compiler built-in */ }) } + + /// Deprecated alias for `include_bytes!()`. + #[macro_export] + macro_rules! include_bin { ($file:expr) => ({ /* compiler built-in */}) } /// Expands to a string that represents the current module path. /// |
