Commit Graph

235126 Commits

Author SHA1 Message Date
Nicholas Nethercote
bb5344a1bf Inline and remove DroplessArena::alloc_raw_without_grow.
It has a single call site. I find the code clearer with it gone.
2023-09-28 17:58:56 +10:00
Nicholas Nethercote
55a1a5223a Reduce grow_and_alloc_raw to a single call site.
The current structure is clumsy, calling `alloc_raw_without_grow` in one
function, and then if that fails, calling another function that calls
`alloc_raw_without_grow` again.
2023-09-28 17:58:54 +10:00
Matthias Krüger
86d5939aba
Rollup merge of #116215 - estebank:parse-type-angle-bracket-tweak, r=compiler-errors
Tweak wording of missing angle backets in qualified path
2023-09-28 09:14:07 +02:00
Matthias Krüger
be51067b4a
Rollup merge of #116213 - tmandry:doclnl, r=ehuss
Document -Zlink-native-libraries

Originally added in #70095.
2023-09-28 09:14:07 +02:00
Matthias Krüger
fa5b2fe2f5
Rollup merge of #116211 - matthiaskrgr:clippy3, r=compiler-errors
more clippy complextity fixes

redundant_guards, useless_format, clone_on_copy
2023-09-28 09:14:06 +02:00
Matthias Krüger
698448c0cd
Rollup merge of #115888 - RalfJung:assert_receiver_is_total_eq, r=dtolnay
fix a comment about assert_receiver_is_total_eq

"a type implements #[deriving]" doesn't make any sense, so I assume they meant "implement `Eq`"? Also the attribute is called `derive`.
2023-09-28 09:14:06 +02:00
Matthias Krüger
0e338d7e23
Rollup merge of #115535 - tshepang:patch-2, r=dtolnay
format doc-comment code examples in std::process
2023-09-28 09:14:05 +02:00
Matthias Krüger
980fba7345
Rollup merge of #112959 - tbu-:pr_fmt_error_wording, r=dtolnay
Change the wording in `std::fmt::Write::write_str`

Refer to the error instead of expanding its name.
2023-09-28 09:14:05 +02:00
David Tolnay
9bdf9e754e
Update stability attribute for child stream From impls 2023-09-28 00:13:02 -07:00
Anshul
5e26e8c5bd
changed 'rotate' to 'rotating' 2023-09-28 11:58:37 +05:30
bors
46da927abb Auto merge of #114041 - nvzqz:nvzqz/shared_from_array, r=dtolnay
Implement `From<[T; N]>` for `Rc<[T]>` and `Arc<[T]>`

Given that `Box<[T]>` already has this conversion, the shared counterparts should also have it.
2023-09-28 06:16:01 +00:00
David Tolnay
e2f7032408
Fix "unresolved link to std::fmt::Error"
error: unresolved link to `std::fmt::Error`
       --> library/core/src/fmt/mod.rs:115:52
        |
    115 |     /// This function will return an instance of [`std::fmt::Error`] on error.
        |
        |
        = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
2023-09-27 22:55:34 -07:00
Nicholas Nethercote
25407bc0bb Make DroplessArena::alloc call DroplessArena::alloc_raw.
They're very similar.
2023-09-28 15:44:48 +10:00
Nicholas Nethercote
98d97b7323 Use Layout::new consistently in DroplessArena::alloc. 2023-09-28 15:44:48 +10:00
Nicholas Nethercote
51edc21990 Remove unsafe from TypedArena::alloc_raw_slice.
There's no good reason for it.
2023-09-28 15:44:48 +10:00
Nicholas Nethercote
55de23ed5d Inline and remove TypedArena::ensure_capacity.
It has a single callsite.
2023-09-28 15:44:48 +10:00
Nicholas Nethercote
0001eddb93 Inline and remove DroplessArena::grow_and_alloc.
It has a single callsite.
2023-09-28 15:44:48 +10:00
Nicholas Nethercote
a11f7e4c0f Remove some unnecessary lifetimes. 2023-09-28 15:44:48 +10:00
Nicholas Nethercote
79b11f0802 rustc_arena: tweak some comments. 2023-09-28 15:44:48 +10:00
bors
024279a2e9 Auto merge of #3089 - rust-lang:rustup-2023-09-28, r=RalfJung
Automatic sync from rustc
2023-09-28 05:42:54 +00:00
The Miri Conjob Bot
f2623ac49b Merge from rustc 2023-09-28 05:19:36 +00:00
The Miri Conjob Bot
3b091cb504 Preparing for merge from rustc 2023-09-28 05:11:51 +00:00
bors
aeaa5c30e5 Auto merge of #111278 - EFanZh:implement-from-array-refs-for-vec, r=dtolnay
Implement `From<{&,&mut} [T; N]>` for `Vec<T>` where `T: Clone`

