Commit Graph

231061 Commits

Author SHA1 Message Date
Matthias Krüger
427f3d3266
Rollup merge of #114018 - Enselic:multi-annotation, r=b-naber
Make `--error-format human-annotate-rs` handle multiple files

Closes #64205 which is E-help-wanted
2023-07-30 14:25:09 +02:00
Matthias Krüger
e3bf088fb5
Rollup merge of #112655 - WaffleLapkin:must_use_map_or, r=workingjubilee
Mark `map_or` as `#[must_use]`

I don't know what else to say.

r? libs
2023-07-30 14:25:08 +02:00
Matthias Krüger
e517ee02b2
Rollup merge of #110056 - chenyukang:yukang/fix-110045, r=workingjubilee
Fix the example in document for WaitTimeoutResult::timed_out

Fixes #110045
2023-07-30 14:25:08 +02:00
Matthias Krüger
3ce90b1649 inline format!() args up to and including rustc_codegen_llvm 2023-07-30 14:22:50 +02:00
bors
483ef5f4d8 Auto merge of #114066 - matthiaskrgr:fmt_args_inline_bootstrap, r=WaffleLapkin
bootstrap: inline format!() args (0)

r? `@WaffleLapkin`
2023-07-30 12:14:04 +00:00
y21
008746cae4 [unnecessary_find_map]: look for then_some 2023-07-30 13:51:35 +02:00
Guillaume Gomez
148a0c1673 Remove some unneeded clone() calls 2023-07-30 13:26:36 +02:00
Matthias Krüger
23815467a2 inline format!() args up to and including rustc_middle 2023-07-30 13:18:33 +02:00
Bryanskiy
8203d1ddf6 Weaken unnameable_types lint 2023-07-30 14:02:21 +03:00
Maybe Waffle
90f9640528 Mark map_or as #[must_use] 2023-07-30 10:22:23 +00:00
Matthias Krüger
a0503a83d0 bootstrap: inline format!() args 2023-07-30 11:46:14 +02:00
León Orell Valerian Liehr
0ca432844c
Check lazy type aliases for well-formedness 2023-07-30 11:24:15 +02:00
yukang
d67d9890ae Fix the example in document for WaitTimeoutResult::timed_out 2023-07-30 16:39:33 +08:00
bors
c0bdb3d337 Auto merge of #11258 - Jarcho:ice_11256, r=Centri3
Resolve type aliases in `type_certainty`

Fixes #11256

changelog: `unwrap_or_default`: Fix ICE when local types are declared using alias types
2023-07-30 07:57:47 +00:00
bors
4c9ac1e93b Auto merge of #114236 - fee1-dead-contrib:rollup-m92j7q1, r=fee1-dead
Rollup of 3 pull requests

Successful merges:

 - #112151 (Clarify behavior of inclusive bounds in BTreeMap::{lower,upper}_bound)
 - #113512 (Updated lines doc to include trailing carriage return note)
 - #114203 (Effects: don't print `host` param in diagnostics)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-30 07:57:13 +00:00
Jason Newcomb
caf601434b Resolve type aliases in type_certainty 2023-07-30 03:26:32 -04:00
fee1-dead
7b4bfd640d
Rollup merge of #114203 - fee1-dead-contrib:effects/pp-no-host, r=oli-obk
Effects: don't print `host` param in diagnostics

r? ``@oli-obk``
2023-07-30 07:13:03 +00:00
fee1-dead
b97da75156
Rollup merge of #113512 - vallentin:lines-doc, r=workingjubilee
Updated lines doc to include trailing carriage return note

Updated `str::lines` doc to include explicit info about (trailing) carriage returns.

Reference: #100311
2023-07-30 07:13:02 +00:00
fee1-dead
3143030cda
Rollup merge of #112151 - chloekek:patch-1, r=workingjubilee
Clarify behavior of inclusive bounds in BTreeMap::{lower,upper}_bound

It wasn’t quite clear to me how these methods would interpret inclusive bounds so I added examples for those.
2023-07-30 07:13:01 +00:00
bors
2e0136a131 Auto merge of #112280 - zica87:master, r=workingjubilee
Remove redundant example of `BTreeSet::iter`

The usage and that `Values returned by the iterator are returned in ascending order` are already demonstrated by the other example and the description, so I removed the useless one.
2023-07-30 06:12:03 +00:00
bors
4c2f460dcc Auto merge of #8685 - Jarcho:redundant_closure_fixes, r=llogiq
`redundant_closure` fixes

fixes #8548

A good chunk of the code is fixing false negatives. The old code banned any non late-bound regions from appearing in the callee's signature. The new version checks when the late-bound region is actually required.

