Commit graph

154883 commits

Author SHA1 Message Date
Eduard-Mihai Burtescu
e9b68304ef ty::layout: replicate layout_of setup for fn_abi_of_{fn_ptr,instance}. 2021-09-18 04:41:29 +03:00
bors
8e398f5ba7 Auto merge of #88965 - fee1-dead:const-drop-1, r=oli-obk
Fast reject for NeedsNonConstDrop

Hopefully fixes the regression in #88558.

I've always wanted to help with the performance of rustc, but it doesn't feel the same when you are fixing a regression caused by your own PR...

r? `@oli-obk`
2021-09-18 00:18:28 +00:00
Tomasz Miąsko
f1f1c8fa50 ./x.py test --bless 2021-09-18 00:00:00 +00:00
Tomasz Miąsko
3489ba3bbb Remove support for reentrant start blocks from codegen
The start block is guaranteed not to have any basic block predecessors.
2021-09-18 07:28:56 +02:00
Tomasz Miąsko
4d614e1d1f Do not collapse goto chains beginning with the start block
If any block on a goto chain has more than one predecessor, then the new
start block would have basic block predecessors.

Skip the transformation for the start block altogether, to avoid
violating the new invariant that the start block does not have any basic
block predecessors.
2021-09-18 07:28:55 +02:00
Tomasz Miąsko
5118dd5a2f Start block is not allowed to have basic block predecessors 2021-09-18 07:28:55 +02:00
Eduard-Mihai Burtescu
319dec89e7 rustc_codegen_llvm: move misplaced HasParamEnv impl. 2021-09-18 01:42:45 +03:00
Eduard-Mihai Burtescu
344df76fed ty::layout: intern FnAbis as &'tcx. 2021-09-18 01:42:45 +03:00
Eduard-Mihai Burtescu
0c02e3f550 ty::context: move interning Allocations and Layouts to direct_interners!. 2021-09-18 01:42:44 +03:00
Eduard-Mihai Burtescu
7f2f927eb8 ty::layout: propagate errors up to (but not out of) FnAbi::of_*. 2021-09-18 01:42:44 +03:00
Eduard-Mihai Burtescu
4d36faf9ef rustc_target: adjust_for_cabi -> adjust_for_foreign_abi. 2021-09-18 01:42:43 +03:00
Eduard-Mihai Burtescu
feca7d0a03 ty::layout: split out a private trait from FnAbiExt. 2021-09-18 01:42:43 +03:00
Eduard-Mihai Burtescu
a1d7c51d27 ty::layout: move trait FnAbiExt to just before its impl. 2021-09-18 01:42:43 +03:00
bors
a58db2e4dd Auto merge of #88962 - fee1-dead:const-drop, r=oli-obk
inline(always) on check_recursion_limit

r? `@oli-obk`

#88558 caused a regression, this PR adds `#[inline(always)]` to `check_recursion_limit`, a possible suspect of that regression.
2021-09-17 21:37:01 +00:00
DeveloperC286
05b01cd787 refactor: VecDeques IntoIter fields to private 2021-09-17 21:46:32 +01:00
bors
9dd4ce80fb Auto merge of #88956 - ehuss:update-cargo, r=ehuss
Update cargo

