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 9 pull requests #74543

Merged
merged 25 commits into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
249e07b
Short documentation for the false keyword
poliorcetics Jun 24, 2020
d88cce2
Add a link to read in the read_exact doc about the guarantees
poliorcetics Jul 18, 2020
e88220f
Fix small nit in the link to read
poliorcetics Jul 19, 2020
455e614
do not try fetching the ancestors of errored trait impls
lcnr Jul 19, 2020
b7bf3c8
Remove useless link to bool primitive
poliorcetics Jul 19, 2020
a459fc4
Apply suggestions from review
poliorcetics Jul 19, 2020
be43319
Do not clobber RUSTDOCFLAGS
Mark-Simulacrum Jul 19, 2020
d7a36d8
include backtrace folder in rust-src component
RalfJung Jul 19, 2020
a462e7c
Document `core::fmt::rt::v1::Count`
sollyucko Jul 19, 2020
7dba34f
tools: update rustfmt toolstate maintainers
calebcartwright Jul 19, 2020
471dd52
Fix merge conflict with recent PR
poliorcetics Jul 19, 2020
e24a017
Only skip impls of foreign unstable traits
Mark-Simulacrum Jul 19, 2020
940ceb1
Mentioned IntoIterator earlier in keyword 'for' docs
Nicholas-Baron Jul 19, 2020
6c493df
Mentioned IntoIterator in keyword 'in' docs
Nicholas-Baron Jul 19, 2020
f268525
Linked the earlier mention of IntoIterator in the keyword 'for' docs
Nicholas-Baron Jul 19, 2020
09d5529
Update src/libstd/keyword_docs.rs
Nicholas-Baron Jul 20, 2020
d527c7d
Rollup merge of #73618 - poliorcetics:false-keyword, r=jyn514
Manishearth Jul 20, 2020
03a4727
Rollup merge of #74486 - poliorcetics:read-exact-doc-point-to-read, r…
Manishearth Jul 20, 2020
3981386
Rollup merge of #74514 - Mark-Simulacrum:nightly-rustc-docs, r=ollie27
Manishearth Jul 20, 2020
55c4057
Rollup merge of #74516 - lcnr:min-specialization-ice, r=matthewjasper
Manishearth Jul 20, 2020
42f6ed4
Rollup merge of #74520 - RalfJung:backtrace-src, r=Mark-Simulacrum
Manishearth Jul 20, 2020
e762f97
Rollup merge of #74523 - sollyucko:patch-1, r=Mark-Simulacrum
Manishearth Jul 20, 2020
42273f6
Rollup merge of #74527 - calebcartwright:rustfmt-toolstate-maintainer…
Manishearth Jul 20, 2020
e8fc993
Rollup merge of #74534 - Mark-Simulacrum:rustdoc-stability, r=Manishe…
Manishearth Jul 20, 2020
27947b6
Rollup merge of #74536 - Nicholas-Baron:master, r=joshtriplett
Manishearth Jul 20, 2020
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
7 changes: 7 additions & 0 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,10 @@ pub struct Cargo {
}

