about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-05-27Auto merge of #112025 - matthiaskrgr:rollup-j693v67, r=matthiaskrgrbors-94/+141
Rollup of 6 pull requests Successful merges: - #108630 (Fix docs for `alloc::realloc`) - #109084 (rustc driver: Remove argument 0 before at-expansion to prevent ICE) - #111181 (fix(parse): return unpected when current token is EOF) - #111656 (Use an unbounded lifetime in `String::leak`.) - #111946 (rustdoc: Add `ItemTemplate` trait and related functions to avoid repetitively wrapping existing functions) - #112018 (Clean up usage of `cx.tcx` when `tcx` is already set into a variable) r? `@ghost` `@rustbot` modify labels: rollup
2023-05-27Rollup merge of #112018 - GuillaumeGomez:cleanup-tcx, r=notriddleMatthias Krüger-43/+39
Clean up usage of `cx.tcx` when `tcx` is already set into a variable I discovered a few cases where `cx.tcx` (and equivalents) was used whereas `tcx` was already stored into a variable. In those cases, better to just use `tcx` directly. r? `@notriddle`
2023-05-27Rollup merge of #111946 - nicklimmm:askama-item-template-trait, r=GuillaumeGomezMatthias Krüger-42/+61
rustdoc: Add `ItemTemplate` trait and related functions to avoid repetitively wrapping existing functions Context: https://github.com/rust-lang/rust/pull/111430#discussion_r1200672507 This trait will be used extensively in performing migrations to Askama templates (tracking issue: https://github.com/rust-lang/rust/issues/108868)
2023-05-27Rollup merge of #111656 - finnbear:string_leak_unbounded_lifetime, r=AmanieuMatthias Krüger-2/+2
Use an unbounded lifetime in `String::leak`. Using `'a` instead of `'static` is predicted to make the process of making `String` generic over an allocator easier/less of a breaking change. See: - https://github.com/rust-lang/rust/pull/109814#issuecomment-1550164195 - https://github.com/rust-lang/rust/pull/109814#issuecomment-1550250163 ACP: https://github.com/rust-lang/libs-team/issues/109
2023-05-27Rollup merge of #111181 - bvanjoi:fix-issue-111148, r=davidtwcoMatthias Krüger-1/+13
fix(parse): return unpected when current token is EOF close https://github.com/rust-lang/rust/issues/111148 #111148 panic occurred because [FatalError.raise()](https://github.com/bvanjoi/rust/blob/master/compiler/rustc_parse/src/parser/mod.rs#LL540C3-L540C3) was encountered which caused by `Eof` and `Pound`(the last token) had same span, when parsing `#` in `fn a<<i<Y<w<>#`. <img width="825" alt="image" src="https://user-images.githubusercontent.com/30187863/236612589-9e2c6a0b-18cd-408c-b636-c12a51cbcf1c.png"> There are a few ways to solve this problem: - Change the action assign for [self.last_unexpected_token_span](https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/diagnostics.rs#L592), for example, if current token is `Eof`, then return Error directly. - Avoid triggering the `FatalError` when the current token is `Eof`. I have chosen the second option because executing `expected_one_of_not_found` when the token is `Eof` but not in `ediable` seems reasonable.
2023-05-27Rollup merge of #109084 - dekrain:fix-panic-arg0-expansion, r=petrochenkovMatthias Krüger-5/+24
rustc driver: Remove argument 0 before at-expansion to prevent ICE Under Unix-based operating systems, when I execute rustc by setting argv0 to ``@/dev/null`,` it will expand command-line arguments from this file, leading to an empty arglist, which then triggers an ICE by trying to remove first argument. The panic message is this: ``` thread 'main' panicked at 'range start index 1 out of range for slice of length 0', compiler/rustc_driver/src/lib.rs:972:17 ``` My fix is to remove the first argument before expanding arguments. <details> <summary>Full backtrace</summary> ```sh % (exec -a `@/dev/null` `rustup which rustc`) thread 'main' panicked at 'range start index 1 out of range for slice of length 0', compiler/rustc_driver/src/lib.rs:972:17 stack backtrace: 0: 0x7fcec776659a - std::backtrace_rs::backtrace::libunwind::trace::h595f06c70adcc478 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5 1: 0x7fcec776659a - std::backtrace_rs::backtrace::trace_unsynchronized::h177a0149c76cdde9 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x7fcec776659a - std::sys_common::backtrace::_print_fmt::hc0701fd2c3530c58 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/sys_common/backtrace.rs:65:5 3: 0x7fcec776659a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd4cd115d8750fd6c at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/sys_common/backtrace.rs:44:22 4: 0x7fcec77c839e - core::fmt::write::h93e2f5923c7eca08 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/fmt/mod.rs:1213:17 5: 0x7fcec7756be5 - std::io::Write::write_fmt::h8162dbb45f0b9e62 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/io/mod.rs:1682:15 6: 0x7fcec7766365 - std::sys_common::backtrace::_print::h1835ef8a8f9066da at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/sys_common/backtrace.rs:47:5 7: 0x7fcec7766365 - std::sys_common::backtrace::print::hcb5e6388b9235f41 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/sys_common/backtrace.rs:34:9 8: 0x7fcec776912f - std::panicking::default_hook::{{closure}}::h9c084969ccf9a722 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:267:22 9: 0x7fcec7768e6b - std::panicking::default_hook::h68fa2ba3c3c6c12f at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:286:9 10: 0x7fcecaab56e4 - <rustc_driver[f4ad927b3c57833d]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[d16e85342ea223d9]::ops::function::FnOnce<(&core[d16e85342ea223d9]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0} 11: 0x7fcec776996a - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h4e6ced11e07d8b24 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/alloc/src/boxed.rs:2002:9 12: 0x7fcec776996a - std::panicking::rust_panic_with_hook::h8d5c434518ef298c at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:692:13 13: 0x7fcec77696e9 - std::panicking::begin_panic_handler::{{closure}}::hf33414f5dabf6faf at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:579:13 14: 0x7fcec7766a4c - std::sys_common::backtrace::__rust_end_short_backtrace::hc50389427413bb75 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/sys_common/backtrace.rs:137:18 15: 0x7fcec77693f2 - rust_begin_unwind at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:575:5 16: 0x7fcec77c4d43 - core::panicking::panic_fmt::h2de7a7938f816de8 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:64:14 17: 0x7fcec77cb492 - core::slice::index::slice_start_index_len_fail_rt::h0c87d85ce11d10f6 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/slice/index.rs:53:5 18: 0x7fcec77cb416 - core::slice::index::slice_start_index_len_fail::h504609f2a6b168d1 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/slice/index.rs:41:9 19: 0x7fceca0eca1f - rustc_driver[f4ad927b3c57833d]::handle_options 20: 0x7fceca0e037f - <rustc_driver[f4ad927b3c57833d]::RunCompiler>::run 21: 0x7fceca0dfd0d - <core[d16e85342ea223d9]::panic::unwind_safe::AssertUnwindSafe<rustc_driver[f4ad927b3c57833d]::main::{closure#0}> as core[d16e85342ea223d9]::ops::function::FnOnce<()>>::call_once 22: 0x7fceca17ce89 - rustc_driver[f4ad927b3c57833d]::main 23: 0x564f5f008a87 - rustc_main[f164605d1302e295]::main 24: 0x564f5f008973 - std[3da461b304582a2c]::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()> 25: 0x564f5f008969 - <std[3da461b304582a2c]::rt::lang_start<()>::{closure#0} as core[d16e85342ea223d9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 26: 0x7fcec774795c - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h699977d052768608 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/ops/function.rs:287:13 27: 0x7fcec774795c - std::panicking::try::do_call::h4e121e623c70f903 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:483:40 28: 0x7fcec774795c - std::panicking::try::hf9d919e062bc178a at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:447:19 29: 0x7fcec774795c - std::panic::catch_unwind::h7a7b12272684cb97 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panic.rs:140:14 30: 0x7fcec774795c - std::rt::lang_start_internal::{{closure}}::hd96b0eb4844b8762 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/rt.rs:148:48 31: 0x7fcec774795c - std::panicking::try::do_call::h1af1f88f4f92a22c at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:483:40 32: 0x7fcec774795c - std::panicking::try::hf20d7abea7f0f097 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:447:19 33: 0x7fcec774795c - std::panic::catch_unwind::hb0e084c3a9c042e4 at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panic.rs:140:14 34: 0x7fcec774795c - std::rt::lang_start_internal::hca9d5c7277f5b67c at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/rt.rs:148:20 35: 0x564f5f008ab7 - main 36: 0x7fcec74a1790 - <unknown> 37: 0x7fcec74a184a - __libc_start_main 38: 0x564f5f00899e - <unknown> 39: 0x0 - <unknown> error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md note: rustc 1.68.0 (2c8cc3432 2023-03-06) running on x86_64-unknown-linux-gnu query stack during panic: end of query stack ``` </details> I also checked if I can trigger a similar problem by passing empty argument list to `execve`, but at least under Linux, it seems to always insert an empty first argument if there are none.
2023-05-27Rollup merge of #108630 - overlookmotel:realloc-docs-fix, r=AmanieuMatthias Krüger-1/+2
Fix docs for `alloc::realloc` Fixes #108546. Corrects the docs for `alloc::realloc` to bring the safety constraints into line with `Layout::from_size_align_unchecked`'s constraints.
2023-05-27Auto merge of #111006 - Mark-Simulacrum:relnotes, r=Mark-Simulacrumbors-0/+136
1.70.0 release notes r? `@cuviper` `@rust-lang/release`
2023-05-271.70.0 release notesMark Rousskov-0/+136
2023-05-27Fix ICE caused by at-expanding argument 0 instead of removing it earlydekrain-5/+24
2023-05-27Auto merge of #110975 - Amanieu:panic_count, r=joshtriplettbors-86/+149
Rework handling of recursive panics This PR makes 2 changes to how recursive panics works (a panic while handling a panic). 1. The panic count is no longer used to determine whether to force an immediate abort. This allows code like the following to work without aborting the process immediately: ```rust struct Double; impl Drop for Double { fn drop(&mut self) { // 2 panics are active at once, but this is fine since it is caught. std::panic::catch_unwind(|| panic!("twice")); } } let _d = Double; panic!("once"); ``` Rustc already generates appropriate code so that any exceptions escaping out of a `Drop` called in the unwind path will immediately abort the process. 2. Any panics while the panic hook is executing will force an immediate abort. This is necessary to avoid potential deadlocks like #110771 where a panic happens while holding the backtrace lock. We don't even try to print the panic message in this case since the panic may have been caused by `Display` impls. Fixes #110771
2023-05-27Add support for nested panics to miriAmanieu d'Antras-32/+53
2023-05-27Rework handling of recursive panicsAmanieu d'Antras-54/+96
2023-05-27Clean up usage of `cx.tcx` when `tcx` is already set into a variableGuillaume Gomez-43/+39
2023-05-27Auto merge of #112016 - GuillaumeGomez:rollup-fhqn4i6, r=GuillaumeGomezbors-749/+1610
Rollup of 6 pull requests Successful merges: - #111936 (Include test suite metadata in the build metrics) - #111952 (Remove DesugaringKind::Replace.) - #111966 (Add #[inline] to array TryFrom impls) - #111983 (Perform MIR type ops locally in new solver) - #111997 (Fix re-export of doc hidden macro not showing up) - #112014 (rustdoc: get unnormalized link destination for suggestions) r? `@ghost` `@rustbot` modify labels: rollup
2023-05-27Rollup merge of #112014 - notriddle:notriddle/intra-doc-weird-syntax, ↵Guillaume Gomez-74/+639
r=GuillaumeGomez,fmease rustdoc: get unnormalized link destination for suggestions Fixes #110111 This bug, and the workaround in this PR, is closely linked to [raphlinus/pulldown-cmark#441], getting offsets of link components. In particular, pulldown-cmark doesn't provide the offsets of the contents of a link. To work around this, rustdoc parser parts of a link definition itself. [raphlinus/pulldown-cmark#441]: https://github.com/raphlinus/pulldown-cmark/issues/441
2023-05-27Rollup merge of #111997 - GuillaumeGomez:re-export-doc-hidden-macros, ↵Guillaume Gomez-5/+63
r=notriddle Fix re-export of doc hidden macro not showing up It's part of the follow-up of https://github.com/rust-lang/rust/pull/109697. Re-exports of doc hidden macros should be visible. It was the only kind of re-export of doc hidden item that didn't show up. r? `@notriddle`
2023-05-27Rollup merge of #111983 - compiler-errors:type-op-locally, r=lcnrGuillaume Gomez-564/+682
Perform MIR type ops locally in new solver The new solver already does caching, and it's generally more correct to be using the infcx of the MIR typeck (which has the defining anchor set correctly and has already initialized all the opaques from HIR typeck). This is based on #111918 so look at the final 3 commits. This actually causes some tests to go from passing to failing, and failing to passing. Here's the full diff: https://www.diffchecker.com/hB4bh1A9/ Putting this up for exposure mostly. r? `@lcnr`
2023-05-27Rollup merge of #111966 - saethlin:inline-slice-tryfrom, r=thomccGuillaume Gomez-0/+4
Add #[inline] to array TryFrom impls I was looking into https://github.com/rust-lang/rust/issues/111959 and I realized we don't have these. They seem like an uncontroversial addition. IMO this PR does not fix that issue. I think the bad codegen is being caused by some underlying deeper problem but this change might cause the MIR inliner to paper over it in this specific case. r? `@thomcc`
2023-05-27Rollup merge of #111952 - cjgillot:drop-replace, r=WaffleLapkinGuillaume Gomez-82/+78
Remove DesugaringKind::Replace. A simple boolean flag is enough.
2023-05-27Rollup merge of #111936 - ferrocene:pa-test-suite-metadata, r=jyn514Guillaume Gomez-24/+144
Include test suite metadata in the build metrics This PR enhances the build metadata to include structured information about the test suites being executed, allowing external tools consuming the metadata to understand what was being tested. The included metadata is: * Target triple * Host triple * Stage number * For compiletest tests: * Suite name * Mode * Comparing mode * For crate tests: * List of crate names This is implemented by replacing the `test` JSON node with a new `test_suite` node, which contains the metadata and the list of tests. This change also improves the handling of multiple test suites executed in the same step (for example in compiletest tests with a compare mode), as the multiple test suite executions will now be tracked in separate `test_suite` nodes. This included a breaking change in the build metrics metadata format. To better handle this, in the second commit this PR introduces the `metadata_version` top-level field. The old version is considered to be `0`, while the new one `1`. Bootstrap will also gracefully handle existing metadata of a different version. r? `@jyn514`
2023-05-27Auto merge of #111934 - scottmcm:stabilize-hash-one, r=Amanieubors-5/+1
Stabilize `BuildHasher::hash_one` FCP completed in https://github.com/rust-lang/rust/issues/86161#issuecomment-1561125732
2023-05-27Auto merge of #111928 - c410-f3r:dqewdas, r=eholkbors-86/+29
[RFC-2011] Expand more expressions cc #44838 Expands `if`, `let`, `match` and also makes `generic_assert_internals` an allowed feature when using `assert!`. `#![feature(generic_assert)]` is still needed to activate everything. ```rust #![feature(generic_assert)] fn fun(a: Option<i32>, b: Option<i32>, c: Option<i32>) { assert!( if a.is_some() { 1 } else { 2 } == 3 && if let Some(elem) = b { elem == 4 } else { false } && match c { Some(_) => true, None => false } ); } fn main() { fun(Some(1), None, Some(2)); } // Assertion failed: assert!( // if a.is_some() { 1 } else { 2 } == 3 // && if let Some(elem) = b { elem == 4 } else { false } // && match c { Some(_) => true, None => false } // ); // // With captures: // a = Some(1) // b = None // c = Some(2) ```
2023-05-27Auto merge of #111348 - ozkanonur:remove-hardcoded-rustdoc-flags, ↵bors-1231/+1435
r=albertlarsan68,oli-obk new tool `rustdoc-gui-test` Implements new tool `rustdoc-gui-test` that allows using compiletest headers for `rustdoc-gui` tests.
2023-05-27Don't use outlives type op outside of MIR typeckMichael Goulet-14/+23
2023-05-27Uplift complex type ops back into typeck so we can call them locallyMichael Goulet-558/+574
2023-05-27Perform MIR type ops locally in new solverMichael Goulet-1/+94
2023-05-26rustdoc: get unnormalized link destination for suggestionsMichael Howell-74/+639
Fixes #110111 This bug, and the workaround in this commit, is closely linked to [raphlinus/pulldown-cmark#441], getting offsets of link components. In particular, pulldown-cmark doesn't provide the offsets of the contents of a link. To work around this, rustdoc parser parts of a link definition itself. [raphlinus/pulldown-cmark#441]: https://github.com/raphlinus/pulldown-cmark/issues/441
2023-05-27Auto merge of #111245 - fee1-dead-contrib:temp-fix-tuple-struct-field, r=lcnrbors-0/+126
fix for `Self` not respecting tuple Ctor privacy This PR fixes #111220 by checking the privacy of tuple constructors using `Self`, so the following code now errors ```rust mod my { pub struct Foo(&'static str); } impl AsRef<str> for my::Foo { fn as_ref(&self) -> &str { let Self(s) = self; // previously compiled, now errors correctly s } } ```
2023-05-26Auto merge of #112013 - matthiaskrgr:rollup-a4pg2p8, r=matthiaskrgrbors-46/+142
Rollup of 8 pull requests Successful merges: - #111714 (Stop confusing specification levels when computing expectations.) - #111927 (Migrate `item_static` to Askama) - #111954 (improve error message for calling a method on a raw pointer with an unknown pointee) - #111973 (Update current implementation comments for `select_nth_unstable`) - #111976 (Generate docs for bootstrap itself) - #111977 (Make errors from `x doc` less verbose) - #111987 (do not prefer substs relate during coherence) - #111991 (Change ty and const error's pretty printing to be in braces) r? `@ghost` `@rustbot` modify labels: rollup
2023-05-27Correctly handle multiple re-exports of bang macros at the same levelGuillaume Gomez-4/+52
2023-05-27Rollup merge of #111991 - BoxyUwU:change_error_term_display, r=compiler-errorsMatthias Krüger-11/+11
Change ty and const error's pretty printing to be in braces `[const error]` and `[type error]` are slightly confusing since they look like either a slice with an error type for the element ty or a slice with a const argument as the type ???. This PR changes them to display as `{const error}` and `{type error}` similar to `{integer}`. This does not update the `Debug` impls for them which is done in #111988. I updated some error logic to avoid printing the substs of trait refs when unable to resolve an assoc item for them, this avoids emitting errors with `{type error}` in them. The substs are not relevant for these errors since we don't take into account the substs when resolving the assoc item. r? ``@compiler-errors``
2023-05-27Rollup merge of #111987 - lcnr:alias-relate-coherence, r=BoxyUwUMatthias Krüger-9/+25
do not prefer substs relate during coherence r? ```@compiler-errors```
2023-05-27Rollup merge of #111977 - jyn514:doc-errors, r=est31Matthias Krüger-2/+2
Make errors from `x doc` less verbose before: ``` error: could not document `bootstrap` Caused by: process didn't exit successfully: `/home/jyn/src/rust/build/bootstrap/debug/rustdoc ... --crate-version '1.71.0 (eb9da7bfa 2023-05-25) (a long description goes here)' --document-private-items --enable-index-page --show-type-layout --generate-link-to-definition -Zunstable-options` (exit status: 1) ``` after: ``` error: could not document `bootstrap` Caused by: process didn't exit successfully: `/home/jyn/src/rust/build/bootstrap/debug/rustdoc ... --crate-version '1.71.0 (eb9da7bfa 2023-05-25) (a long description goes here)' --document-private-items --enable-index-page --show-type-layout --generate-link-to-definition -Zunstable-options` (exit status: 1) ```
2023-05-27Rollup merge of #111976 - jyn514:doc-bootstrap, r=ozkanonurMatthias Krüger-4/+12
Generate docs for bootstrap itself This verifies the intra-doc links are correct, and hopefully makes things easier for new contributors. Note that this will conflict with https://github.com/rust-lang/rust/pull/111955, i'm pretty sure i typo-ed some of the intra-doc links lol
2023-05-27Rollup merge of #111973 - Sp00ph:update_current_impl, r=AmanieuMatthias Krüger-4/+6
Update current implementation comments for `select_nth_unstable` This more accurately reflects the actual implementation, as it hasn't been a simple quickselect since #106997. While it does say that the current implementation always runs in O(n), I don't think it should require an FCP as it doesn't guarantee linearity in general and only points out that the current implementation is in fact linear. r? `@Amanieu`
2023-05-27Rollup merge of #111954 - asquared31415:unknown_ptr_type_error, ↵Matthias Krüger-8/+63
r=compiler-errors improve error message for calling a method on a raw pointer with an unknown pointee The old error message had very confusing wording. Also added some more test cases besides the single edition test. r? `@compiler-errors`
2023-05-27Rollup merge of #111927 - sladyn98:item-static, r=GuillaumeGomezMatthias Krüger-5/+9
Migrate `item_static` to Askama This pull request addresses the type signature of the item_static function in our codebase. Previously, this function accepted a mutable reference to a Buffer for writing output. The current changes modify this to instead accept a mutable reference to any type that implements the Write trait. Referes https://github.com/rust-lang/rust/issues/108868
2023-05-27Rollup merge of #111714 - cjgillot:lint-expect-confusion, r=wesleywiserMatthias Krüger-3/+14
Stop confusing specification levels when computing expectations. Fixes https://github.com/rust-lang/rust/issues/111682
2023-05-26Auto merge of #103291 - ink-feather-org:typeid_no_struct_match, r=dtolnaybors-8/+26
Remove structural match from `TypeId` As per https://github.com/rust-lang/rust/pull/99189#issuecomment-1203720442. > Removing the structural equality might make sense, but is a breaking change that'd require a libs-api FCP. https://github.com/rust-lang/rust/pull/99189#issuecomment-1197545482 > Landing this PR now (well, mainly the "remove structural equality" part) would unblock `const fn` `TypeId::of`, since we only postponed that because we were guaranteeing too much. See also #99189, #101698
2023-05-26improve error message for calling a method on a raw pointer with an unknown ↵asquared31415-8/+63
pointee, and add some tests
2023-05-26Update tests for re-exports of doc hidden macrosGuillaume Gomez-3/+2
2023-05-26Fix re-export of doc hidden macro not showing upGuillaume Gomez-1/+12
2023-05-26print const and type errors in braces not square bracketsBoxy-11/+11
2023-05-26add rustdoc-gui-test tool in triagebot.tomlozkanonur-0/+2
2023-05-26add reasoning for introducing a metrics format versionPietro Albini-3/+15
2023-05-26rename metadata_version to format_versionPietro Albini-10/+9
The new name is more accurate.
2023-05-26Make errors from `x doc` less verbosejyn-2/+2
before: ``` error: could not document `bootstrap` Caused by: process didn't exit successfully: `/home/jyn/src/rust/build/bootstrap/debug/rustdoc ... --crate-version '1.71.0 (eb9da7bfa 2023-05-25) (a long description goes here)' --document-private-items --enable-index-page --show-type-layout --generate-link-to-definition -Zunstable-options` (exit status: 1) ``` after: ``` error: could not document `bootstrap` Caused by: process didn't exit successfully: `/home/jyn/src/rust/build/bootstrap/debug/rustdoc ... --crate-version '1.71.0 (eb9da7bfa 2023-05-25) (a long description goes here)' --document-private-items --enable-index-page --show-type-layout --generate-link-to-definition -Zunstable-options` (exit status: 1) ```
2023-05-26Auto merge of #111562 - clubby789:speedup-bootstrap-py, r=jyn514bors-49/+44
Improve startup time of bootstrap ~~If the user has a `build/host` symlink set up, we can determine the target triple by reading it rather than invoking rustc. This significantly reduces startup time of bootstrap once any kind of build has been done~~ New approach explained below ``` ➜ hyperfine -p 'git checkout -q master' -N './x.py -h' -r 50 Benchmark 1: ./x.py -h Time (mean ± σ): 140.7 ms ± 2.6 ms [User: 99.9 ms, System: 39.3 ms] Range (min … max): 136.8 ms … 149.6 ms 50 runs ➜ rust git:(master) hyperfine -p 'git checkout -q speedup-bootstrap-py' -N './x.py -h' -r 50 Benchmark 1: ./x.py -h Time (mean ± σ): 95.2 ms ± 1.5 ms [User: 67.7 ms, System: 26.7 ms] Range (min … max): 92.9 ms … 99.6 ms 50 runs ``` Also a small microoptimisation in using string splitting rather than regex when reading toml, which saves a few more milliseconds (2-5 testing locally), but less important. Profiling shows the remaining runtime is around half setting up the Python runtime, and the vast majority of the remaining time is spent in subprocess building and running bootstrap itself, so probably can't be improved much further.
2023-05-26Improve startup time for bootstrap.pyclubby789-49/+44