13 commits in e515c3277bf0681bfc79a9e763861bfe26bb05db..33ee5f82edb50af87b952c5b28de0f5fb41ebf18
2021-09-08 14:32:15 +0000 to 2021-09-17 13:51:54 +0000
- Update curl-sys (rust-lang/cargo#9917)
- Bump Cargo's curl requirement to 7.79.0 (rust-lang/cargo#9914)
- Revert "When a dependency does not have a version, git or path, fails directly" (rust-lang/cargo#9911)
- Add some contributor docs for debugging testsuite tests. (rust-lang/cargo#9904)
- Fix warnings when documenting with `--document-private-items` (rust-lang/cargo#9903)
- Improve "wrong output" error. (rust-lang/cargo#9905)
- Fix warnings from better precision of `dead_code` lint (rust-lang/cargo#9906)
- Bump to 0.58.0, update changelog (rust-lang/cargo#9900)
- Fix rustc --profile=dev unstable check. (rust-lang/cargo#9898)
- config.md: fix typo (rust-lang/cargo#9896)
- Enable some tests on windows. (rust-lang/cargo#9893)
- Enable strip test on macos. (rust-lang/cargo#9889)
- Fix `cargo fix --edition` on stable. (rust-lang/cargo#9890)
2021-09-17 18:48:26 +00:00
Eric Huss
1626feebf2 Update cargo 2021-09-17 10:55:59 -07:00
Sachin Cherian
ec34aa61d6 modify std::os docs to be more consistent
> add intra doc links
> add a usage example for the os::windows module
2021-09-17 23:23:21 +05:30
Aaron Hill
95bea1594c
Convert debug_assert to assert in CachingSourceMapView
I suspect that there's a bug somewhere in this code, which is
leading to the `predicates_of` ICE being seen in #89035
2021-09-17 12:01:29 -05:00
The8472
57465d9c1b use AtomicU64::fetch_update instead of handrolled RMW-loop 2021-09-17 18:54:24 +02:00
Maybe Waffle
71e2eacc7b Stabilize Iterator::map_while 2021-09-17 19:42:46 +03:00
bors
207d9558d0 Auto merge of #89047 - GuillaumeGomez:rollup-29gmr02, r=GuillaumeGomez
Rollup of 10 pull requests

Successful merges:

 - #86422 (Emit clearer diagnostics for parens around `for` loop heads)
 - #87460 (Point to closure when emitting 'cannot move out' for captured variable)
 - #87566 (Recover invalid assoc type bounds using `==`)
 - #88666 (Improve build command for compiler docs)
 - #88899 (Do not issue E0071 if a type error has already been reported)
 - #88949 (Fix handling of `hir::GenericArg::Infer` in `wrong_number_of_generic_args.rs`)
 - #88953 (Add chown functions to std::os::unix::fs to change the owner and group of files)
 - #88954 (Allow `panic!("{}", computed_str)` in const fn.)
 - #88964 (Add rustdoc version into the help popup)
 - #89012 (Suggest removing `#![feature]` for library features that have been stabilized)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-09-17 15:49:22 +00:00
Guillaume Gomez
101a88f950
Rollup merge of #89012 - vishadGoyal:issue-88802-fix, r=jyn514
Suggest removing `#![feature]` for library features that have been stabilized

Issue: https://github.com/rust-lang/rust/issues/88802
Delayed the check if #![feature] has been used to enable lib features in a non-nightly build to occur after TyCtxt has been constructed.
2021-09-17 17:41:21 +02:00
Guillaume Gomez
833358b964
Rollup merge of #88964 - GuillaumeGomez:version-help, r=Nemo157
Add rustdoc version into the help popup

After a discussion with a rustdoc user about a specific behaviour, we realized we were not talking about the same version. To add on top of it, it was actually not that simple to find out the version since it was hosted documentation.

So to simplify things, I added the version into the help popup:

![Screenshot from 2021-09-16 10-45-52](https://user-images.githubusercontent.com/3050060/133581128-b93b460a-e1cb-4a31-9f2f-97c7a916cfcc.png)

Does the version format looks or would you prefer that I add more information? We can also add the commit hash, commit date, host and release.

cc `@rust-lang/rustdoc`
r? `@jyn514`
2021-09-17 17:41:19 +02:00
Guillaume Gomez
eb62779f2d
Rollup merge of #88954 - nbdd0121:panic3, r=oli-obk
Allow `panic!("{}", computed_str)` in const fn.

Special-case `panic!("{}", arg)` and translate it to `panic_display(&arg)`. `panic_display` will behave like `panic_any` in cosnt eval and behave like `panic!(format_args!("{}", arg))` in runtime.

This should bring Rust 2015 and 2021 to feature parity in terms of `const_panic`; and hopefully would unblock the stabilisation of #51999.

`@rustbot` modify labels: +T-compiler +T-libs +A-const-eval +A-const-fn

r? `@oli-obk`
2021-09-17 17:41:19 +02:00
Guillaume Gomez
723d27934b
Rollup merge of #88953 - joshtriplett:chown, r=dtolnay
Add chown functions to std::os::unix::fs to change the owner and group of files

This is a straightforward wrapper that uses the existing helpers for C
string handling and errno handling.

Having this available is convenient for UNIX utility programs written in
Rust, and avoids having to call unsafe functions like `libc::chown`
directly and handle errors manually, in a program that may otherwise be
entirely safe code.

In addition, these functions provide a more Rustic interface by
accepting appropriate traits and using `None` rather than `-1`.
2021-09-17 17:41:18 +02:00
Guillaume Gomez
6f5c09849e
Rollup merge of #88949 - FabianWolff:issue-87563, r=estebank
Fix handling of `hir::GenericArg::Infer` in `wrong_number_of_generic_args.rs`

Fixes #87563. More precisely, I have fixed the "index out of bounds" error, which is what #87563 is about. The example given there still ICEs due to running into this `todo!()`, but I'd say that this is a separate issue:
c3c0f80d60/compiler/rustc_typeck/src/astconv/mod.rs (L460-L463)
2021-09-17 17:41:17 +02:00
Guillaume Gomez
307f2ddfa4
Rollup merge of #88899 - FabianWolff:issue-88844, r=matthewjasper
Do not issue E0071 if a type error has already been reported

Fixes #88844. A suggested fix is already included in the error message for E0412, so with my changes, E0071 is simply not emitted anymore if the type in question is a "type error". This makes sense, I think, because we cannot confidently state that something is "not a struct" if we couldn't resolve it properly; and it's unnecessary to pollute the output with this additional error message, as it is a direct consequence of the former error.

I have also addressed the issue mentioned in https://github.com/rust-lang/rust/issues/88844#issuecomment-917324856 by changing the fixed example in the documentation to more closely match the erroneous code example.
2021-09-17 17:41:16 +02:00
Guillaume Gomez
765f1533db
Rollup merge of #88666 - GuillaumeGomez:compiler-docs, r=Mark-Simulacrum
Improve build command for compiler docs

It was rather complicated to document rustc crates. With this, you can directly run:

```console
x.py doc compiler
x.py doc compiler/rustc_hir_pretty
```

The second commit adds the handling of the `--open` flag.

r? `@Mark-Simulacrum`
2021-09-17 17:41:15 +02:00
Guillaume Gomez
1b7896716e
Rollup merge of #87566 - JohnTitor:find-eqeq-on-assoc-type-bounds, r=estebank
Recover invalid assoc type bounds using `==`

Fix #87493
r? `@estebank`
2021-09-17 17:41:14 +02:00
Guillaume Gomez
aed7f00097
Rollup merge of #87460 - FabianWolff:issue-87456, r=Aaron1011
Point to closure when emitting 'cannot move out' for captured variable

Attempts to fix #87456. The error message now points to the capturing closure, but I was not able to explain _why_ the closure implements `Fn` or `FnMut` (`TypeckResults::closure_kind_origins` did not contain anything for the closure in question).

cc `@Aaron1011`
2021-09-17 17:41:13 +02:00
Guillaume Gomez
b6d0ccab72
Rollup merge of #86422 - JohnTitor:clearer-parens-err-for-loop, r=estebank
Emit clearer diagnostics for parens around `for` loop heads

Fixes #63113
r? `@estebank`
2021-09-17 17:41:12 +02:00
Guillaume Gomez
cd3f4da244 Add rustdoc version into the help popup 2021-09-17 17:32:57 +02:00
John Paul Adrian Glaubitz
5d22b1afe2 doc/platform-support: Add documentation for m68k-unknown-linux-gnu 2021-09-17 15:07:14 +00:00
John Paul Adrian Glaubitz
c99d365d7e doc/platform-support.md: Add m68k-unknown-linux-gnu as Tier 3 target 2021-09-17 15:07:14 +00:00
John Paul Adrian Glaubitz
2cef5d8091 library/std/env: Add 'm68k' to comment on ARCH constant 2021-09-17 15:07:14 +00:00
John Paul Adrian Glaubitz
fa27d50caa compiler/rustc_llvm: Enable M68k LLVM target 2021-09-17 15:07:14 +00:00
John Paul Adrian Glaubitz
5e56778dc8 libstd: Add m68k for raw type definitions on Linux 2021-09-17 15:07:14 +00:00
John Paul Adrian Glaubitz
13b029d6fc rustdoc: Add human-readable cfg string for m68k 2021-09-17 15:07:13 +00:00
John Paul Adrian Glaubitz
0e4e0ce884 compiletest: Add m68k to ARCH_TABLE 2021-09-17 15:07:13 +00:00
John Paul Adrian Glaubitz
33088b9395 ci: Add Dockerfile for dist-m68k-linux 2021-09-17 15:07:13 +00:00
John Paul Adrian Glaubitz
9d177f8926 build-manifest: Add m68k-unknown-linux-gnu target 2021-09-17 15:07:13 +00:00
John Paul Adrian Glaubitz
580559129b compiler/rustc_target: Add support for m68k-linux-gnu 2021-09-17 15:07:12 +00:00
John Paul Adrian Glaubitz
df7ad3af21 bootstrap: Add LLVM target matching for M68k 2021-09-17 15:07:12 +00:00
John Paul Adrian Glaubitz
0ad0d305ff bootstrap: Add cputype matching for m68k 2021-09-17 15:07:12 +00:00
Michael Woerister
4d151d92de Update odht to 0.2.1 2021-09-17 15:57:57 +02:00
Guillaume Gomez
57ee7a63eb Correctly handle "--open" option when building compiler docs 2021-09-17 13:38:56 +02:00
Guillaume Gomez
bc49c3b651 Allow to pass "compiler" arguments to doc subcommand 2021-09-17 13:37:24 +02:00
bors
e0c38af27c Auto merge of #88945 - Aaron1011:no-projection-completion, r=wesleywiser,jackh726
Remove concept of 'completion' from the projection cache

Fixes #88910

When we initially store a `NormalizedTy` in the projection cache,
we discard all obligations that we can (while ensuring that we
don't cause any issues with incremental compilation).

Marking a projection cache entry as 'completed' discards all
obligations associated with it. This can only cause problems,
since any obligations stored in the cache are there for a reason
(e.g. they evaluate to `EvaluatedToOkModuloRegions`).

This commit removes `complete` and `complete_normalized` entirely.
2021-09-17 09:44:28 +00:00
bors
1c03f0d0ba Auto merge of #89037 - JohnTitor:rollup-rd9btbs, r=JohnTitor
Rollup of 10 pull requests

Successful merges:

 - #86382 (Make diagnostics clearer for `?` operators)
 - #87529 (Fix ICE in `improper_ctypes_definitions` lint with all-ZST transparent types)
 - #88339 (Add TcpListener::into_incoming and IntoIncoming)
 - #88735 (Don't lint about missing code examples in derived traits)
 - #88751 (Couple of changes to FileSearch and SearchPath)
 - #88883 (Move some tests to more reasonable directories - 7)
 - #88887 (Const Deref)
 - #88911 (Improve error message for type mismatch in generator arguments)
 - #89014 (PassWrapper: handle separate Module*SanitizerPass)
 - #89033 (Set the library path in sysroot-crates-are-unstable)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-09-17 06:47:35 +00:00