Currently, if `T` implements `Clone`, we can create a `Vec<T>` from an `&[T]` or an `&mut [T]`, can we also support creating a `Vec<T>` from an `&[T; N]` or an `&mut [T; N]`? Also, do I need to add `#[inline]` to the implementation?

ACP: rust-lang/libs-team#220. [Accepted]

Closes #100880.
2023-09-28 04:26:40 +00:00
bors
2ba4eb2d49 Auto merge of #116208 - matthiaskrgr:the_loop_that_wasnt, r=GuillaumeGomez
rustdoc: while -> if

we will always return once we step inside the while-loop thus `if` is sufficient here
2023-09-28 02:34:16 +00:00
WANG Rui
f99fdac3df ci: upgrade to crosstool-ng 1.26.0 2023-09-28 10:24:09 +08:00
bors
b9dd2ce408 Auto merge of #116204 - Alexendoo:rustc-lint-macro-paths, r=cjgillot
Use absolute paths in rustc_lint::passes macros

A cosmetic change, so the callsite doesn't have to import things. Makes nicer for us to try in clippy
2023-09-28 00:44:08 +00:00
Esteban Küber
3848ffcee7 Tweak wording of missing angle backets in qualified path 2023-09-28 00:37:20 +00:00
Michael Howell
0487237f12 rustdoc: add URLs for test issues 2023-09-27 17:22:18 -07:00
Tyler Mandry
f4ed73119a Document -Zlink-native-libraries
Originally added in #70095.
2023-09-27 17:21:38 -07:00
Michael Howell
7cd8b2c925 Rename issue-\d+.rs tests to have meaningful names 2023-09-27 17:15:37 -07:00
Michael Howell
79195d5cbb Add crate_name to test so that it can be renamed 2023-09-27 16:51:21 -07:00
bors
fbd4423b97 Auto merge of #116148 - DaniPopes:rustdoc-type-layout-ws, r=jsha
Fix whitespace in rustdoc type_layout.html

`Size: <size>` was missing a space after the colon:

