Commit Graph

212156 Commits

Author SHA1 Message Date
Joshua Nelson
a06e5decaf Link to other resources instead of inlining their information
The other places are more accurate and up-to-date.

- Link to `std-dev-guide` in CONTRIBUTING.md

  Thom and Mara said the guide is in reasonably good shape, and it's tailored more closely to people working on the standard library.

- Link to CONTRIBUTING.md instead of rustc-dev-guide in the main readme

  CONTRIBUTING.md has more information and also links the std-dev-guide.

- Link to forge for the list of tested platforms; the one in the readme
  was hopelessly out of date.
2022-12-23 19:03:50 -06:00
bors
7632db0e87 Auto merge of #105415 - nikic:update-llvm-10, r=cuviper
Update LLVM submodule

This is a rebase to LLVM 15.0.6.

Fixes #103380.
Fixes #104099.
2022-12-08 07:46:42 +00:00
bors
f5418b09e8 Auto merge of #105425 - matthiaskrgr:rollup-3ngvxmt, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #105267 (Don't ICE in ExprUseVisitor on FRU for non-existent struct)
 - #105343 (Simplify attribute handling in rustc_ast_lowering)
 - #105368 (Remove more `ref` patterns from the compiler)
 - #105400 (normalize before handling simple checks for evaluatability of `ty::Const`)
 - #105403 (rustdoc: simplify CSS selectors for item table `.stab`)
 - #105418 (fix: remove hack from link.rs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-08 03:04:51 +00:00
Matthias Krüger
4968af0ee8
Rollup merge of #105418 - BelovDV:fix-libc-hack, r=petrochenkov
fix: remove hack from link.rs

This logic implemented in libc.

r? `@petrochenkov`
2022-12-07 15:39:09 +01:00
Matthias Krüger
c75478b246
Rollup merge of #105403 - notriddle:notriddle/item-stab-css, r=GuillaumeGomez
rustdoc: simplify CSS selectors for item table `.stab`

The module-item and import-item classes are attached to the item-left. Just target that, instead.
2022-12-07 15:39:09 +01:00
Matthias Krüger
b23419b03d
Rollup merge of #105400 - BoxyUwU:braced_param_evaluatability, r=oli-obk
normalize before handling simple checks for evaluatability of `ty::Const`

`{{{{{{{ N }}}}}}}` is desugared into a `ConstKind::Unevaluated` for an anonymous `const` item so when calling `is_const_evaluatable` on it we skip the `ConstKind::Param(_) => Ok(())` arm which is incorrect.
2022-12-07 15:39:08 +01:00
Matthias Krüger
52cec8c99f
Rollup merge of #105368 - WaffleLapkin:deref-even-harder, r=TaKO8Ki
Remove more `ref` patterns from the compiler

Previous PR: #105045
2022-12-07 15:39:07 +01:00
Matthias Krüger
95da525982
Rollup merge of #105343 - nbdd0121:hir, r=fee1-dead
Simplify attribute handling in rustc_ast_lowering

Given that attributes is stored in a separate BTreeMap, it's not necessary to pass it in when constructing `hir::Expr`. We can just construct `hir::Expr` and then call `self.lower_attrs` later if it needs attributes.

As most desugaring code don't use attributes, this allows some code cleanup.
2022-12-07 15:39:07 +01:00
Matthias Krüger
3bcfa4c459
Rollup merge of #105267 - compiler-errors:issue-104613, r=oli-obk
Don't ICE in ExprUseVisitor on FRU for non-existent struct

Fixes #104613
Fixes #105202
2022-12-07 15:39:06 +01:00
bors
01fbc5ae78 Auto merge of #103459 - ChrisDenton:propagate-nulls, r=thomcc
Pass on null handle values to child process

Fixes #101645

In Windows, stdio handles are (semantically speaking) `Option<Handle>` where `Handle` is a non-zero value. When spawning a process with `Stdio::Inherit`, Rust currently turns zero values into `-1` values. This has the unfortunate effect of breaking console subprocesses (which typically need stdio) that are spawned from gui applications (that lack stdio by default) because the console process won't be assigned handles from the newly created console (as they usually would in that situation). Worse, `-1` is actually [a valid handle](https://doc.rust-lang.org/std/os/windows/io/struct.OwnedHandle.html) which means "the current process". So if a console process, for example, waits on stdin and it has a `-1` value then the process will end up waiting on itself.

This PR fixes it by propagating the nulls instead of converting them to `-1`.

While I think the current behaviour is a mistake, changing it (however justified) is an API change so I think this PR should at least have some input from t-libs-api. So choosing at random...

