about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-10-19Make printed message match the code commentChris Palmer-1/+1
I think this code is getting L0, not L1 cache size, if I'm reading the Intel manual right. (I might not be.) Either way, the code comment and the printed message should match, whichever way is right. :)
2021-10-20Rollup merge of #90036 - jsha:less-rule, r=GuillaumeGomezYuki Okushi-5/+8
Remove border-bottom from most docblocks. Headings in the top-doc docblock still get a border-bottom due to a rule that covers all h2, h3, and h4. Method docblocks are generally h5, and so don't get a border-bottom anymore. This fixes a problem where a sub-sub-heading within a method would have a line that went all the way across the page, creating a division that made that sub-sub-heading look much more important than it really is. Fixes #90033 Demo at https://jacob.hoffman-andrews.com/rust/less-rule/std/string/struct.String.html r? ``@GuillaumeGomez``
2021-10-20Rollup merge of #90025 - JohnTitor:revert-86011, r=estebankYuki Okushi-67/+75
Revert #86011 to fix an incorrect bound check This reverts commit 36a1076d24697621a3bb67ef654b4eb79647aa54, reversing changes made to e1e9319d93aea755c444c8f8ff863b0936d7a4b6. Fixes #89935 r? ``@estebank``
2021-10-20Rollup merge of #90018 - GuillaumeGomez:too-long-item-names, r=jshaYuki Okushi-154/+232
Fix rustdoc UI for very long type names Fixes #89972. While working on it, I also discovered that when the item name is too long, it also breaks the flow of the page. To make things right, I also renamed the `type-decl` CSS class into `item-decl` (because this PR also generates it for more than type declarations). So here are the before/after screenshots: ![Screenshot from 2021-10-18 16-58-03](https://user-images.githubusercontent.com/3050060/137757247-637fcf04-4406-49c6-8a8a-18c2074aacd9.png) ![Screenshot from 2021-10-18 16-58-26](https://user-images.githubusercontent.com/3050060/137757252-17935e63-53b3-449f-a535-7be91ff0e257.png) ![Screenshot from 2021-10-18 16-58-07](https://user-images.githubusercontent.com/3050060/137757278-8b12e348-2980-4fc4-8853-bef99d58981f.png) ![Screenshot from 2021-10-18 16-58-28](https://user-images.githubusercontent.com/3050060/137757282-534a0e1b-3016-49ba-b3ac-e45bdb9035cb.png) r? ``@jsha``
2021-10-20Rollup merge of #88860 - nbdd0121:panic, r=m-ou-seYuki Okushi-3/+0
Deduplicate panic_fmt std's begin_panic_fmt and core's panic_fmt are duplicates. Merge them to declutter code and remove a lang item.
2021-10-19Remove begin_panic_fmt from clippyGary Guo-3/+0
2021-10-19Auto merge of #90039 - ehuss:update-cargo, r=ehussbors-0/+0
Update cargo 6 commits in c7957a74bdcf3b11e7154c1a9401735f23ebd484..7fbbf4e8f23e3c24b8afff541dcb17e53eb5ff88 2021-10-11 20:17:07 +0000 to 2021-10-19 02:16:48 +0000 - Make future-incompat-report output more user-friendly (rust-lang/cargo#9953) - Fix fetching git repos after a force push. (rust-lang/cargo#9979) - Add rustc-link-args to doctest build (rust-lang/cargo#9916) - Add the start of a basic benchmarking suite. (rust-lang/cargo#9955) - Use forms for issue templates. (rust-lang/cargo#9970) - Add rust_metadata to SerializedPackage (rust-lang/cargo#9967)
2021-10-19Auto merge of #90040 - nbdd0121:issue-90038, r=oli-obkbors-0/+21
Fix wrong niche calculation when 2+ niches are placed at the start When the niche is at the start, existing code incorrectly uses 1 instead of count for subtraction. Fix #90038 `@rustbot` label: T-compiler
2021-10-19Fix issue 90038Gary Guo-0/+21
2021-10-18Update cargoEric Huss-0/+0
2021-10-18Reduce margin on h5 and h6Jacob Hoffman-Andrews-1/+8
2021-10-19Rollup merge of #90002 - lnicola:rust-analyzer-2021-10-18, r=lnicolaMatthias Krüger-16/+15
:arrow_up: rust-analyzer r? ``@ghost``
2021-10-19Rollup merge of #89997 - cameron1024:const-str-as-bytes-ice, r=JohnTitorMatthias Krüger-0/+28
Add test for issue #84957 - `str.as_bytes()` in a `const` expression Hi, this PR adds a test for issue #84957 . I'm quite new to rustc so let me know if there's anything else that needs doing 😄 Closes #84957
2021-10-19Rollup merge of #89988 - tmiasko:unpromote-const-drop, r=oli-obkMatthias Krüger-0/+39
Do not promote values with const drop that need to be dropped Changes from #88558 allowed using `~const Drop` in constants by introducing a new `NeedsNonConstDrop` qualif. The new qualif was also used for promotion purposes, and allowed promotion to happen for values that needs to be dropped but which do have a const drop impl. Since for promoted the drop implementation is never executed, this lead to observable change in behaviour. For example: ```rust struct Panic(); impl const Drop for Panic { fn drop(&mut self) { panic!(); } } fn main() { let _ = &Panic(); } ``` Restore the use of `NeedsDrop` qualif during promotion to avoid the issue.
2021-10-19Rollup merge of #89956 - JohnTitor:suggest-case-insensitive-match-names, ↵Matthias Krüger-2/+19
r=estebank Suggest a case insensitive match name regardless of levenshtein distance Fixes #86170 Currently, `find_best_match_for_name` only returns a case insensitive match name depending on a Levenshtein distance. It's a bit unfortunate that that hides some suggestions for typos like `Bar` -> `BAR`. That idea is from https://github.com/rust-lang/rust/pull/46347#discussion_r153701834, but I think it still makes some sense to show a candidate when we find a case insensitive match name as it's more like a typo. Skipped the `candidate != lookup` check because the current (i.e, `levenshtein_match`) returns the exact same `Symbol` anyway but it doesn't seem to confuse anything on UI tests. r? ``@estebank``
2021-10-19Rollup merge of #89867 - Urgau:fix-double-definition, r=GuillaumeGomezMatthias Krüger-3/+42
Fix macro_rules! duplication when reexported in the same module This can append if within the same module a `#[macro_export] macro_rules!` is declared but also a reexport of itself producing two export of the same macro in the same module. In that case we only want to document it once. Before: ``` Module { is_crate: true, items: [ Id("0:4"), // pub use crate::repro as repro2; Id("0:3"), // macro_rules! repro Id("0:3"), // duplicate, same as above ], } ``` After: ``` Module { is_crate: true, items: [ Id("0:4"), // pub use crate::repro as repro2; Id("0:3"), // macro_rules! repro ], } ``` Fixes https://github.com/rust-lang/rust/issues/89852
2021-10-18Remove border-bottom from most docblocks.Jacob Hoffman-Andrews-4/+0
Headings in the top-doc docblock still get a border-bottom due to a rule that covers all h2, h3, and h4. Method docblocks are generally h5, and so don't get a border-bottom anymore. This fixes a problem where a sub-sub-heading within a method would have a line that went all the way across the page, creating a division that made that sub-sub-heading look much more important than it really is.
2021-10-18Auto merge of #89229 - oli-obk:i_love_inferctxt, r=jackh726bors-299/+228
Remove redundant member-constraint check impl trait will, for each lifetime in the hidden type, register a "member constraint" that says the lifetime must be equal or outlive one of the lifetimes of the impl trait. These member constraints will be solved by borrowck But, as you can see in the big red block of removed code, there was an ad-hoc check for member constraints happening at the site where they get registered. This check had some minor effects on diagnostics, but will fall down on its feet with my big type alias impl trait refactor. So we removed it and I pulled the removal out into a (hopefully) reviewable PR that works on master directly.
2021-10-18Do not promote values with const drop that need to be droppedTomasz Miąsko-0/+39
Changes from #88558 allowed using `~const Drop` in constants by introducing a new `NeedsNonConstDrop` qualif. The new qualif was also used for promotion purposes, and allowed promotion to happen for values that needs to be dropped but which do have a const drop impl. Since for promoted the drop implementation is never executed, this lead to observable change in behaviour. For example: ```rust struct Panic(); impl const Drop for Panic { fn drop(&mut self) { panic!(); } } fn main() { let _ = &Panic(); } ``` Restore the use of `NeedsDrop` qualif during promotion to avoid the issue.
2021-10-18Auto merge of #89124 - cjgillot:owner-info, r=michaelwoeristerbors-14/+2
Index and hash HIR as part of lowering Part of https://github.com/rust-lang/rust/pull/88186 ~Based on https://github.com/rust-lang/rust/pull/88880 (see merge commit).~ Once HIR is lowered, it is later indexed by the `index_hir` query and hashed for `crate_hash`. This PR moves those post-processing steps to lowering itself. As a side objective, the HIR crate data structure is refactored as an `IndexVec<LocalDefId, Option<OwnerInfo<'hir>>>` where `OwnerInfo` stores all the relevant information for an HIR owner. r? `@michaelwoerister` cc `@petrochenkov`
2021-10-19Add a regression test for #89935Yuki Okushi-0/+18
2021-10-19Revert "Rollup merge of #86011 - tlyu:correct-sized-bound-spans, r=estebank"Yuki Okushi-67/+57
This reverts commit 36a1076d24697621a3bb67ef654b4eb79647aa54, reversing changes made to e1e9319d93aea755c444c8f8ff863b0936d7a4b6.
2021-10-18Remove regionck member constraint handling and leave it to mir borrowckOli Scherer-320/+76
2021-10-18Add test to ensure that the docblock elements left margin is as expectedGuillaume Gomez-0/+6
2021-10-18Add GUI overflow tests for constant and typedefGuillaume Gomez-1/+35
2021-10-18Prevent documentation page title to grow too bigGuillaume Gomez-0/+1
2021-10-18* Remove left margin on items declaration at the top of their documentation pageGuillaume Gomez-153/+190
* Rename "type-decl" into "item-decl" to reflect the change of usage
2021-10-18add test for issue 84957cameron-0/+28
2021-10-18:arrow_up: rust-analyzerLaurențiu Nicola-16/+15
2021-10-18Rollup merge of #89993 - pierwill:patch-1, r=Mark-SimulacrumMatthias Krüger-2/+0
Remove dead code from `compiletest::json` Currently getting a dead code warning on master. Might make sense to remove.
2021-10-18Rollup merge of #89990 - petrochenkov:idempty, r=wesleywiserMatthias Krüger-9/+8
rustc_span: `Ident::invalid` -> `Ident::empty` The equivalent for `Symbol`s was renamed some time ago (`kw::Invalid` -> `kw::Empty`), and it makes sense to do the same thing for `Ident`s as well.
2021-10-18Rollup merge of #89989 - camelid:type-size, r=jyn514Matthias Krüger-0/+4
rustdoc: Add static size assertion for `clean::Type` r? `@jyn514`
2021-10-18Rollup merge of #89987 - pierwill:fix-85526-docs-hidden-assoc, r=GuillaumeGomezMatthias Krüger-0/+15
Check implementing type for `#[doc(hidden)]` Closes #85526.
2021-10-18Rollup merge of #89974 - est31:let_else_if_error, r=nagisaMatthias Krüger-0/+28
Nicer error message if the user attempts to do let...else if Gives a nice "conditional `else if` is not supported for `let...else`" error when encountering a `let...else if` pattern, as suggested in the [let...else tracking issue](https://github.com/rust-lang/rust/issues/87335#issuecomment-944846205).
2021-10-18Rollup merge of #89965 - JohnTitor:fix-let-else-ice-with-ref-mut, r=petrochenkovMatthias Krüger-0/+19
Fix ICE with `let...else` and `ref mut` Fixes #89960, opened for review. I'm not satisfied with the current diagnostics, any ideas?
2021-10-18Rollup merge of #89950 - infinity0:master, r=Mark-SimulacrumMatthias Krüger-3/+3
bootstrap: tweak verbosity settings Currently the verbosity settings are: - 2: RUSTC-SHIM envvars get spammed on every invocation, O(30) lines cargo is passed -v which outputs CLI invocations, O(5) lines - 3: cargo is passed -vv which outputs build script output, O(0-10) lines This commit changes it to: - 1: cargo is passed -v, O(5) lines - 2: cargo is passed -vv, O(10) lines - 3: RUSTC-SHIM envvars get spammed, O(30) lines
2021-10-17Remove dead code from `compiletest::json`pierwill-2/+0
2021-10-17Auto merge of #89499 - Mark-Simulacrum:with-llvm-13, r=nikicbors-9/+31
Split out LLVM PGO step and use clang 13 to compile LLVM We're seeing a PGO version mismatch error in CI logs: LLVM Profile Error: Runtime and instrumentation version mismatch : expected 5, but get 7 which is likely due to the version bumped here differing from that used by rustc. This PR fixes this by splitting out the PGO step for LLVM into a separate phase of the pgo.sh script, which nets no change to performance (see [these results](https://perf.rust-lang.org/compare.html?start=c34ac8747ca96d09cb08b8f5adddead826e77c06&end=e272c2af45f40c74dab83948235903ffbe3ad57f)). Then, it follows that up with an upgrade to LLVM/clang version 13 as our bootstrap compiler, which yields the performance improvements for this PR -- around 5%. This depends on the first step here, because otherwise we end up somehow clobbering or otherwise hurting our ability to effectively collect performance data, yielding reductions in performance for a subset of benchmarks -- it is not clear what the cause here was precisely, but the split only costs ~10 minutes and seems worthwhile.
2021-10-17Check implementing type for `#[doc(hidden)]`pierwill-0/+15
Closes #85526.
2021-10-17Add static size assertion for `clean::Type`Noah Lev-0/+4
2021-10-17Nicer error message if the user attempts to do let...else ifest31-0/+28
2021-10-17rustc_span: `Ident::invalid` -> `Ident::empty`Vadim Petrochenkov-9/+8
The equivalent for `Symbol`s was renamed some time ago (`kw::Invalid` -> `kw::Empty`), and it makes sense to do the same thing for `Ident`s.
2021-10-17Auto merge of #89984 - matthiaskrgr:rollup-ikmyhmx, r=matthiaskrgrbors-87/+273
Rollup of 7 pull requests Successful merges: - #89738 (ty::pretty: prevent infinite recursion for `extern crate` paths.) - #89888 (Make `llvm.download-ci-llvm="if-available"` work for tier 2 targets with host tools) - #89945 (Remove a mention to `copy_from_slice` from `clone_from_slice` doc) - #89946 (Fix an ICE with TAITs and Future) - #89963 (Some "parenthesis" and "parentheses" fixes) - #89975 (Add a regression test for #85921) - #89977 (Make Result::as_mut const) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-17Rollup merge of #89975 - JohnTitor:gats-tests-85921, r=jackh726Matthias Krüger-0/+19
Add a regression test for #85921 Closes #85921 r? `@jackh726`
2021-10-17Rollup merge of #89963 - r00ster91:parenthesisparentheses, r=nagisaMatthias Krüger-84/+84
Some "parenthesis" and "parentheses" fixes "Parenthesis" is the singular (e.g. one `(` or one `)`) and "parentheses" is the plural (multiple `(` or `)`s) and this is not hard to mix up so here are some fixes for that. Inspired by #89958
2021-10-17Rollup merge of #89946 - JohnTitor:fix-89686, r=petrochenkovMatthias Krüger-0/+58
Fix an ICE with TAITs and Future Fixes #89686
2021-10-17Rollup merge of #89888 - rusticstuff:download-ci-llvm-apple-arm64, ↵Matthias Krüger-3/+46
r=Mark-Simulacrum Make `llvm.download-ci-llvm="if-available"` work for tier 2 targets with host tools `llvm.download-ci-llvm="if-available"` is used for most profiles configured via `x.py setup`. It allows downloading prebuilt LLVM tarballs from the CI artifacts for a configured list of platforms. Currently this list is restricted to tier 1 targets but it makes sense for all tier 2 targets with host tools.
2021-10-17Rollup merge of #89738 - eddyb:extern-crate-recursion, r=nagisaMatthias Krüger-0/+66
ty::pretty: prevent infinite recursion for `extern crate` paths. Fixes #55779, fixes #87932. This fix is based on `@estebank's` idea in https://github.com/rust-lang/rust/issues/55779#issuecomment-614758510 - but instead of trying to get `try_print_visible_def_path_recur`'s cycle detection to work in this case, this PR "just" disables the "visible path" feature when printing the path to an `extern crate`, so that the old recursion chain of `try_print_visible_def_path -> print_def_path -> try_print_visible_def_path`, is now impossible. Both tests have been confirmed to crash `rustc` because of a stack overflow, without the fix.
2021-10-17Auto merge of #89981 - pietroalbini:1.56-version-bump, r=pietroalbinibors-1/+1
Bump version to Rust 1.58.0 cc `@Mark-Simulacrum` r? `@ghost`
2021-10-17bump version to rust 1.58.0Pietro Albini-1/+1