8000 Rollup of 15 pull requests by jonas-schievink · Pull Request #81528 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 15 pull requests #81528

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

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8539425
Stabilize unsigned_abs
jhpratt Jan 13, 2021
edf2e37
Use unsigned_abs throughout repository
jhpratt Jan 13, 2021
0c8db16
Add `core::stream::Stream`
yoshuawuyts Nov 13, 2020
e94cf57
Make functional record update/struct update syntax works inside closu…
null-sleep Jan 23, 2021
a1b1132
Remove `Stream::next`
yoshuawuyts Jan 15, 2021
d00c850
BTreeMap: correct tests for alternative choices of B
ssomers Jan 20, 2021
328abfb
Slight simplification of chars().count()
gilescope Jan 26, 2021
425a70a
Removing if so it's more like the previous implementation.
gilescope Jan 26, 2021
c07e558
Let's try the most idiomatic way.
gilescope Jan 26, 2021
a623ea5
Same instructions, but simpler.
gilescope Jan 26, 2021
5d73918
Clone entire `TokenCursor` when collecting tokens
Aaron1011 Jan 28, 2021
ad14924
path trimming: ignore type aliases
da-x Jan 28, 2021
9dc0d1d
path trimming: disable on src/test/run-make-fulldeps/coverage-spanview
da-x Jan 28, 2021
a6fa92c
Balance sidebar `Deref` cycle check with main content
jryans Jan 28, 2021
f620b5c
rustdoc: Remove unnecessary optional
camelid Jan 29, 2021
02094f9
Updated Vec::splice documentation
SOF3 Jan 29, 2021
5e983d7
Add a test for syntax like: ..t.s
null-sleep Jan 29, 2021
63714af
update rustfmt to v1.4.34
calebcartwright Jan 29, 2021
d8b5745
Treat nightlies for a version as complete
est31 Jan 28, 2021
dd18c48
Add tests
est31 Jan 28, 2021
08141a5
Add missiong variants in match binding
GuillaumeGomez Jan 29, 2021
13ffa43
rename raw_const/mut -> const/mut_addr_of, and stabilize them
RalfJung Jan 10, 2021
718398c
Fix typo in pat.rs
eltociear Jan 29, 2021
da4fd09
Rollup merge of #78052 - da-x:path-trimming-type-aliases, r=davidtwco
jonas-schievink Jan 29, 2021
8f90b9e
Rollup merge of #79023 - yoshuawuyts:stream, r=KodrAus
jonas-schievink Jan 29, 2021
4474fda
Rollup merge of #80886 - RalfJung:stable-raw-ref-macros, r=m-ou-se
jonas-schievink Jan 29, 2021
a4cf9bb
Rollup merge of #80959 - jhpratt:unsigned_abs-stabilization, r=m-ou-se
jonas-schievink Jan 29, 2021
73ac725
Rollup merge of #81210 - ssomers:btree_fix_node_size_test, r=Mark-Sim…
jonas-schievink Jan 29, 2021
889677f
Rollup merge of #81291 - sexxi-goose:fix-struct-update-functional-rec…
jonas-schievink Jan 29, 2021
fe2f55e
Rollup merge of #81409 - gilescope:chars_count, r=joshtriplett
jonas-schievink Jan 29, 2021
e768518
Rollup merge of #81468 - est31:cfg_version, r=petrochenkov
jonas-schievink Jan 29, 2021
0529214
Rollup merge of #81472 - Aaron1011:fix/revert-cursor-clone, r=petroch…
jonas-schievink Jan 29, 2021
a58360f
Rollup merge of #81491 - jryans:rustdoc-deref-ice-81395, r=GuillaumeG…
jonas-schievink Jan 29, 2021
6713e54
Rollup merge of #81495 - camelid:rustdoc-output_format-optional, r=Gu…
jonas-schievink Jan 29, 2021
aa78077
Rollup merge of #81499 - SOF3:patch-1, r=sanxiyn
jonas-schievink Jan 29, 2021
d53ab4c
Rollup merge of #81501 - calebcartwright:update-rustfmt, r=sanxiyn
jonas-schievink Jan 29, 2021
2caf1aa
Rollup merge of #81512 - GuillaumeGomez:cleanup-fixme-rustdoc, r=buga…
jonas-schievink Jan 29, 2021
6d3d7f8
Rollup merge of #81515 - eltociear:patch-7, r=jonas-schievink
jonas-schievink Jan 29, 2021
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
26 changes: 17 additions & 9 deletions src/librustdoc/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ crate enum OutputFormat {
Html,
}