r? `@joshtriplett`
2022-12-07 13:52:52 +00:00
bors
91b8f34ac2 Auto merge of #104799 - pcc:linkage-fn, r=tmiasko
Support Option and similar enums as type of static variable with linkage attribute

Compiler MCP:
rust-lang/compiler-team#565
2022-12-07 10:24:59 +00:00
Daniil Belov
a9cf163c08 fix: remove hack from link.rs (moved to libc) 2022-12-07 13:13:58 +03:00
Nikita Popov
530a687a4b Update LLVM submodule 2022-12-07 08:40:49 +01:00
bors
ec28f5338b Auto merge of #105395 - sunfishcode:sunfishcode/update-wasi, r=pietroalbini
Update the wasi toolchain.

Update the WASI build to LLVM 15.0 and the wasi-libc version from [wasi-sdk-17].

This will require a ci-mirrors.rust-lang.org file load. Specifically, we need [this LLVM release tarball] uploaded to be downloadable from [this URL].

The biggest change in wasi-sdk-17 is that user exports no longer automatically run constructor functions. More details at: https://github.com/WebAssembly/WASI/issues/493.

[this LLVM release tarball]: https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
[this URL]: https://ci-mirrors.rust-lang.org/rustc/2022-12-06-clang%2Bllvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
[wasi-sdk-17]: https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-17
2022-12-07 06:16:19 +00:00
bors
e491d2b24d Auto merge of #105291 - nnethercote:remove-LintPassObjects, r=cjgillot
Remove `{Early,Late}LintPassObjects`.

`EarlyContextAndPass` wraps a single early lint pass. We aggregate multiple passes into that single pass by using `EarlyLintPassObjects`.

This commit removes `EarlyLintPassObjects` by changing `EarlyContextAndPass` into `EarlyContextAndPasses`. I.e. it just removes a level of indirection. This makes the code simpler and slightly faster.

The commit does likewise for late lints.

r? `@cjgillot`
2022-12-07 03:52:19 +00:00
bors
d43674e2c9 Auto merge of #105397 - matthiaskrgr:rollup-xv5imz8, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #105298 (llvm-wrapper: adapt for an LLVM API change)
 - #105358 (Add a test for #104260)
 - #105380 (add const generics ping files things for me)
 - #105382 (remove an excess `this`)
 - #105388 (rustdoc: remove redundant CSS `.import-item .stab { font-size }`)
 - #105390 (unstable-book: Add `ignore` to `abi_efiapi` example code)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-07 00:32:57 +00:00
Michael Howell
75aef7036f rustdoc: simplify CSS selectors for item table .stab
The module-item and import-item classes are attached to the item-left.
Just target that, instead.
2022-12-06 17:10:17 -07:00
Boxy
9f438bef0b normalize before matching on ConstKind 2022-12-06 22:53:13 +00:00
Matthias Krüger
62d5beed0f
Rollup merge of #105390 - nicholasbishop:bishop-example-ignore, r=ehuss
unstable-book: Add `ignore` to `abi_efiapi` example code

This example doesn't compile on targets that don't support UEFI, as reported here:
https://github.com/rust-lang/rust/pull/104793#issuecomment-1339783727
2022-12-06 23:13:52 +01:00
Matthias Krüger
2ee1573fa5
Rollup merge of #105388 - notriddle:notriddle/item-stab-font-size, r=GuillaumeGomez
rustdoc: remove redundant CSS `.import-item .stab { font-size }`

This sets the exact same font size that `.stab` has by default anyway. It used to be slightly different, but dd5ff428ed made it identical.
2022-12-06 23:13:51 +01:00
Matthias Krüger
280501d6bc
Rollup merge of #105382 - BoxyUwU:fixme_typo_sadface, r=lcnr
remove an excess `this`
2022-12-06 23:13:51 +01:00
Matthias Krüger
b3a69bf34e
Rollup merge of #105380 - BoxyUwU:triagebot_ping_pls, r=lcnr
add const generics ping files things for me

r? `@lcnr`
2022-12-06 23:13:50 +01:00
Matthias Krüger
001bd5128b
Rollup merge of #105358 - TaKO8Ki:fix-104260, r=estebank
Add a test for #104260

Fixes #104260
2022-12-06 23:13:50 +01:00
Matthias Krüger
e434f613fd
Rollup merge of #105298 - krasimirgg:llvm-16-dec-1, r=cuviper
llvm-wrapper: adapt for an LLVM API change

Adapts llvm-wrapper for 8c7c20f033.
No functional changes intended.

Found via our experimental rust + llvm @ HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/15404#0184d95d-5a68-4db6-ad32-51ddbc3ab543/202-571
2022-12-06 23:13:49 +01:00
bors
023b5136b5 Auto merge of #105271 - eduardosm:inline-always-int-conv, r=scottmcm
Make integer-to-integer `From` impls `#[inline(always)]`