impl Cargo {
pub fn rustdocflag(&mut self, arg: &str) -> &mut Cargo {
self.rustdocflags.arg(arg);
self
}
pub fn rustflag(&mut self, arg: &str) -> &mut Cargo {
self.rustflags.arg(arg);
self
Expand All @@ -1466,6 +1470,9 @@ impl Cargo {
}

pub fn env(&mut self, key: impl AsRef<OsStr>, value: impl AsRef<OsStr>) -> &mut Cargo {
// These are managed through rustflag/rustdocflag interfaces.
assert_ne!(key.as_ref(), "RUSTFLAGS");
assert_ne!(key.as_ref(), "RUSTDOCFLAGS");
self.command.env(key.as_ref(), value.as_ref());
self
}
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ impl Step for Src {
// (essentially libstd and all of its path dependencies)
let std_src_dirs = [
"src/build_helper",
"src/backtrace",
"src/liballoc",
"src/libcore",
"src/libpanic_abort",
Expand Down
10 changes: 4 additions & 6 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,9 @@ impl Step for Rustc {

// Build cargo command.
let mut cargo = builder.cargo(compiler, Mode::Rustc, SourceType::InTree, target, "doc");
cargo.env(
"RUSTDOCFLAGS",
"--document-private-items \
--enable-index-page -Zunstable-options",
);
cargo.rustdocflag("--document-private-items");
cargo.rustdocflag("--enable-index-page");
cargo.rustdocflag("-Zunstable-options");
compile::rustc_cargo(builder, &mut cargo, target);

// Only include compiler crates, no dependencies of those, such as `libc`.
Expand Down Expand Up @@ -624,7 +622,7 @@ impl Step for Rustdoc {
cargo.arg("--no-deps");
cargo.arg("-p").arg("rustdoc");

cargo.env("RUSTDOCFLAGS", "--document-private-items");
cargo.rustdocflag("--document-private-items");
builder.run(&mut cargo.into());
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/libcore/fmt/rt/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ pub enum Alignment {
Unknown,
}

/// Used by [width](https://doc.rust-lang.org/std/fmt/#width) and [precision](https://doc.rust-lang.org/std/fmt/#precision) specifiers.
#[derive(Copy, Clone)]
pub enum Count {
/// Specified with a literal number, stores the value
Is(usize),
/// Specified using `$` and `*` syntaxes, stores the index into `args`
Param(usize),
/// Not specified
Implied,
}
4 changes: 3 additions & 1 deletion src/librustc_middle/traits/specialization_graph.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::ich::{self, StableHashingContext};
use crate::ty::fast_reject::SimplifiedType;
use crate::ty::fold::TypeFoldable;
use crate::ty::{self, TyCtxt};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
Expand Down Expand Up @@ -226,7 +227,8 @@ pub fn ancestors(
start_from_impl: DefId,
) -> Result<Ancestors<'tcx>, ErrorReported> {
let specialization_graph = tcx.specialization_graph_of(trait_def_id);
if specialization_graph.has_errored {

if specialization_graph.has_errored || tcx.type_of(start_from_impl).references_error() {
Err(ErrorReported)
} else {
Ok(Ancestors {
Expand Down
8 changes: 5 additions & 3 deletions src/librustdoc/clean/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,11 @@ pub fn build_impl(
// such. This helps prevent dependencies of the standard library, for
// example, from getting documented as "traits `u32` implements" which
// isn't really too helpful.
if let Some(stab) = cx.tcx.lookup_stability(did) {
if stab.level.is_unstable() {
return;
if let Some(trait_did) = associated_trait {
if let Some(stab) = cx.tcx.lookup_stability(trait_did.def_id) {
if stab.level.is_unstable() {
return;
}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/libstd/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,9 @@ pub trait Read {
/// No guarantees are provided about the contents of `buf` when this
/// function is called, implementations cannot rely on any property of the
/// contents of `buf` being true. It is recommended that implementations
/// only write data to `buf` instead of reading its contents.
/// only write data to `buf` instead of reading its contents. The
/// documentation on [`read`] has a more detailed explanation on this
/// subject.
///
/// # Errors
///
Expand All @@ -745,6 +747,7 @@ pub trait Read {
///
/// [`File`]s implement `Read`:
///
/// [`read`]: Read::read
/// [`File`]: crate::fs::File
///
/// ```no_run
Expand Down
15 changes: 8 additions & 7 deletions src/libstd/keyword_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,11 @@ mod extern_keyword {}
//
/// A value of type [`bool`] representing logical **false**.
///
/// The documentation for this keyword is [not yet complete]. Pull requests welcome!
/// `false` is the logical opposite of [`true`].
///
/// [`bool`]: primitive.bool.html
/// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
/// See the documentation for [`true`] for more information.
///
/// [`true`]: keyword.true.html
mod false_keyword {}

#[doc(keyword = "fn")]
Expand Down Expand Up @@ -473,8 +474,8 @@ mod fn_keyword {}
/// * `for` is also used for [higher-ranked trait bounds] as in `for<'a> &'a T: PartialEq<i32>`.
///
/// for-in-loops, or to be more precise, iterator loops, are a simple syntactic sugar over a common
/// practice within Rust, which is to loop over an iterator until that iterator returns `None` (or
/// `break` is called).
/// practice within Rust, which is to loop over anything that implements [`IntoIterator`] until the
/// iterator returned by `.into_iter()` returns `None` (or the loop body uses `break`).
///
/// ```rust
/// for i in 0..5 {
Expand Down Expand Up @@ -680,7 +681,7 @@ mod impl_keyword {}
//
/// Iterate over a series of values with [`for`].
///
/// The expression immediately following `in` must implement the [`Iterator`] trait.
/// The expression immediately following `in` must implement the [`IntoIterator`] trait.
///
/// ## Literal Examples:
///
Expand All @@ -689,7 +690,7 @@ mod impl_keyword {}
///
/// (Read more about [range patterns])
///
/// [`Iterator`]: ../book/ch13-04-performance.html
/// [`IntoIterator`]: ../book/ch13-04-performance.html
/// [range patterns]: ../reference/patterns.html?highlight=range#range-patterns
/// [`for`]: keyword.for.html
mod in_keyword {}
Expand Down
26 changes: 26 additions & 0 deletions src/test/rustdoc/auxiliary/unstable-trait.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#![feature(staged_api)]
#![stable(feature = "private_general", since = "1.0.0")]

#[unstable(feature = "private_trait", issue = "none")]
pub trait Bar {}

#[stable(feature = "private_general", since = "1.0.0")]
pub struct Foo {
// nothing
}

impl Foo {
#[stable(feature = "private_general", since = "1.0.0")]
pub fn stable_impl() {}
}

impl Foo {
#[unstable(feature = "private_trait", issue = "none")]
pub fn bar() {}

#[stable(feature = "private_general", since = "1.0.0")]
pub fn bar2() {}
}

#[stable(feature = "private_general", since = "1.0.0")]
impl Bar for Foo {}
11 changes: 11 additions & 0 deletions src/test/rustdoc/hide-unstable-trait.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// aux-build:unstable-trait.rs

#![crate_name = "foo"]
#![feature(private_trait)]

extern crate unstable_trait;

// @has foo/struct.Foo.html 'bar'
// @has foo/struct.Foo.html 'bar2'
#[doc(inline)]
pub use unstable_trait::Foo;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#![feature(min_specialization)]

trait Trait {}
impl Trait for NonExistent {}
//~^ ERROR cannot find type `NonExistent` in this scope

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0412]: cannot find type `NonExistent` in this scope
--> $DIR/impl-on-nonexisting.rs:4:16
|
LL | impl Trait for NonExistent {}
| ^^^^^^^^^^^ not found in this scope

error: aborting due to previous error

For more information about this error, try `rustc --explain E0412`.
2 changes: 1 addition & 1 deletion src/tools/publish_toolstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
MAINTAINERS = {
'miri': {'oli-obk', 'RalfJung', 'eddyb'},
'rls': {'Xanewok'},
'rustfmt': {'topecongiro'},
'rustfmt': {'topecongiro', 'calebcartwright'},
'book': {'carols10cents', 'steveklabnik'},
'nomicon': {'frewsxcv', 'Gankra'},
'reference': {'steveklabnik', 'Havvy', 'matthewjasper', 'ehuss'},
Expand Down