| Age | Commit message (Collapse) | Author | Lines |
|
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
|
|
:arrow_up: rust-analyzer
r? ``@ghost``
|
|
Cleanup .item-table CSS
The main table-like element must be `display: table;`
r? `@GuillaumeGomez`
|
|
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``
|
|
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
|
|
|
|
This lint has been uplifted and is now included in
enum_intrinsics_non_enums.
|
|
|
|
|
|
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`
|
|
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
|
|
Remove unused CSS rule
As you can see in the firefox devtools:

It needs the display to be `grid` or `inline-grid`, which isn't the case.
r? `@dns2utf8`
|
|
Fix spelling: Cannonical -> Canonical
|
|
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`.
|
|
Fix docblock code display on mobile
Fixes https://github.com/rust-lang/rust/issues/89618.
Before:

After:

r? `@jsha`
|
|
Add regression test for issue 80108
Closes #80108
|
|
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.
|
|
|
|
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
|
|
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.
|
|
Fix ABNF of inline asm options
This is the case since #73227.
r? `@camelid`
|
|
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```
|
|
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
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
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!
|
|
|
|
|
|
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.
|
|
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`
|
|
Remove unused clippy bootstrap env vars
Continues rust-lang/rust-clippy#7646
|
|
|
|
|
|
|
|
|
|
|
|
rustdoc: Cleanup various `clean` types
Cleanup various `clean` types.
|
|
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
|
|
|
|
because previous test does not cause the expected error message when
`-Z borrowck=mir`.
|
|
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``
|
|
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.
|
|
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.
|
|
|
|
|
|
Fix min LLVM version for bpf-types test
The test requires https://reviews.llvm.org/D102118 which was released in LLVM 13.
Closes #89689
|