changelog: Better track when a early-bound region appears when a late-bound region is required in `redundant_closure`.
changelog: Don't lint `redundant_closure` when the closure gives explicit types.
2023-07-30 05:41:24 +00:00
Jason Newcomb
7423c2760b Don't lint redundant closure for any function call inserted by the compiler. 2023-07-30 01:19:36 -04:00
Jason Newcomb
4d80a2ed2e Rework redundant_closure
* Better track when a early-bound region appears when a late-bound region is required
* Don't lint when the closure gives explicit types.
2023-07-30 01:19:29 -04:00
Jason Newcomb
71cc39e1f2 Add debug assertions to implements_trait
Improve debug assertions for `make_projection`
2023-07-30 00:38:04 -04:00
bors
fb53384c94 Auto merge of #114226 - matthiaskrgr:rollup-wxdudsm, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #114129 (Rustdoc small cleanups)
 - #114152 ([rustc][data_structures] Simplify binary_search_slice.)
 - #114222 (Mark `lazy_type_alias` as incomplete)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-30 00:41:35 +00:00
asquared31415
6850a00bd0 add tidy check for stray rustfix files 2023-07-29 23:49:04 +00:00
Matthias Krüger
d4926b13aa
Rollup merge of #114222 - compiler-errors:lazy-type-alias-is-incomplete, r=oli-obk
Mark `lazy_type_alias` as incomplete

This feature is very not complete: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AF-lazy_type_alias

r? types
2023-07-30 01:22:43 +02:00
Matthias Krüger
b8895980bc
Rollup merge of #114152 - ttsugriy:master, r=WaffleLapkin
[rustc][data_structures] Simplify binary_search_slice.

Instead of using `binary_search_by_key`, it's possible to use `partition_point` to find the lower bound. This avoids the need to locate the leftmost matching entry separately.

It's also possible to use `partition_point` to find the upper bound, so I plan to send a separate PR for your consideration.
2023-07-30 01:22:42 +02:00
Matthias Krüger
fa94851b07
Rollup merge of #114129 - GuillaumeGomez:rustdoc-cleanup, r=notriddle
Rustdoc small cleanups

Each commit does some little cleanups:

 * We had some `Res` comparisons in multiple places (and still do, but unless we use a macro, it's not possible to "merge" any further) so I moved it into a function.
 * It was weird to have some utils function used everywhere in `visit_ast` so I instead moved it into `clean/utils.rs`.
 * In HTML rendering, we had some write "issues":
   * Multiple calls that could be merged into one.
   * Some `write!` that could be `write_str`.
   * We didn't use the new `format!` args much.

r? `@notriddle`
2023-07-30 01:22:42 +02:00
bors
b969b830aa Auto merge of #113704 - compiler-errors:rpitit-assumed-wf-inherit, r=spastorino
Make RPITITs inherit the `assumed_wf_types` of their parent method

... and then move the RPITIT well-formedness check to just use the regular logic of wfchecking an associated type.

---

We need to inherit the `assumed_wf_types` of the RPITIT's parent function in order for the given code to be considered well-formed:

```rust
trait Foo {
  fn bar<'a, T>(_: &'a T) -> impl Iterator<Output = &'a T>;
}
```

Since for `&'a T` to be WF, we need `T: 'a`.

In order for this to work for late-bound lifetimes, we need to do some additional mapping of any late-bound lifetimes captured by these assumed wf types. This is because within the body of the function (and thus in the `assumed_wf_types`), they're represented as `ReFree` variants of the original late-bound lifetimes declared in the function's generics, but in the RPITIT's GAT, they're represented as "reified" `ReEarlyBound` vars (duplicated during opaque type lowering). Luckily, the mapping between these two is already [stored in the opaque](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.OpaqueTy.html#structfield.lifetime_mapping).

Fixes #113796
2023-07-29 22:58:21 +00:00
Jubilee Young
20ebbf467d Replace ignore-everything with only-arch
Combining revisions with only-arch allows specifying
that a test only applies to a handful of targets.
This allows removing a large amount of repetition
in the test suite for tests that do not benefit.
The revisions are suboptimal for this for some tests,
so they aren't preferred in those cases.
2023-07-29 15:49:07 -07:00
Jubilee Young
040bc3447e mv tests/codegen/repr-* tests/codegen/repr
Slightly more complicated: also give them appropriate names
that somewhat describe the cases they are trying to cover,
using information from PR chatter in rust-lang/rust#47158
2023-07-29 15:35:36 -07:00
Jubilee Young
b2375fb9e2 Ignore an AVR-inapplicable test 2023-07-29 15:21:49 -07:00
Michael Goulet
744e770939 some nits, bless test 2023-07-29 21:29:03 +00:00
Michael Goulet
50d21091ee Implement assumed_wf_types for RPITITs' implementations 2023-07-29 21:19:33 +00:00
Michael Goulet
349a2372ed Take RPITITs inherit the assumed_wf_types of their parent fn 2023-07-29 21:19:33 +00:00
Erik Desjardins
55800123b7 cg_llvm: simplify llvm.masked.gather/scatter naming with opaque pointers
With opaque pointers, there's no longer a need to generate a chain
of pointer types in the intrinsic name when arguments are pointers to
pointers.
2023-07-29 16:56:27 -04:00
bors
32303b219d Auto merge of #114211 - RalfJung:miri, r=RalfJung
update Miri

r? `@ghost`
2023-07-29 20:41:45 +00:00
Erik Desjardins
cf7788d54b cg_llvm: clean up match 2023-07-29 16:32:03 -04:00
Erik Desjardins
def44c5669 cg_llvm: inline check_store 2023-07-29 16:31:53 -04:00
Ryan O'Neill
9a01a23b9c Documentation: Fix Stilted Language in Vec->Indexing
Problem

Language in the Vec->Indexing documentation sounds stilted due to
incorrect word ordering: "... type allows to access values by index."

Solution

Reorder words in the Vec->Indexing documentation to flow better:
"... type allows access to values by index." The phrase "allows access to"
also matches other existing documentation.
2023-07-29 13:20:45 -07:00
Michael Goulet
4b58ae0bb8 Mark lazy_type_alias as incomplete 2023-07-29 19:47:15 +00:00
bors
03a57254b5 Auto merge of #114156 - calebzulawski:simd-bswap, r=compiler-errors
Add simd_bswap, simd_bitreverse, simd_ctlz, and simd_cttz intrinsics

cc `@workingjubilee`
2023-07-29 18:51:45 +00:00
Erik Desjardins
04303cfb3a cg_ssa: remove pointee types and pointercast/bitcast-of-ptr 2023-07-29 13:18:20 -04:00
Erik Desjardins
b6540777fe cg_llvm: remove pointee types and pointercast/bitcast-of-ptr 2023-07-29 13:18:17 -04:00
bors
70757fbdd7 Auto merge of #2993 - Vanille-N:tb-protector, r=RalfJung
TB: Redefine trigger condition for protectors

The Coq formalization revealed that as currently implemented, read accesses did not always commute.
Indeed starting from a lazily initialized `Active` protected tag, applying a foreign read then a child read produces `Frozen`, but child read then foreign read triggers UB (because the child read initializes _before_ the `Active -> Frozen`).

This reformulation of when protectors trigger fixes that issue:
- instead of `Active + foreign read -> Frozen` and `Active -> Frozen` when protected is UB
- we do `Active + foreign read -> if protected { Disabled } else { Frozen }`

There is already precedent for transitions being dependent on the presence of a protector (`Reserved + foreign read -> if protected { Frozen } else { Reserved }`), and this has the nice side-effect of simplifying the protector trigger condition to just an equality check against `Disabled` since now there is protector UB iff a protected tag becomes `Disabled`.

In order not to introduce an extra `if`, it was decided that `Disabled -> Disabled` would be UB when protected, which was not the case previously. This is merely a theoretical for now because a protected `Disabled` is unreachable in the first place.

The extra test is not directly related to this modification, but also checks things related to protectors and lazy initialization.
2023-07-29 16:59:45 +00:00
bors
a04e649c09 Auto merge of #114028 - Centri3:ternary-operator, r=compiler-errors
Gracefully handle ternary operator

Fixes #112578

~~May not be the best way to do this as it doesn't check for a single `:`, so it could perhaps appear even when the actual issue is just a missing semicolon. May not be the biggest deal, though?~~

Nevermind, got it working properly now ^^
2023-07-29 16:45:29 +00:00
Neven Villani
53f0cb4b8a
doc comment suggestions 2023-07-29 18:17:34 +02:00
bors
4c96822796 Auto merge of #114148 - cuviper:drop-llvm-14, r=nikic
Update the minimum external LLVM to 15

With this change, we'll have stable support for LLVM 15 through 17 (pending release).
For reference, the previous increase to LLVM 14 was #107573.
2023-07-29 14:57:47 +00:00
Deadbeef
df3f9fdf5a Effects: don't print host param in diagnostics 2023-07-29 14:55:35 +00:00