Skip to content
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

Rollup of 11 pull requests #122854

Merged
merged 169 commits into from
Mar 22, 2024
Merged

Rollup of 11 pull requests #122854

merged 169 commits into from
Mar 22, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

nbdd0121 and others added 30 commits February 24, 2024 18:49
Have the lint trigger even if `Self` has generic lifetime parameters.

```rs
impl<'a> Foo<'a> {
    type Item = Foo<'a>; // Can be replaced with Self

    fn new() -> Self {
        Foo { // No lifetime, but they are inferred to be that of Self
              // Can be replaced as well
            ...
        }
    }

    // Don't replace `Foo<'b>`, the lifetime is different!
    fn eq<'b>(self, other: Foo<'b>) -> bool {
        ..
    }
```

Fixes rust-lang#12381
Add asm goto support to `asm!`

Tracking issue: rust-lang#119364

This PR implements asm-goto support, using the syntax described in "future possibilities" section of [RFC2873](https://rust-lang.github.io/rfcs/2873-inline-asm.html#asm-goto).

Currently I have only implemented the `label` part, not the `fallthrough` part (i.e. fallthrough is implicit). This doesn't reduce the expressive though, since you can use label-break to get arbitrary control flow or simply set a value and rely on jump threading optimisation to get the desired control flow. I can add that later if deemed necessary.

r? ``@Amanieu``
cc ``@ojeda``
fix [`missing_docs_in_private_items`] on some proc macros

fixes: rust-lang#12197

---

changelog: [`missing_docs_in_private_items`] support manually search for docs as fallback method
…enkov

Refactor pre-getopts command line argument handling

Rebased version of rust-lang#111658. I've also fixed the Windows CI failure (although I don't have access to Windows to test it myself).
Lint singleton gaps after exclusive ranges

In the discussion to stabilize exclusive range patterns (rust-lang#37854), it has often come up that they're likely to cause off-by-one mistakes. We already have the `overlapping_range_endpoints` lint, so I [proposed](rust-lang#37854 (comment)) a lint to catch the complementary mistake.

This PR adds a new `non_contiguous_range_endpoints` lint that catches likely off-by-one errors with exclusive range patterns. Here's the idea (see the test file for more examples):
```rust
match x {
    0..10 => ..., // WARN: this range doesn't match `10_u8` because `..` is an exclusive range
    11..20 => ..., // this could appear to continue range `0_u8..10_u8`, but `10_u8` isn't matched by either of them
    _ => ...,
}
// help: use an inclusive range instead: `0_u8..=10_u8`
```

More precisely: for any exclusive range `lo..hi`, if `hi+1` is matched by another range but `hi` isn't, we suggest writing an inclusive range `lo..=hi` instead. We also catch `lo..T::MAX`.
New lint `const_is_empty`

This lint detects calls to `.is_empty()` on an entity initialized from a string literal and flag them as suspicious. To avoid triggering on macros called from generated code, it checks that the `.is_empty()` receiver, the call itself and the initialization come from the same context.

Fixes rust-lang#12307

changelog: [`const_is_empty`]: new lint
…iter, r=compiler-errors

Implement `FusedIterator` for `gen` block

cc rust-lang#117078
… r=clubby789

make failure logs less verbose

Resolves rust-lang#122706

Logs without verbose flag:

![image](https://github.com/rust-lang/rust/assets/39852038/f2fc2d35-0954-44b0-bedc-045afedaabe8)

Logs with verbose flag:

![image](https://github.com/rust-lang/rust/assets/39852038/b9308655-ad31-4527-a1be-5a62a78ac469)

I decided to exclude command from the log since it's already included in verbose mode.

cc ```@Nilstrieb```
…ings-to-prevent-incremental-protests, r=matthiaskrgr

Avoid noop rewrite of issues.txt

Fixes rust-lang#122834

r? ```@matthiaskrgr```
…r, r=compiler-errors

Add a never type option to make diverging blocks `()`

More experiments for ~~the blood god~~ T-lang!

Usage example:
```rust
 #![allow(internal_features)]
 #![feature(never_type, rustc_attrs)]
 #![rustc_never_type_options(diverging_block_default = "unit")]

fn main() {
    let _: u8 = { //~ error: expected `u8`, found `()`
        return;
    };
}
```

r? compiler-errors

I'm not sure how I feel about parsing the attribute every time we create `FnCtxt`. There must be a better way to do this, right?
…m, r=compiler-errors

add test for ice "cannot relate region: LUB(ReErased, ReError)"

Fixes rust-lang#109178
…matthiaskrgr

Clippy subtree update

r? ``@Manishearth``
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc O-netbsd Operating system: NetBSD O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative rollup A PR which is a rollup labels Mar 22, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=11

@bors
Copy link
Contributor

bors commented Mar 22, 2024

📌 Commit 99e5618 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 22, 2024
@bors
Copy link
Contributor

bors commented Mar 22, 2024

⌛ Testing commit 99e5618 with merge b57a10c...

@bors
Copy link
Contributor

bors commented Mar 22, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing b57a10c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 22, 2024
@bors bors merged commit b57a10c into rust-lang:master Mar 22, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Mar 22, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#119365 Add asm goto support to asm! ❌ conflicts merging 'a4b413d4fd' into previous master ❌
#121194 Refactor pre-getopts command line argument handling ❌ conflicts merging '865ac89dbd' into previous master ❌
#121881 std::net: adding acceptfilter feature for netbsd/freebsd. 7b06dbad345f856f01b41ab6ccfd745db1529c03 (link)
#122513 hir: Remove opt_local_def_id_to_hir_id and `opt_hir_node_… ❌ conflicts merging 'f55a04928f' into previous master ❌
#122817 Doc Guarantee: BTree(Set|Map): IntoIter Iterate in Sorte… 2ed3108f55080eda5b978c92225d617d5a2b163c (link)
#122826 Add tests for shortcomings of associated type bounds e8c11106b71642f1819b3d969cf7638fd546fa2f (link)
#122829 Implement FusedIterator for gen block 3c8553815ee62496d613a051ff47698010a2fcab (link)
#122831 make failure logs less verbose ffb0302142d166739d5fe91927827139b03eb2e1 (link)
#122837 add test for #122549 594bdd5b883b4acfd78d45c2092e6141f20cc0e9 (link)
#122838 Avoid noop rewrite of issues.txt 7236ccfd474bb3d26f2f44496671f843ac521a0c (link)
#122841 add 2 more tests for issues fixed by #122749 9a51d013653f335d6ec0c95303e9fa2bce324c48 (link)
#122843 Add a never type option to make diverging blocks () e6a57cbe94bdb5b90222f4fa7d98d3fa4700b95f (link)
#122844 add test for ice "cannot relate region: LUB(ReErased, ReErr… a5fa5691afccddeb0423b28901c26a4280e5c996 (link)
#122845 Clippy subtree update 4a324a421995b8cda10f5fa5fb7246d59c946c54 (link)

previous master: 0ad927c0c0

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@bors bors mentioned this pull request Mar 22, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b57a10c): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.3%, 0.3%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.4% [3.4%, 3.4%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.4% [3.4%, 3.4%] 1

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.6% [3.6%, 3.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 668.681s -> 671.782s (0.46%)
Artifact size: 315.01 MiB -> 315.01 MiB (0.00%)

@matthiaskrgr matthiaskrgr deleted the rollup-9nnuo0z branch September 1, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. O-netbsd Operating system: NetBSD O-unix Operating system: Unix-like rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
None yet
Development

Successfully merging this pull request may close these issues.