about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-10-11Auto merge of #83908 - Flying-Toast:master, r=davidtwcobors-315/+181
Add enum_intrinsics_non_enums lint There is a clippy lint to prevent calling [`mem::discriminant`](https://doc.rust-lang.org/std/mem/fn.discriminant.html) with a non-enum type. I think the lint is worthy of being included in rustc, given that `discriminant::<T>()` where `T` is a non-enum has an unspecified return value, and there are no valid use cases where you'd actually want this. I've also made the lint check [variant_count](https://doc.rust-lang.org/core/mem/fn.variant_count.html) (#73662). closes #83899
2021-10-11Rollup merge of #89761 - lnicola:rust-analyzer-2021-10-11, r=lnicolaGuillaume Gomez-18/+17
:arrow_up: rust-analyzer r? ``@ghost``
2021-10-11Rollup merge of #89754 - dns2utf8:rustdoc_cleanup_css, r=GuillaumeGomezGuillaume Gomez-1/+1
Cleanup .item-table CSS The main table-like element must be `display: table;` r? `@GuillaumeGomez`
2021-10-11Rollup merge of #89726 - jkugelman:must-use-alloc-constructors, r=joshtriplettGuillaume Gomez-2/+2
Add #[must_use] to alloc constructors Added `#[must_use]`. to the various forms of `new`, `pin`, and `with_capacity` in the `alloc` crate. No extra explanations given as I couldn't think of anything useful to add. I figure this deserves extra scrutiny compared to the other PRs I've done so far. In particular: * The 4 `pin`/`pin_in` methods I touched. Are there legitimate use cases for pinning and not using the result? Pinning's a difficult concept I'm not very comfortable with. * `Box`'s constructors. Do people ever create boxes just for the side effects... allocating or zeroing out memory? Parent issue: #89692 r? ``@joshtriplett``
2021-10-11Rollup merge of #89655 - tlyu:find-non-merge-commits, r=jyn514Guillaume Gomez-3/+15
bootstrap: don't use `--merges` to look for commit hashes for downloading artifacts Shallow clones (and possibly worktrees, though I can't seem to reproduce the problem there) can cause `git rev-list --merges` to falsely return no results, even if a merge commit is present. Stop using the `--merges` option when looking for commit hashes that have build artifacts. `--first-parent` and `--author=bors@rust-lang.org` should be sufficient. Also exit with an error if the configuration asks for artifacts to be downloaded and we can't determine an appropriate commit hash to use to download artifacts. Fixes #87890. r? ``@jyn514`` ``@rustbot`` label +A-rustbuild +A-contributor-roadblock
2021-10-11Cleanup .item-table CSSStefan Schindler-1/+1
2021-10-11Deprecate mem_discriminant_non_enumflip1995-314/+15
This lint has been uplifted and is now included in enum_intrinsics_non_enums.
2021-10-11Add enum_intrinsics_non_enums lintFlying-Toast-1/+166
2021-10-11:arrow_up: rust-analyzerLaurențiu Nicola-18/+17
2021-10-11Auto merge of #89597 - michaelwoerister:improve-vtable-debuginfo, r=wesleywiserbors-21/+47
Create more accurate debuginfo for vtables. Before this PR all vtables would have the same name (`"vtable"`) in debuginfo. Now they get an unambiguous name that identifies the implementing type and the trait that is being implemented. This is only one of several possible improvements: - This PR describes vtables as arrays of `*const u8` pointers. It would nice to describe them as structs where function pointer is represented by a field with a name indicative of the method it maps to. However, this requires coming up with a naming scheme that avoids clashes between methods with the same name (which is possible if the vtable contains multiple traits). - The PR does not update the debuginfo we generate for the vtable-pointer field in a fat `dyn` pointer. Right now there does not seem to be an easy way of getting ahold of a vtable-layout without also knowing the concrete self-type of a trait object. r? `@wesleywiser`
2021-10-11Auto merge of #89752 - matthiaskrgr:rollup-v4fgmwg, r=matthiaskrgrbors-128/+183
Rollup of 6 pull requests Successful merges: - #89579 (Add regression test for issue 80108) - #89632 (Fix docblock code display on mobile) - #89691 (Move `DebuggerCommands` and `check_debugger_output` to a separate module) - #89707 (Apply clippy suggestions for std) - #89722 (Fix spelling: Cannonical -> Canonical) - #89736 (Remove unused CSS rule) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-11Rollup merge of #89736 - GuillaumeGomez:rm-unused-css-rule, r=dns2utf8Matthias Krüger-2/+0
Remove unused CSS rule As you can see in the firefox devtools: ![Screenshot from 2021-10-10 14-28-08](https://user-images.githubusercontent.com/3050060/136695689-16c77ceb-b1ab-40df-963a-048f2258e217.png) It needs the display to be `grid` or `inline-grid`, which isn't the case. r? `@dns2utf8`
2021-10-11Rollup merge of #89722 - jkugelman:cannonical-typo, r=joshtriplettMatthias Krüger-1/+1
Fix spelling: Cannonical -> Canonical
2021-10-11Rollup merge of #89691 - Nicholas-Baron:debugger_commands, r=Mark-SimulacrumMatthias Krüger-125/+151
Move `DebuggerCommands` and `check_debugger_output` to a separate module Work towards #89475. As part of this move, the public functions were changed to return `Result`. This is so that the error handling that initially took `&self: TestCx` can still use that `TestCx`.
2021-10-11Rollup merge of #89632 - GuillaumeGomez:fix-docblock-code, r=jshaMatthias Krüger-0/+16
Fix docblock code display on mobile Fixes https://github.com/rust-lang/rust/issues/89618. Before: ![Screenshot from 2021-10-07 12-01-37](https://user-images.githubusercontent.com/3050060/136363624-72bedddd-b45e-48a0-89b4-6563612f8677.png) After: ![Screenshot from 2021-10-07 20-17-21](https://user-images.githubusercontent.com/3050060/136440704-fa9ffa68-8e94-46a7-b556-c41aa5153750.png) r? `@jsha`
2021-10-11Rollup merge of #89579 - workingjubilee:regression-test-80108, r=Mark-SimulacrumMatthias Krüger-0/+15
Add regression test for issue 80108 Closes #80108
2021-10-10Auto merge of #89541 - workingjubilee:abbrev-shufvec-t, r=Mark-Simulacrumbors-358/+205
Cleanup src/test/ui/{simd,simd-intrinsic} Initial motivation was to simplify a huge macro expansion using a tuple, since we can just use an array in `#[repr(simd)]` now for the same result. But also, several tests were going unnoticed during development of SIMD intrinsics because people kept looking in the wrong directory, and many are basically run-pass vs. build-fail versions of the same tests, so let's keep them close together and simplify their names, so they're easier to sift through.
2021-10-10Add regression test for issue 80108Jubilee Young-0/+15
2021-10-10Auto merge of #89739 - matthiaskrgr:rollup-kskwqy5, r=matthiaskrgrbors-25/+148
Rollup of 11 pull requests Successful merges: - #88374 (Fix documentation in Cell) - #88713 (Improve docs for int_log) - #89428 (Feature gate the non_exhaustive_omitted_patterns lint) - #89438 (docs: `std::hash::Hash` should ensure prefix-free data) - #89520 (Don't rebuild GUI test crates every time you run test src/test/rustdoc-gui) - #89705 (Cfg hide no_global_oom_handling and no_fp_fmt_parse) - #89713 (Fix ABNF of inline asm options) - #89718 (Add #[must_use] to is_condition tests) - #89719 (Add #[must_use] to char escape methods) - #89720 (Add #[must_use] to math and bit manipulation methods) - #89735 (Stabilize proc_macro::is_available) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-10Rollup merge of #89735 - bjorn3:stabilize_proc_macro_is_available, ↵Matthias Krüger-3/+0
r=petrochenkov Stabilize proc_macro::is_available Tracking issue: https://github.com/rust-lang/rust/issues/71436 The FCP for the stabilization of `proc_macro::is_available` has completed.
2021-10-10Rollup merge of #89713 - nbdd0121:doc2, r=AmanieuMatthias Krüger-1/+1
Fix ABNF of inline asm options This is the case since #73227. r? `@camelid`
2021-10-10Rollup merge of #89520 - GuillaumeGomez:cache-rustdoc-gui-test, ↵Matthias Krüger-1/+1
r=Mark-Simulacrum Don't rebuild GUI test crates every time you run test src/test/rustdoc-gui This method has multiple advantages: * It'll completely remove the rustdoc-GUI test doc folder if rustdoc was updated * It'll rebuild GUI test crates only they have been updated All in all, it's quite convenient! (even more with https://github.com/rust-lang/rust/pull/88816) r? ```@Mark-Simulacrum```
2021-10-10Rollup merge of #89428 - DevinR528:reachable-featuregate, r=Nadrieril,camelidMatthias Krüger-20/+146
Feature gate the non_exhaustive_omitted_patterns lint Fixes https://github.com/rust-lang/rust/issues/89374 Add the machinery to gate the new `non_exhaustive_omitted_patterns` lint. relates to https://github.com/rust-lang/rust/pull/89105 and https://github.com/rust-lang/rust/pull/89423
2021-10-10Auto merge of #89633 - rhysd:issue-65230, r=petrochenkovbors-18/+47
Show detailed expected/found types in error message when trait paths are the same Fixes #65230. ### Issue solved by this PR ```rust trait T { type U; fn f(&self) -> Self::U; } struct X<'a>(&'a mut i32); impl<'a> T for X<'a> { type U = &'a i32; fn f(&self) -> Self::U { self.0 } } fn main() {} ``` Compiler generates the following note: ``` note: ...so that the types are compatible --> test.rs:10:28 | 10 | fn f(&self) -> Self::U { | ____________________________^ 11 | | self.0 12 | | } | |_____^ = note: expected `T` found `T` ``` This note is not useful since the expected type and the found type are the same. ### How this PR solve the issue When the expected type and the found type are exactly the same in string representation, the note falls back to the detailed string representation of trait ref: ``` note: ...so that the types are compatible --> test.rs:10:28 | 10 | fn f(&self) -> Self::U { | ____________________________^ 11 | | self.0 12 | | } | |_____^ = note: expected `<X<'a> as T>` found `<X<'_> as T>` ``` So that a user can notice what was different between the expected one and the found one.
2021-10-10Merge branch 'rust-lang:master' into must-use-alloc-constructorsJohn Kugelman-55/+180
2021-10-10Remove unused CSS ruleGuillaume Gomez-2/+0
2021-10-10Add test for <code> in doc blocks on mobileGuillaume Gomez-0/+12
2021-10-10Stabilize proc_macro::is_availablebjorn3-3/+0
2021-10-10Fix <code> blocks in doc blocks display on mobileGuillaume Gomez-0/+4
2021-10-10Auto merge of #88952 - skrap:add-armv7-uclibc, r=nagisabors-0/+67
Add new tier-3 target: armv7-unknown-linux-uclibceabihf This change adds a new tier-3 target: armv7-unknown-linux-uclibceabihf This target is primarily used in embedded linux devices where system resources are slim and glibc is deemed too heavyweight. Cross compilation C toolchains are available [here](https://toolchains.bootlin.com/) or via [buildroot](https://buildroot.org). The change is based largely on a previous PR #79380 with a few minor modifications. The author of that PR was unable to push the PR forward, and graciously allowed me to take it over. Per the [target tier 3 policy](https://github.com/rust-lang/rfcs/blob/master/text/2803-target-tier-policy.md), I volunteer to be the "target maintainer". This is my first PR to Rust itself, so I apologize if I've missed things!
2021-10-10Add #[must_use] to alloc constructorsJohn Kugelman-2/+2
2021-10-10Fix spelling: Cannonical -> CanonicalJohn Kugelman-1/+1
2021-10-10Auto merge of #89695 - jsha:more-templates, r=GuillaumeGomezbors-55/+113
Move top part of print_item to Tera templates Part of #84419. This moves the first line of each item page (E.g. `Struct foo::Bar .... 1.0.0 [-][src]` into a Tera template. I also moved template initialization into its own module and added a small macro to reduce duplication and opportunity for errors.
2021-10-10Auto merge of #89661 - rusticstuff:libisl_mirror_take_two, r=Mark-Simulacrumbors-4/+8
CI: Use mirror for libisl downloads for more docker dist builds http://isl.gforge.inria.fr fell from the net a couple of days ago. It hosts libisl source tarballs required by crosstool-ng, which we use for our docker dist cross-compilation builds. Some of the affected builds were already fixed in #89599. This PR sets a mirror URL for the other builds requiring libisl-0.14. They use an older version of crosstool-ng (1.22.0), which has only one mirror setting for all downloads. r? `@Mark-Simulacrum`
2021-10-09Auto merge of #89631 - camsteffen:clippy-boot-env, r=Mark-Simulacrumbors-8/+1
Remove unused clippy bootstrap env vars Continues rust-lang/rust-clippy#7646
2021-10-09Fix ABNF of inline asm optionsGary Guo-1/+1
2021-10-09Simplified 3 ifs found by clippy.Nicholas-Baron-12/+10
2021-10-09Simplified two printlns picked out by clippyNicholas-Baron-2/+2
2021-10-09Move check_debugger_output to the debugger moduleNicholas-Baron-64/+69
2021-10-09Move DebuggerCommands to its own fileNicholas-Baron-48/+71
2021-10-09Auto merge of #88379 - camelid:cleanup-clean, r=jyn514bors-514/+415
rustdoc: Cleanup various `clean` types Cleanup various `clean` types.
2021-10-09Auto merge of #89703 - GuillaumeGomez:rollup-g3ulo9x, r=GuillaumeGomezbors-13/+27
Rollup of 6 pull requests Successful merges: - #75644 (Add 'core::array::from_fn' and 'core::array::try_from_fn') - #87528 (stack overflow handler specific openbsd change.) - #88436 (std: Stabilize command_access) - #89614 (Update to Unicode 14.0) - #89664 (Add documentation to boxed conversions) - #89700 (Fix invalid HTML generation for higher bounds) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-09Remove some stray whitespace.Jacob Hoffman-Andrews-3/+3
2021-10-10Use E0308 instead of E0495 for checking the error message improvementrhysd-47/+19
because previous test does not cause the expected error message when `-Z borrowck=mir`.
2021-10-09Rollup merge of #89700 - GuillaumeGomez:fix-rustdoc-higher-bound-html-gen, ↵Guillaume Gomez-2/+6
r=notriddle Fix invalid HTML generation for higher bounds Considering this is a bug, I cherry-picked the commit from #89676 so it's merged more quickly. r? ``@notriddle``
2021-10-09Rollup merge of #89614 - cuviper:unicode-14, r=joshtriplettGuillaume Gomez-11/+21
Update to Unicode 14.0 The Unicode Standard [announced Version 14.0](https://home.unicode.org/announcing-the-unicode-standard-version-14-0/) on September 14, 2021, and this pull request updates the generated tables in `core` accordingly. This did require a little prep-work in `unicode-table-generator`. First, #81358 had modified the generated file instead of the tool, so that change is now reflected in the tool as well. Next, I found that the "Alphabetic" property in version 14 was panicking when generating a bitset, "cannot pack 264 into 8 bits". We've been using the skiplist for that anyway, so I changed this to fail gracefully. Finally, I confirmed that the tool still created the exact same tables for 13 before moving to 14.
2021-10-09Auto merge of #89343 - Mark-Simulacrum:no-args-queries, r=cjgillotbors-0/+13
Refactor fingerprint reconstruction This PR replaces can_reconstruct_query_key with fingerprint_style, which returns the style of the fingerprint for that query. This allows us to avoid trying to extract a DefId (or equivalent) from keys which *are* reconstructible because they're () but not as DefIds. This is done with the goal of fixing -Zdump-dep-graph, which seems to have broken a while ago (I didn't try to bisect). Currently even on a `fn main() {}` file it'll ICE (you need to also pass -Zquery-dep-graph for it to work at all), and this patch indirectly fixes the cause of that ICE. This also adds a test for it continuing to work.
2021-10-09Fix invalid HTML generation for higher boundsGuillaume Gomez-2/+6
2021-10-09Add a test that -Zquery-dep-graph -Zdump-dep-graph worksMark Rousskov-0/+13
2021-10-09Rollup merge of #89697 - alessandrod:issue-89689, r=nikicMatthias Krüger-1/+1
Fix min LLVM version for bpf-types test The test requires https://reviews.llvm.org/D102118 which was released in LLVM 13. Closes #89689