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 9 pull requests #121761

Closed
wants to merge 27 commits into from

Conversation

GuillaumeGomez
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

fmease and others added 27 commits February 19, 2024 14:25
Code changes in raw_vec require blessing UI tests every time
This commit:
- Moves the ICE file create/open outside the loop. (Redoing it on every
  loop iteration works, but is really weird.)
- Moves the explanatory note emission above the loop, which removes the
  need for the `enumerate` call.
- Introduces a `decorate` local.
This prevents a follow-up type error in a test, which seems fine.
- Put every literal in its own braces, rather than just some of them,
  for maximal error recovery.
- Add a blank line between every case, for readability.
This slightly changes error messages in `float-field.rs`, but nothing of
real importance.
Make `ReentrantLock` public

Implements the ACP rust-lang/libs-team#193.

`@rustbot` label +T-libs-api +S-waiting-on-ACP
…nieu

Vec::try_with_capacity

Related to rust-lang#91913

Implements try_with_capacity for `Vec`, `VecDeque`, and `String`. I can follow it up with more collections if desired.

`Vec::try_with_capacity()` is functionally equivalent to the current stable:

```rust
let mut v = Vec::new();
v.try_reserve_exact(n)?
```

However, `try_reserve` calls non-inlined `finish_grow`, which requires old and new `Layout`, and is designed to reallocate memory. There is benefit to using `try_with_capacity`, besides syntax convenience, because it generates much smaller code at the call site with a direct call to the allocator. There's codegen test included.

It's also a very desirable functionality for users of `no_global_oom_handling` (Rust-for-Linux), since it makes a very commonly used function available in that environment (`with_capacity` is used much more frequently than all `(try_)reserve(_exact)`).
…clauses-on-ty-aliases, r=compiler-errors

Detect empty leading where clauses on type aliases

1. commit: refactor the AST of type alias where clauses
   * I could no longer bear the look of `.0.1` and `.1.0`
   * Arguably moving `split` out of `TyAlias` into a substruct might not make that much sense from a semantic standpoint since it reprs an index into `TyAlias.predicates` but it's alright and it cleans up the usage sites of `TyAlias`
2. commit: fix an oversight: An empty leading where clause is still a leading where clause
   * semantically reject empty leading where clauses on lazy type aliases
     * e.g., on `#![feature(lazy_type_alias)] type X where = ();`
   * make empty leading where clauses on assoc types trigger lint `deprecated_where_clause_location`
     * e.g., `impl Trait for () { type X where = (); }`
…nethercote

Improve error messages for generics with default parameters

Fixes rust-lang#120785

Issue: Previously, all type parameters with default types were deliberately ignored to simplify error messages. For example, an error message for Box type would display `Box<T>` instead of `Box<T, _>`. But, this resulted in unclear error message when a concrete type was used instead of the default type.

Fix: This PR fixes it by checking if a concrete type is specified after a default type to display the entire type name or the simplified type name.
…g-whitespace, r=notriddle

[rustdoc] Prevent inclusion of whitespace character after macro_rules ident

Discovered this bug randomly when looking at:

![image](https://github.com/rust-lang/rust/assets/3050060/dca38047-9085-4377-bfac-f98890224be4)

We were too eagerly trying to merge tokens that shouldn't be merged together (for example if you have a code comment followed by a code comment, we merge them in one attribute to reduce the DOM size).

r? `@notriddle`
… r=oli-obk

Two diagnostic things

Two minor improvements to diagnostics-related things.

r? `@RalfJung`
…, r=fmease

Use `LitKind::Err` for malformed floats

rust-lang#121120 changed `StringReader::cook_lexer_literal` to return `LitKind::Err` for malformed integer literals. This commit does the same for float literals, for consistency.

r? `@fmease`
…r=compiler-errors

pattern analysis: Don't panic when encountering unexpected constructor

Tiny PR to fix rust-lang/rust-analyzer#16656

r? `@compiler-errors`
…resolve-regions, r=jackh726

Opportunistically resolve regions when processing region outlives obligations

Due to the matching in `TypeOutlives` being structural, we should attempt to opportunistically resolve regions before processing region obligations. Thanks `@lcnr` for finding this.

r? lcnr
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. labels Feb 28, 2024
@rustbot rustbot added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Feb 28, 2024
@GuillaumeGomez
Copy link
Member Author

@bors r+ p=5 rollup=never

@bors
Copy link
Contributor

bors commented Feb 28, 2024

📌 Commit 1c10897 has been approved by GuillaumeGomez

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 Feb 28, 2024
@bors
Copy link
Contributor

bors commented Feb 28, 2024

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout rollup-rb0o9ap (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self rollup-rb0o9ap --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Removing library/std/src/sync/remutex.rs
Auto-merging compiler/rustc_parse/src/lexer/mod.rs
Auto-merging compiler/rustc_lint_defs/src/lib.rs
Auto-merging compiler/rustc_lint/src/context/diagnostics.rs
CONFLICT (content): Merge conflict in compiler/rustc_lint/src/context/diagnostics.rs
Auto-merging compiler/rustc_infer/src/infer/error_reporting/mod.rs
CONFLICT (content): Merge conflict in compiler/rustc_infer/src/infer/error_reporting/mod.rs
Auto-merging compiler/rustc_errors/src/lib.rs
CONFLICT (content): Merge conflict in compiler/rustc_errors/src/lib.rs
Auto-merging compiler/rustc_errors/src/diagnostic.rs
Auto-merging compiler/rustc_ast_passes/src/errors.rs
Automatic merge failed; fix conflicts and then commit the result.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 28, 2024
@bors
Copy link
Contributor

bors commented Feb 28, 2024

☔ The latest upstream changes (presumably #121489) made this pull request unmergeable. Please resolve the merge conflicts.

@GuillaumeGomez GuillaumeGomez deleted the rollup-rb0o9ap branch August 19, 2024 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants