Commit Graph

242026 Commits

Author SHA1 Message Date
Takashi Idobe
c20bdf247b fix some typos found scrolling through the docs 2023-12-22 18:28:19 -05:00
Nadrieril
5fccaee59c Clarify the situation with dummy patterns and PatData
Use an explicit `Option` instead of requiring a `Default` bound
2023-12-23 00:08:38 +01:00
Nadrieril
f6af7478ba Mention the relevant tracking issue next to my bit_set hack 2023-12-23 00:04:20 +01:00
Nadrieril
c6aa16c469 Use derivative for better derive bounds 2023-12-23 00:04:20 +01:00
bors
467d1d97d4 Auto merge of #119227 - weihanglo:update-cargo, r=weihanglo
Update cargo

10 commits in 1a2666ddd14cf0a255d4ddb61c63531c259a7b39..363a2d11320faf531f6aacd1ea067c6bc08343b9
2023-12-17 17:53:53 +0000 to 2023-12-22 03:12:42 +0000
- refactor: centralize git checkouts and db paths (rust-lang/cargo#13187)
- Bump to 0.78.0; update changelog (rust-lang/cargo#13192)
- refactor: custom error types for `cargo-util-schemas` (rust-lang/cargo#13186)
- chore(deps): update rust crate handlebars to `v4.5.0` (rust-lang/cargo#13168)
- Hold the mutate exclusive lock when vendoring (rust-lang/cargo#12509)
- refactor: clean up package metadata (rust-lang/cargo#13184)
- ci: check SemVer for cargo-util-schemas on CI (rust-lang/cargo#13185)
- refactor(schemas): Pull out as `cargo-util-schemas` (rust-lang/cargo#13178)
- chore(rustfix): rename Readme.md to README.md (rust-lang/cargo#13181)
- chore(rustfix): remove useless clippy rules and fix a typo (rust-lang/cargo#13182)

r? ghost
2023-12-22 22:27:35 +00:00
Weihang Lo
e6412f277a
bootstrap: build doc for `cargo-util-schemas 2023-12-22 17:13:35 -05:00
Weihang Lo
b94cc35f38
Update cargo 2023-12-22 17:02:31 -05:00
Mark Rousskov
2fec2d67f7 Improve coding efficiency for RawDefId
This copies the scheme already used for LazyArray, cutting a couple
hundred kilobytes from libcore's metadata.
2023-12-22 16:54:00 -05:00
Mark Rousskov
7b5dc45897 Avoid redundant Option for cross_crate_inlinable 2023-12-22 15:30:00 -05:00
bors
d6d7a93866 Auto merge of #118824 - aliemjay:perf-region-cons, r=compiler-errors
use Vec for region constraints instead of BTreeMap

~1% perf gain

Diagnostic regressions need more investigation.

r? `@ghost`
2023-12-22 20:28:48 +00:00
Eric Holk
aaa3e7642b
Update test outputs 2023-12-22 11:01:07 -08:00
Eric Holk
acb6f17adf
Use IntoAsyncIterator in for await loop desugaring 2023-12-22 11:01:06 -08:00
Eric Holk
8e34391d6a
Add IntoAsyncIterator 2023-12-22 11:01:05 -08:00
bors
398fd92e17 Auto merge of #119221 - matthiaskrgr:rollup-dh9exqf, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #117601 (Add support for hexagon-unknown-none-elf as target)
 - #119169 (Rid the AST & HIR pretty printer of cruft)
 - #119194 (Run fuchsia tests only on nightly)
 - #119201 (tests: fix overaligned-constant to not over-specify getelementptr instr)
 - #119215 (Emits error if has bound regions)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-22 18:32:16 +00:00
Matthias Krüger
b24e8784de
Rollup merge of #119215 - mu001999:fix/119209, r=Nilstrieb
Emits error if has bound regions

Fixes #119209
2023-12-22 19:01:28 +01:00
Matthias Krüger
41fbd25b73
Rollup merge of #119201 - durin42:overaligned-constant, r=Mark-Simulacrum
tests: fix overaligned-constant to not over-specify getelementptr instr

On LLVM 18 we get slightly different arguments here, so it's easier to just regex those away. The important details are all still asserted as I understand things.

Fixes #119193.

`@rustbot` label: +llvm-main
2023-12-22 19:01:27 +01:00
Matthias Krüger
c1263be8ea
Rollup merge of #119194 - pietroalbini:pa-disable-fuchsia-non-nightly, r=tmandry
Run fuchsia tests only on nightly

We discovered in https://github.com/rust-lang/rust/pull/119187 that the Fuchsia tests only work on nightly, and so we cannot have the `x86_64-gnu-integration` job run on beta and stable. This PR gates the job to only run in the nightly channel.

r? `@tmandry`
2023-12-22 19:01:27 +01:00
Matthias Krüger
15dc9f5bee
Rollup merge of #119169 - fmease:pretty-yeet-syntactic-cruft, r=compiler-errors
Rid the AST & HIR pretty printer of cruft

Found while working on #119163.

For `trait Trait: ?Sized {}` (semantically malformed), we currently output `trait Trait for ? Sized {}` (sic!) / `trait Trait for ? Sized { }` (sic!) if `-Zunpretty=expanded` / `-Zunpretty=hir` is passed.

`trait Tr for Sized? {}` (#15521) and later also `trait Tr for ?Sized {}` (I guess, #20194) is former Rust syntax. Hence I'm removing these outdated branches.

~~This will conflict with #119163, therefore marking this PR as blocked.~~ Rebased
2023-12-22 19:01:26 +01:00
Matthias Krüger
09684d2d31
Rollup merge of #117601 - androm3da:hexagon_unknown_none_elf, r=petrochenkov
Add support for hexagon-unknown-none-elf as target

Still TODO: document usage details for new target
2023-12-22 19:01:26 +01:00
r0cky
d3f466a3a7 Update test 2023-12-23 00:09:37 +08:00
r0cky
4830325a14 Emits error if has bound regions 2023-12-22 23:25:54 +08:00
bors
208dd2032b Auto merge of #118847 - eholk:for-await, r=compiler-errors
Add support for `for await` loops

This adds support for `for await` loops. This includes parsing, desugaring in AST->HIR lowering, and adding some support functions to the library.

Given a loop like:
```rust
for await i in iter {
    ...
}
```
this is desugared to something like:
```rust
let mut iter = iter.into_async_iter();
while let Some(i) = loop {
    match core::pin::Pin::new(&mut iter).poll_next(cx) {
        Poll::Ready(i) => break i,
        Poll::Pending => yield,
    }
} {
    ...
}
```

This PR also adds a basic `IntoAsyncIterator` trait. This is partly for symmetry with the way `Iterator` and `IntoIterator` work. The other reason is that for async iterators it's helpful to have a place apart from the data structure being iterated over to store state. `IntoAsyncIterator` gives us a good place to do this.

I've gated this feature behind `async_for_loop` and opened #118898 as the feature tracking issue.

r? `@compiler-errors`
2023-12-22 14:17:10 +00:00
León Orell Valerian Liehr
b09889b959
Rid the AST & HIR pretty printers of syntactic cruft 2023-12-22 14:32:40 +01:00
bors
c1fc1d18cd Auto merge of #116821 - Nadrieril:fix-opaque-ice, r=compiler-errors
Exhaustiveness: reveal opaque types properly

Previously, exhaustiveness had no clear policy around opaque types. In this PR I propose the following policy: within the body of an item that defines the hidden type of some opaque type, exhaustiveness checking on a value of that opaque type is performed using the concrete hidden type inferred in this body.

I'm not sure how consistent this is with other operations allowed on opaque types; I believe this will require FCP.

From what I can tell, this doesn't change anything for non-empty types.

The observable changes are:
- when the real type is uninhabited, matches within the defining scopes can now rely on that for exhaustiveness, e.g.:

```rust
#[derive(Copy, Clone)]
enum Void {}
fn return_never_rpit(x: Void) -> impl Copy {
    if false {
        match return_never_rpit(x) {}
    }
    x
}
```
- this properly fixes ICEs like https://github.com/rust-lang/rust/issues/117100 that occurred because a same match could have some patterns where the type is revealed and some where it is not.

Bonus subtle point: if `x` is opaque, a match like `match x { ("", "") => {} ... }` will constrain its type ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=901d715330eac40339b4016ac566d6c3)). This is not the case for `match x {}`: this will not constain the type, and will only compile if something else constrains the type to be empty.

Fixes https://github.com/rust-lang/rust/issues/117100

r? `@oli-obk`

Edited for precision of the wording

[Included](https://github.com/rust-lang/rust/pull/116821#issuecomment-1813171764) in the FCP on this PR is this rule:

> Within the body of an item that defines the hidden type of some opaque type, exhaustiveness checking on a value of that opaque type is performed using the concrete hidden type inferred in this body.
2023-12-22 12:12:12 +00:00
bjorn3
289a274036 Disable a rustc test that depends on -Cpanic=unwind 2023-12-22 11:58:54 +00:00
bjorn3
e935766d57 Ignore a rustc test that needs LTO support 2023-12-22 11:37:25 +00:00
bors
2c7e0fd373 Auto merge of #3237 - RalfJung:simd-loadstore, r=RalfJung
implement and test simd_masked_load and simd_masked_store

also extend the scatter/gather tests

Fixes https://github.com/rust-lang/miri/issues/3235
2023-12-22 11:29:56 +00:00
Ralf Jung
e8a4bd17f3 implement and test simd_masked_load and simd_masked_store 2023-12-22 12:25:53 +01:00
bjorn3
3847a018d5 Update Cranelift to 0.103 2023-12-22 11:07:03 +00:00
Ralf Jung
84304fc00a simd_scatter/gather: test OOB cases and the order of writes 2023-12-22 12:03:54 +01:00
Pietro Albini
71899c3e23 update cfg(bootstrap)s 2023-12-22 11:14:11 +01:00
Pietro Albini
f9f5840eb4
update cfg(bootstrap)s 2023-12-22 11:14:11 +01:00
Pietro Albini
bcdaa0d194
bump stage0 2023-12-22 11:04:31 +01:00
Pietro Albini
c00486c9bb
update version placeholders 2023-12-22 11:01:42 +01:00
Deadbeef
df1a4c630d clean up check_consts checks 2023-12-22 08:20:57 +00:00
bors
ef1b78eabe Auto merge of #119173 - compiler-errors:direct-coro-kind, r=TaKO8Ki
Encode `CoroutineKind` directly

Probably a quick optimization?

r? `@ghost`
2023-12-22 04:07:40 +00:00
bors
aaef5fe497 Auto merge of #119163 - fmease:refactor-ast-trait-bound-modifiers, r=compiler-errors
Refactor AST trait bound modifiers

Instead of having two types to represent trait bound modifiers in the parser / the AST (`parser::ty::BoundModifiers` & `ast::TraitBoundModifier`), only to map one to the other later, just use `parser::ty::BoundModifiers` (moved & renamed to `ast::TraitBoundModifiers`).

The struct type is more extensible and easier to deal with (see [here](https://github.com/rust-lang/rust/pull/119099/files#r1430749981) and [here](https://github.com/rust-lang/rust/pull/119099/files#r1430752116) for context) since it more closely models what it represents: A compound of two kinds of modifiers, constness and polarity. Modeling this as an enum (the now removed `ast::TraitBoundModifier`) meant one had to add a new variant per *combination* of modifier kind, which simply isn't scalable and which lead to a lot of explicit non-DRY matches.

NB: `hir::TraitBoundModifier` being an enum is fine since HIR doesn't need to worry representing invalid modifier kind combinations as those get rejected during AST validation thereby immensely cutting down the number of possibilities.
2023-12-22 02:00:55 +00:00
bors
cee794ee98 Auto merge of #119097 - nnethercote:fix-EmissionGuarantee, r=compiler-errors
Fix `EmissionGuarantee`

There are some problems with the `DiagCtxt` API related to `EmissionGuarantee`. This PR fixes them.

r? `@compiler-errors`
2023-12-22 00:03:57 +00:00
Kent Ross
f2e711e4c2 fix minor mistake in comments describing VecDeque resizing 2023-12-21 15:20:14 -08:00
Augie Fackler
58fdbd1479 tests: fix overaligned-constant to not over-specify getelementptr instr
On LLVM 18 we get slightly different arguments here, so it's easier to
just regex those away. The important details are all still asserted as I
understand things.

Fixes #119193.

@rustbot label: +llvm-main
2023-12-21 15:53:28 -05:00
bors
3d0e6bed60 Auto merge of #119190 - matthiaskrgr:rollup-jvl8vkj, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #118729 (Add release notes for 1.75.0)
 - #119124 (don't build `rust-analyzer-proc-macro-srv` on def config )
 - #119154 (Simple modification of `non_lifetime_binders`'s diagnostic information to adapt to type binders)
 - #119176 (Fix name error in aarch64_apple_watchos tier 3 target)
 - #119182 (Update sysinfo version to 0.30.0)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-21 20:50:46 +00:00
Till Wegmueller
074809bc81
Removing unneeded cpu defintion and add features analogous to netbsd/freebsd
Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2023-12-21 11:59:05 -08:00
Brian Cain
cc34942f12 Add support for hexagon-unknown-none-elf as target
Signed-off-by: Brian Cain <bcain@quicinc.com>
2023-12-21 09:34:29 -08:00
Pietro Albini
12b06ad51b
run fuchsia tests only on nightly 2023-12-21 18:27:24 +01:00
bors
23efae075a Auto merge of #3234 - RalfJung:rustup, r=RalfJung
Rustup
2023-12-21 16:46:51 +00:00
Ralf Jung
bddf1d7590 Merge from rustc 2023-12-21 17:45:02 +01:00
Ralf Jung
f0b84564d4 Preparing for merge from rustc 2023-12-21 17:44:27 +01:00
Matthias Krüger
6516e595c0
Rollup merge of #119182 - GuillaumeGomez:update-sysinfo, r=onur-ozkan
Update sysinfo version to 0.30.0

Following last `sysinfo` update. Nothing much needs to be changed here apparently.

r? `@onur-ozkan`
2023-12-21 16:43:08 +01:00
Matthias Krüger
81e5ca4d97
Rollup merge of #119176 - leohowell:fix-apple-watchos-target-name-error, r=lqd
Fix name error in aarch64_apple_watchos tier 3 target

fix llvm_target wrong name `aarch-apple-watchos` to `aarch64-apple-watchos`, sorry for my mistake.

previous pr: https://github.com/rust-lang/rust/pull/119074

r? compiler-team
2023-12-21 16:43:08 +01:00
Matthias Krüger
2b48e7dbcb
Rollup merge of #119154 - surechen:fix_119067, r=fmease
Simple modification of `non_lifetime_binders`'s diagnostic information to adapt to type binders

fixes #119067

Replace diagnostic information "lifetime bounds cannot be used in this context" to "bounds cannot be used in this context".

```rust
#![allow(incomplete_features)]
#![feature(non_lifetime_binders)]

trait Trait {}

trait Trait2
    where for <T: Trait> ():{}
//~^ ERROR bounds cannot be used in this context
```
2023-12-21 16:43:07 +01:00