Splited from https://github.com/rust-lang/rust/pull/105262
2022-12-06 21:41:04 +00:00
Dan Gohman
3e671fee5f Update the wasi toolchain.
Update the WASI build to LLVM 15.0 and the wasi-libc version from [wasi-sdk-17].

This will require a ci-mirrors.rust-lang.org file load. Specifically, we
need [this LLVM release tarball] uploaded to be downloadable from
[this URL].

[this LLVM release tarball]: https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
[this URL]: https://ci-mirrors.rust-lang.org/rustc/2022-12-06-clang%2Bllvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
[wasi-sdk-17]: https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-17
2022-12-06 13:13:11 -08:00
Nicholas Bishop
bc38c2ae67 unstable-book: Add ignore to abi_efiapi example code
This example doesn't compile on targets that don't support UEFI, as
reported here:
https://github.com/rust-lang/rust/pull/104793#issuecomment-1339783727
2022-12-06 14:45:38 -05:00
Michael Howell
958a1ae0f7 rustdoc: remove redundant CSS .import-item .stab { font-size }
This sets the exact same font size that `.stab` has by default anyway.
It used to be slightly different, but
dd5ff428ed made it identical.
2022-12-06 11:56:22 -07:00
bors
b28d30e1e3 Auto merge of #105378 - matthiaskrgr:rollup-fjeorw5, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #104898 (Put all cached values into a central struct instead of just the stable hash)
 - #105004 (Fix `emit_unused_delims_expr` ICE)
 - #105174 (Suggest removing struct field from destructive binding only in shorthand scenario)
 - #105250 (Replace usage of `ResumeTy` in async lowering with `Context`)
 - #105286 (Add -Z maximal-hir-to-mir-coverage flag)
 - #105320 (rustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles)
 - #105349 (Point at args in associated const fn pointers)
 - #105362 (Cleanup macro-expanded code in `rustc_type_ir`)
 - #105370 (Remove outdated syntax from trait alias pretty printing)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-06 18:51:14 +00:00