![image](https://github.com/rust-lang/rust/assets/57450786/c5a672f3-a28a-4b56-91e7-a4e6ffc8106e)
2023-09-27 22:56:40 +00:00
Matthias Krüger
e8a33847fd don't clone copy types 2023-09-28 00:20:32 +02:00
Matthias Krüger
fd95627134 fix clippy::{redundant_guards, useless_format} 2023-09-27 23:49:15 +02:00
bors
e7c502d930 Auto merge of #109597 - cjgillot:gvn, r=oli-obk
Implement a global value numbering MIR optimization

The aim of this pass is to avoid repeated computations by reusing past assignments. It is based on an analysis of SSA locals, in order to perform a restricted form of common subexpression elimination.

By opportunity, this pass allows for some simplifications by combining assignments. For instance, this pass could be able to see through projections of aggregates to directly reuse the aggregate field (not in this PR).

We handle references by assigning a different "provenance" index to each `Ref`/`AddressOf` rvalue. This ensure that we do not spuriously merge borrows that should not be merged. Meanwhile, we consider all the derefs of an immutable reference to a freeze type to give the same value:
```rust
_a = *_b // _b is &Freeze
_c = *_b // replaced by _c = _a
```
2023-09-27 21:06:30 +00:00
Matthias Krüger
809ab64e97 rustdoc: while -> if
we will always return once we step inside the while-loop thus `if` is sufficient here
2023-09-27 22:07:33 +02:00
bors
7b4b1b08b6 Auto merge of #114901 - compiler-errors:style-guide-wc, r=calebcartwright
Amend style guide section for formatting where clauses in type aliases

This PR has two parts:
1. Amend wording about breaking before or after the `=`, which is a style guide bugfix to align it with current rustfmt behavior.
2. Explain how to format trailing (#89122) where clauses, which are preferred in both GATs (#90076) and type aliases (#114662).

r? `@joshtriplett`
2023-09-27 19:17:30 +00:00
Urgau
1b2c1a8583 Fix ICE by introducing an expr_or_init variant for outside bodies 2023-09-27 18:59:24 +02:00
Urgau
bd360472b1 Simplify casting logic of the invalid_reference_casting lint 2023-09-27 18:50:26 +02:00
bors
d4589a492f Auto merge of #116202 - emmanuel-ferdman:wip, r=ehuss
Update location of `personality/gcc.rs`

**PR Summary**:
PR updates the location of `personality/gcc.rs` file in the docs.
2023-09-27 16:09:54 +00:00
Emmanuel Ferdman
08c4963a32
Update location of personality 2023-09-27 18:30:33 +03:00
Alex Macleod
17b1026448 Use absolute paths in rustc_lint::passes macros
A cosmetic change, so the callsite doesn't have to import things
2023-09-27 15:06:59 +00:00
bors
c4ce33cfbc Auto merge of #115887 - RalfJung:pat, r=oli-obk
thir::pattern: update some comments and error type names

Follow-up to [these comments](https://github.com/rust-lang/rust/pull/105750#pullrequestreview-1629697578). Please carefully fact-check, I'm new to this area of the compiler!
2023-09-27 13:20:53 +00:00
Urgau
e577dcdd4d Prefer expr_or_init over manual init detection 2023-09-27 15:09:30 +02:00
bors
92009f217a Auto merge of #116093 - RalfJung:link_llvm_intrinsics, r=oli-obk
make link_llvm_intrinsics and platform_intrinsics features internal

These are both a lot like `feature(intrinsics)`, just slightly different syntax, so IMO it should be treated the same (also in terms of: if you get ICEs with this feature, that's on you -- we are not doing "nice" type-checking for intrinsics).
2023-09-27 11:28:36 +00:00
bors
085acd02d4 Auto merge of #116193 - matthiaskrgr:rollup-wpt7m5t, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #115934 (Split out the stable part of smir into its own crate to prevent accidental usage of forever unstable things)
 - #116149 (Anonymize binders for `refining_impl_trait` check)
 - #116178 (Add test for `const async fn`)
 - #116187 (Add context to `let: Ty = loop { break };`)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-09-27 08:45:44 +00:00
Matthias Krüger
a6f066596b
Rollup merge of #116187 - estebank:small-tweak, r=compiler-errors
Add context to `let: Ty = loop { break };`

We weren't accounting for the case where `break` was immediately within the `loop` block.
2023-09-27 10:42:35 +02:00
Matthias Krüger
243ce35b9f
Rollup merge of #116178 - Milo123459:milo/add-test-for-const-async-function-in-main, r=wesleywiser
Add test for `const async fn`

This adds a test for #102796
2023-09-27 10:42:35 +02:00
Matthias Krüger
50417a5457
Rollup merge of #116149 - compiler-errors:anonymize, r=lcnr
Anonymize binders for `refining_impl_trait` check

We're naively using the equality impl for `ty::Clause` in the refinement check, which is okay *except* for binders, which carry some information about where they come from in the AST. Those locations are not gonna be equal between traits and impls, so anonymize those clauses so that this doesn't matter.

Fixes #116135
2023-09-27 10:42:34 +02:00
Matthias Krüger
d4858878c1
Rollup merge of #115934 - oli-obk:smir_identity, r=spastorino
Split out the stable part of smir into its own crate to prevent accidental usage of forever unstable things

Some groundwork for being able to work on https://github.com/rust-lang/project-stable-mir/issues/27 at all

r? `@spastorino`
2023-09-27 10:42:34 +02:00