impl Default for OutputFormat {
fn default() -> OutputFormat {
OutputFormat::Html
}
}

impl OutputFormat {
crate fn is_json(&self) -> bool {
matches!(self, OutputFormat::Json)
Expand Down Expand Up @@ -118,7 +124,7 @@ crate struct Options {
crate enable_per_target_ignores: bool,

/// The path to a rustc-like binary to build tests with. If not set, we
/// default to loading from $sysroot/bin/rustc.
/// default to loading from `$sysroot/bin/rustc`.
crate test_builder: Option<PathBuf>,

// Options that affect the documentation process
Expand All @@ -142,8 +148,10 @@ crate struct Options {
crate crate_version: Option<String>,
/// Collected options specific to outputting final pages.
crate render_options: RenderOptions,
/// Output format rendering (used only for "show-coverage" option for the moment)
crate output_format: Option<OutputFormat>,
/// The format that we output when rendering.
///
/// Currently used only for the `--show-coverage` option.
crate output_format: OutputFormat,
/// If this option is set to `true`, rustdoc will only run checks and not generate
/// documentation.
crate run_check: bool,
Expand Down Expand Up @@ -271,7 +279,7 @@ crate struct RenderInfo {
crate deref_trait_did: Option<DefId>,
crate deref_mut_trait_did: Option<DefId>,
crate owned_box_did: Option<DefId>,
crate output_format: Option<OutputFormat>,
crate output_format: OutputFormat,
}

impl Options {
Expand Down Expand Up @@ -537,28 +545,28 @@ impl Options {

let output_format = match matches.opt_str("output-format") {
Some(s) => match OutputFormat::try_from(s.as_str()) {
Ok(o) => {
if o.is_json()
Ok(out_fmt) => {
if out_fmt.is_json()
&& !(show_coverage || nightly_options::match_is_nightly_build(matches))
{
diag.struct_err("json output format isn't supported for doc generation")
.emit();
return Err(1);
} else if !o.is_json() && show_coverage {
} else if !out_fmt.is_json() && show_coverage {
diag.struct_err(
"html output format isn't supported for the --show-coverage option",
)
.emit();
return Err(1);
}
Some(o)
out_fmt
}
Err(e) => {
diag.struct_err(&e).emit();
return Err(1);
}
},
None => None,
None => OutputFormat::default(),
};
let crate_name = matches.opt_str("crate-name");
let proc_macro_crate = crate_types.contains(&CrateType::ProcMacro);
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ crate fn run_global_ctxt(
mut default_passes: passes::DefaultPassOption,
mut manual_passes: Vec<String>,
render_options: RenderOptions,
output_format: Option<OutputFormat>,
output_format: OutputFormat,
) -> (clean::Crate, RenderInfo, RenderOptions) {
// Certain queries assume that some checks were run elsewhere
// (see https://github.com/rust-lang/rust/pull/73566#issuecomment-656954425),
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ fn main_options(options: config::Options) -> MainResult {
let (error_format, edition, debugging_options) = diag_opts;
let diag = core::new_handler(error_format, None, &debugging_options);
match output_format {
None | Some(config::OutputFormat::Html) => sess.time("render_html", || {
config::OutputFormat::Html => sess.time("render_html", || {
run_renderer::<html::render::Context<'_>>(
krate,
render_opts,
Expand All @@ -588,7 +588,7 @@ fn main_options(options: config::Options) -> MainResult {
tcx,
)
}),
Some(config::OutputFormat::Json) => sess.time("render_json", || {
config::OutputFormat::Json => sess.time("render_json", || {
run_renderer::<json::JsonRenderer<'_>>(
krate,
render_opts,
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/passes/calculate_doc_coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl<'a, 'b> CoverageCalculator<'a, 'b> {

fn print_results(&self) {
let output_format = self.ctx.renderinfo.borrow().output_format;
if output_format.map(|o| o.is_json()).unwrap_or_else(|| false) {
if output_format.is_json() {
println!("{}", self.to_json());
return;
}
Expand Down
0