Krasimir Georgiev
75aec4703d llvm-wrapper: adapt for and LLVM API change 2022-12-06 18:25:33 +00:00
Chris Denton
93b774a2a4
Don't set STARTF_USESTDHANDLES if none are set 2022-12-06 17:26:21 +00:00
Boxy
3ca5c821c2
CONSISTENCY
Co-authored-by: lcnr <rust@lcnr.de>
2022-12-06 16:45:11 +00:00
Boxy
0070fae2dc typo :( 2022-12-06 16:40:57 +00:00
Boxy
50f090002a add cg ping files things 2022-12-06 16:33:19 +00:00
Matthias Krüger
97008a23fc
Rollup merge of #105370 - WaffleLapkin:pp, r=oli-obk
Remove outdated syntax from trait alias pretty printing

Given the following program:
```rust
#![feature(trait_alias)]
trait A = ?Sized;

fn main() {}
```
Old output of `rustc +nightly ./t.rs -Zunpretty=normal`:
```rust
#![feature(trait_alias)]
trait A for ? Sized ;

fn main() {}
```
New output of `rustc +a ./t.rs -Zunpretty=normal`:
```rust
#![feature(trait_alias)]
trait A = ?Sized;

fn main() {}
```

cc `@durka` (you've written the `FIXME` in #45047, see https://github.com/rust-lang/rust/pull/45047#discussion_r144960751)
2022-12-06 16:54:57 +01:00
Matthias Krüger
4f527a55de
Rollup merge of #105362 - WaffleLapkin:🙅, r=oli-obk
Cleanup macro-expanded code in `rustc_type_ir`

We could of course just leave this as-is, but every time I go-to-def to this file it's painful to see all this `(&A(ref __self_1_0),)` stuff.
2022-12-06 16:54:56 +01:00
Matthias Krüger
4f919e4628
Rollup merge of #105349 - compiler-errors:point-at-assoc-ct-fn-ptr-arg, r=cjgillot
Point at args in associated const fn pointers

Tiny follow-up to #105201, not so sure it's worth it but 🤷

The UI test example is a bit more compelling when it's `GlUniformScalar::FACTORY`

r? `@cjgillot`
2022-12-06 16:54:56 +01:00
Matthias Krüger
dc07e1bbdd
Rollup merge of #105320 - notriddle:notriddle/rustdoc-toggle-hideme-2, r=GuillaumeGomez
rustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles

This code uses a special `hideme` class anyway, so just style that.
2022-12-06 16:54:55 +01:00
Matthias Krüger
c699b05306
Rollup merge of #105286 - willcrichton:maximal-hir-to-mir-coverage, r=cjgillot
Add -Z maximal-hir-to-mir-coverage flag

This PR adds a new unstable flag `-Z maximal-hir-to-mir-coverage` that changes the behavior of `maybe_lint_level_root_bounded`, pursuant to [a discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Mapping.20MIR.20to.20HIR). When enabled, this function will not search upwards for a lint root, but rather immediately return the provided HIR node ID. This change increases the granularity of the mapping between MIR locations and HIR nodes inside the `SourceScopeLocalData` data structures. This increase in granularity is useful for rustc consumers like [Flowistry](https://github.com/willcrichton/flowistry) that rely on getting source-mapping information about the MIR CFG that is as precise as possible.

A test `maximal_mir_to_hir_coverage.rs` has been added to verify that this flag does not break anything.

r? `@cjgillot`

cc `@gavinleroy`
2022-12-06 16:54:55 +01:00
Matthias Krüger
967085ecdf
Rollup merge of #105250 - Swatinem:async-rm-resumety, r=oli-obk
Replace usage of `ResumeTy` in async lowering with `Context`

Replaces using `ResumeTy` / `get_context` in favor of using `&'static mut Context<'_>`.

Usage of the `'static` lifetime here is technically "cheating", and replaces the raw pointer in `ResumeTy` and the `get_context` fn that pulls the correct lifetimes out of thin air.

fixes https://github.com/rust-lang/rust/issues/104828 and https://github.com/rust-lang/rust/pull/104321#issuecomment-1336363077

r? `@oli-obk`
2022-12-06 16:54:54 +01:00
Matthias Krüger
90d84ce3a2
Rollup merge of #105174 - chenyukang:yukang/fix-105028-unused, r=eholk
Suggest removing struct field from destructive binding only in shorthand scenario

Fixes #105028
2022-12-06 16:54:53 +01:00
Matthias Krüger
b29a4f9bac
Rollup merge of #105004 - TaKO8Ki:fix-104897, r=wesleywiser
Fix `emit_unused_delims_expr` ICE

Fixes #104897

This is also related to #104433.
2022-12-06 16:54:53 +01:00
Matthias Krüger
db416ea195
Rollup merge of #104898 - oli-obk:group_all_the_things, r=wesleywiser
Put all cached values into a central struct instead of just the stable hash

cc `@nnethercote`

this allows re-use of the type for Predicate without duplicating all the logic for the non-hash cached fields
2022-12-06 16:54:52 +01:00
bors
e60fbaf4ce Auto merge of #105229 - saethlin:zst-writes-to-unions, r=oli-obk
Re-enable removal of ZST writes to unions

This was previously disabled because Miri was lazily allocating unsized locals. But we aren't doing that anymore since  https://github.com/rust-lang/rust/pull/98831, so we can have this optimization back.
2022-12-06 15:35:55 +00:00
Maybe Waffle
700c095306 rustc_builtin_macros: remove ref patterns
... and other pattern matching improvements
2022-12-06 14:45:58 +00:00
Maybe Waffle
244990a6e9 rustc_attr remove ref patterns
...and some if-let-elses too :P
2022-12-06 14:45:58 +00:00
Maybe Waffle
c75817fb1b rustc_borrowck: remove ref patterns 2022-12-06 14:45:58 +00:00
Maybe Waffle
12ce0c2a89 Remove outdated syntax from trait alias pretty printing 2022-12-06 13:45:11 +00:00
Maybe Waffle
e12d22239a Add debug asserts to hand-implemented Ord/Eq impls 2022-12-06 13:38:50 +00:00
bors
b6852428a8 Auto merge of #105365 - matthiaskrgr:rollup-g0mrrt7, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #104439 (Add prototype to generate `COPYRIGHT` from REUSE metadata)
 - #105005 (On E0195 point at where clause lifetime bounds)
 - #105098 (propagate the error from parsing enum variant to the parser and emit out)
 - #105243 (remove no-op 'let _ = ')
 - #105254 (Recurse into nested impl-trait when computing variance.)
 - #105287 (Synthesize substitutions for bad auto traits in dyn types)
 - #105310 (Be more careful about unresolved exprs in suggestion)
 - #105318 (Make `get_impl_future_output_ty` work with AFIT)
 - #105339 (support `ConstKind::Expr` in `is_const_evaluatable` and `WfPredicates::compute`)
 - #105340 (Avoid ICE by accounting for missing type)
 - #105342 (Make `note_obligation_cause_code`  take a `impl ToPredicate` for predicate)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-06 12:29:38 +00:00