Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #40950

Merged
merged 24 commits into from
Mar 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2cf686f
Implement AsRawFd/IntoRawFd for RawFd
Mic92 Mar 26, 2017
2040dae
Make the rustdoc sidebar white on `src` pages
wesleywiser Mar 24, 2017
950d669
Remove unused feature from error index generator
MaloJaffre Mar 29, 2017
022bae8
Add example to std::process::abort
rap2hpoutre Mar 29, 2017
3ac27c3
adding ///
rap2hpoutre Mar 29, 2017
5a7e9ad
Removing trailing spaces
rap2hpoutre Mar 29, 2017
b36cff5
Improve os::linux documentation (#29367)
Mar 27, 2017
1be84ce
Update process.rs
rap2hpoutre Mar 30, 2017
8804a4a
Add missing link in unstable-book
DaseinPhaos Mar 30, 2017
f827054
adding debug in consume_body function
GAJaloyan Mar 30, 2017
ea28196
removing trailing whitespaces
GAJaloyan Mar 30, 2017
6fda0fe
cmp: Implement all PartialOrd methods for Reverse
bluss Mar 30, 2017
b03edb4
Improve the docs for the write and writeln macros
SamWhited Mar 30, 2017
eef2a95
Sync all unstable features with Unstable Book; add tidy lint.
frewsxcv Mar 19, 2017
d2128fd
Rollup merge of #40694 - frewsxcv:unstable-book-checker, r=steveklabnik
frewsxcv Mar 31, 2017
eeb075a
Rollup merge of #40842 - Mic92:RawFd, r=aturon
frewsxcv Mar 31, 2017
7ccd0b9
Rollup merge of #40869 - ctjhoa:master, r=steveklabnik
frewsxcv Mar 31, 2017
488a7b3
Rollup merge of #40888 - wesleywiser:rustdoc_src_sidebar, r=Guillaume…
frewsxcv Mar 31, 2017
5f1bb8f
Rollup merge of #40898 - MaloJaffre:remove-unused-feature, r=alexcric…
frewsxcv Mar 31, 2017
fe34818
Rollup merge of #40904 - rap2hpoutre:patch-1, r=steveklabnik
frewsxcv Mar 31, 2017
4af41b4
Rollup merge of #40925 - DaseinPhaos:patch-5, r=steveklabnik
frewsxcv Mar 31, 2017
c650ed8
Rollup merge of #40928 - GAJaloyan:patch-2, r=eddyb
frewsxcv Mar 31, 2017
d36b24d
Rollup merge of #40929 - bluss:full-reverse, r=alexcrichton
frewsxcv Mar 31, 2017
c34f533
Rollup merge of #40934 - SamWhited:improve_write_writeln_docs, r=stev…
frewsxcv Mar 31, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/doc/unstable-book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@
- [proc_macro](proc-macro.md)
- [proc_macro_internals](proc-macro-internals.md)
- [process_try_wait](process-try-wait.md)
- [pub_restricted](pub-restricted.md)
- [question_mark_carrier](question-mark-carrier.md)
- [quote](quote.md)
- [rand](rand.md)
Expand All @@ -156,11 +155,11 @@
- [relaxed_adts](relaxed-adts.md)
- [repr_simd](repr-simd.md)
- [retain_hash_collection](retain-hash-collection.md)
- [reverse_cmp_key](reverse-cmp-key.md)
- [rt](rt.md)
- [rustc_attrs](rustc-attrs.md)
- [rustc_diagnostic_macros](rustc-diagnostic-macros.md)
- [rustc_private](rustc-private.md)
- [rustdoc](rustdoc.md)
- [rvalue_static_promotion](rvalue-static-promotion.md)
- [sanitizer_runtime](sanitizer-runtime.md)
- [sanitizer_runtime_lib](sanitizer-runtime-lib.md)
Expand All @@ -181,6 +180,7 @@
- [step_by](step-by.md)
- [step_trait](step-trait.md)
- [stmt_expr_attributes](stmt-expr-attributes.md)
- [str_checked_slicing](str-checked-slicing.md)
- [str_escape](str-escape.md)
- [str_internals](str-internals.md)
- [struct_field_attributes](struct-field-attributes.md)
Expand Down
7 changes: 0 additions & 7 deletions src/doc/unstable-book/src/pub-restricted.md

This file was deleted.

7 changes: 7 additions & 0 deletions src/doc/unstable-book/src/reverse-cmp-key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# `reverse_cmp_key`

The tracking issue for this feature is: [#40893]

[#40893]: https://github.com/rust-lang/rust/issues/40893

------------------------
7 changes: 0 additions & 7 deletions src/doc/unstable-book/src/rustdoc.md

This file was deleted.

2 changes: 2 additions & 0 deletions src/doc/unstable-book/src/specialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

The tracking issue for this feature is: [#31844]

[#31844]: https://github.com/rust-lang/rust/issues/31844

------------------------


Expand Down
7 changes: 7 additions & 0 deletions src/doc/unstable-book/src/str-checked-slicing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# `str_checked_slicing`

The tracking issue for this feature is: [#39932]

[#39932]: https://github.com/rust-lang/rust/issues/39932

------------------------
9 changes: 9 additions & 0 deletions src/libcore/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,15 @@ impl<T: PartialOrd> PartialOrd for Reverse<T> {
fn partial_cmp(&self, other: &Reverse<T>) -> Option<Ordering> {
other.0.partial_cmp(&self.0)
}

#[inline]
fn lt(&self, other: &Self) -> bool { other.0 < self.0 }
#[inline]
fn le(&self, other: &Self) -> bool { other.0 <= self.0 }
#[inline]
fn ge(&self, other: &Self) -> bool { other.0 >= self.0 }
#[inline]
fn gt(&self, other: &Self) -> bool { other.0 > self.0 }
}

#[unstable(feature = "reverse_cmp_key", issue = "40893")]
Expand Down
54 changes: 16 additions & 38 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,27 +337,20 @@ macro_rules! try {

/// Write formatted data into a buffer
///
/// This macro accepts a 'writer' (any value with a `write_fmt` method), a format string, and a
/// list of arguments to format.
/// This macro accepts a format string, a list of arguments, and a 'writer'. Arguments will be
/// formatted according to the specified format string and the result will be passed to the writer.
/// The writer may be any value with a `write_fmt` method; generally this comes from an
/// implementation of either the [`std::fmt::Write`] or the [`std::io::Write`] trait. The macro
/// returns whatever the 'write_fmt' method returns; commonly a [`std::fmt::Result`], or an
/// [`io::Result`].
///
/// The `write_fmt` method usually comes from an implementation of [`std::fmt::Write`][fmt_write]
/// or [`std::io::Write`][io_write] traits. The term 'writer' refers to an implementation of one of
/// these two traits.
/// See [`std::fmt`] for more information on the format string syntax.
///
/// Passed arguments will be formatted according to the specified format string and the resulting
/// string will be passed to the writer.
///
/// See [`std::fmt`][fmt] for more information on format syntax.
///
/// `write!` returns whatever the 'write_fmt' method returns.
///
/// Common return values include: [`fmt::Result`][fmt_result], [`io::Result`][io_result]
///
/// [fmt]: ../std/fmt/index.html
/// [fmt_write]: ../std/fmt/trait.Write.html
/// [io_write]: ../std/io/trait.Write.html
/// [fmt_result]: ../std/fmt/type.Result.html
/// [io_result]: ../std/io/type.Result.html
/// [`std::fmt`]: ../std/fmt/index.html
/// [`std::fmt::Write`]: ../std/fmt/trait.Write.html
/// [`std::io::Write`]: ../std/io/trait.Write.html
/// [`std::fmt::Result`]: ../std/fmt/type.Result.html
/// [`io::Result`]: ../std/io/type.Result.html
///
/// # Examples
///
Expand Down Expand Up @@ -396,27 +389,12 @@ macro_rules! write {
/// On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`) alone
/// (no additional CARRIAGE RETURN (`\r`/`U+000D`).
///
/// This macro accepts a 'writer' (any value with a `write_fmt` method), a format string, and a
/// list of arguments to format.
///
/// The `write_fmt` method usually comes from an implementation of [`std::fmt::Write`][fmt_write]
/// or [`std::io::Write`][io_write] traits. The term 'writer' refers to an implementation of one of
/// these two traits.
///
/// Passed arguments will be formatted according to the specified format string and the resulting
/// string will be passed to the writer, along with the appended newline.
///
/// See [`std::fmt`][fmt] for more information on format syntax.
///
/// `write!` returns whatever the 'write_fmt' method returns.
/// For more information, see [`write!`]. For information on the format string syntax, see
/// [`std::fmt`].
///
/// Common return values include: [`fmt::Result`][fmt_result], [`io::Result`][io_result]
/// [`write!`]: macro.write.html
/// [`std::fmt`]: ../std/fmt/index.html
///
/// [fmt]: ../std/fmt/index.html
/// [fmt_write]: ../std/fmt/trait.Write.html
/// [io_write]: ../std/io/trait.Write.html
/// [fmt_result]: ../std/fmt/type.Result.html
/// [io_result]: ../std/io/type.Result.html
///
/// # Examples
///
Expand Down
2 changes: 2 additions & 0 deletions src/librustc/middle/expr_use_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
}

pub fn consume_body(&mut self, body: &hir::Body) {
debug!("consume_body(body={:?})", body);

for arg in &body.arguments {
let arg_ty = return_if_err!(self.mc.infcx.node_ty(arg.pat.id));

Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/html/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ r##"<!DOCTYPE html>
{favicon}
{in_header}
</head>
<body class="rustdoc">
<body class="rustdoc {css_class}">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
Expand All @@ -80,7 +80,7 @@ r##"<!DOCTYPE html>
</form>
</nav>

<section id='main' class="content {css_class}">{content}</section>
<section id='main' class="content">{content}</section>
<section id='search' class="content hidden"></section>

<section class="footer"></section>
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ pre {
padding: 14px;
}

.source pre {
.source .content pre {
padding: 20px;
}

img {
max-width: 100%;
}

.content.source {
.source .content {
margin-top: 50px;
max-width: none;
overflow: visible;
Expand Down Expand Up @@ -231,7 +231,7 @@ nav.sub {
padding: 15px 0;
}

.content.source pre.rust {
.source .content pre.rust {
white-space: pre;
overflow: auto;
padding-left: 0;
Expand Down
4 changes: 4 additions & 0 deletions src/librustdoc/html/static/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ pre {
background-color: #fff;
}

.source .sidebar {
background-color: #fff;
}

.sidebar .location {
border-color: #000;
background-color: #fff;
Expand Down
19 changes: 19 additions & 0 deletions src/libstd/os/linux/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,36 +34,55 @@ pub trait MetadataExt {
#[allow(deprecated)]
fn as_raw_stat(&self) -> &raw::stat;

/// Returns the device ID on which this file resides.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_dev(&self) -> u64;
/// Returns the inode number.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_ino(&self) -> u64;
/// Returns the file type and mode.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_mode(&self) -> u32;
/// Returns the number of hard links to file.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_nlink(&self) -> u64;
/// Returns the user ID of the file owner.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_uid(&self) -> u32;
/// Returns the group ID of the file owner.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_gid(&self) -> u32;
/// Returns the device ID that this file represents. Only relevant for special file.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_rdev(&self) -> u64;
/// Returns the size of the file (if it is a regular file or a symbolic link) in bytes.
///
/// The size of a symbolic link is the length of the pathname it contains,
/// without a terminating null byte.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_size(&self) -> u64;
/// Returns the last access time.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_atime(&self) -> i64;
/// Returns the last access time, nano seconds part.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_atime_nsec(&self) -> i64;
/// Returns the last modification time.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_mtime(&self) -> i64;
/// Returns the last modification time, nano seconds part.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_mtime_nsec(&self) -> i64;
/// Returns the last status change time.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_ctime(&self) -> i64;
/// Returns the last status change time, nano seconds part.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_ctime_nsec(&self) -> i64;
/// Returns the "preferred" blocksize for efficient filesystem I/O.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_blksize(&self) -> u64;
/// Returns the number of blocks allocated to the file, 512-byte units.
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_blocks(&self) -> u64;
}
Expand Down
14 changes: 14 additions & 0 deletions src/libstd/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,20 @@ pub fn exit(code: i32) -> ! {
/// will be run. If a clean shutdown is needed it is recommended to only call
/// this function at a known point where there are no more destructors left
/// to run.
///
/// # Examples
///
/// ```no_run
/// use std::process;
///
/// fn main() {
/// println!("aborting");
///
/// process::abort();
///
/// // execution never gets here
/// }
/// ```
#[stable(feature = "process_abort", since = "1.17.0")]
pub fn abort() -> ! {
unsafe { ::sys::abort_internal() };
Expand Down
15 changes: 15 additions & 0 deletions src/libstd/sys/unix/ext/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ pub trait IntoRawFd {
fn into_raw_fd(self) -> RawFd;
}

#[stable(feature = "rust1", since = "1.0.0")]
impl AsRawFd for RawFd {
fn as_raw_fd(&self) -> RawFd {
*self
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl AsRawFd for fs::File {
fn as_raw_fd(&self) -> RawFd {
Expand All @@ -84,6 +91,14 @@ impl FromRawFd for fs::File {
fs::File::from_inner(sys::fs::File::from_inner(fd))
}
}

#[stable(feature = "into_raw_os", since = "1.4.0")]
impl IntoRawFd for RawFd {
fn into_raw_fd(self) -> RawFd {
self
}
}

#[stable(feature = "into_raw_os", since = "1.4.0")]
impl IntoRawFd for fs::File {
fn into_raw_fd(self) -> RawFd {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/error_index_generator/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(rustc_private, rustdoc)]
#![feature(rustc_private)]

extern crate syntax;
extern crate rustdoc;
Expand Down
1 change: 1 addition & 0 deletions src/tools/tidy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ version = "0.1.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]

[dependencies]
regex = "0.2"
Loading