Commit graph

153359 commits

Author SHA1 Message Date
Frank Steffahn
30f7b8915b Mailmap entry for myself 2021-08-20 12:11:45 +02:00
bors
9ccf661694 Auto merge of #88000 - bjorn3:fix_cg_llvm_clif_compile, r=Mark-Simulacrum
Fix compiling other codegen backends when llvm is enabled

Extracted from #81746

Without this change rustbuild will not pass the required linker argument to find libllvm. While other backends likely don't use libllvm, it is necessary to be able to link against rustc_driver as the llvm backend is linked into it.
2021-08-20 07:30:28 +00:00
bors
bcfd3f7e88 Auto merge of #86898 - the8472:path-cmp, r=dtolnay
Add fast path for Path::cmp that skips over long shared prefixes

```
# before
test path::tests::bench_path_cmp_fast_path_buf_sort               ... bench:      60,811 ns/iter (+/- 865)
test path::tests::bench_path_cmp_fast_path_long                   ... bench:       6,459 ns/iter (+/- 275)
test path::tests::bench_path_cmp_fast_path_short                  ... bench:       1,777 ns/iter (+/- 34)

# after
test path::tests::bench_path_cmp_fast_path_buf_sort               ... bench:      38,140 ns/iter (+/- 211)
test path::tests::bench_path_cmp_fast_path_long                   ... bench:       1,471 ns/iter (+/- 24)
test path::tests::bench_path_cmp_fast_path_short                  ... bench:       1,106 ns/iter (+/- 9)
```
2021-08-20 05:00:45 +00:00
Erik Desjardins
6ea536d99b Revert "Revert "Auto merge of #83417 - erikdesjardins:enableremovezsts, r=oli-obk""
This reverts commit 8e11199a15.
2021-08-19 22:28:32 -04:00
bors
7611fe438d Auto merge of #88039 - sexxi-goose:fix-87987, r=nikomatsakis
RFC2229 Only compute place if upvars can be resolved

Closes https://github.com/rust-lang/rust/issues/87987

This PR fixes an ICE when trying to unwrap an Err. This error appears when trying to convert a PlaceBuilder into Place when upvars can't yet be resolved. We should only try to convert a PlaceBuilder into Place if upvars can be resolved.

r? `@nikomatsakis`
2021-08-20 02:19:58 +00:00
bors
ebedfedcd8 Auto merge of #87996 - sexxi-goose:fix-87988, r=nikomatsakis
RFC2229 Add missing edge case

Closes https://github.com/rust-lang/rust/issues/87988

This PR fixes an ICE where a match discriminant is not being read when expected. This ICE was the result of a missing edge case which assumed that if a pattern is of type `PatKind::TupleStruct(..) | PatKind::Path(..) | PatKind::Struct(..) | PatKind::Tuple(..)` then a place could only be a multi variant if the place is of type kind Adt.
2021-08-19 23:33:22 +00:00
Dan Gohman
b4dfa198bf Fix doc test failures on Windows. 2021-08-19 16:15:29 -07:00
Mukund Lakshman
700b64e100 CI: Verify commits in beta & stable are in upstream branches.
Closes #74721
2021-08-19 22:49:52 +01:00
Santiago Pastorino
2644a159c7
Test that type alias impl trait happens in a submodule 2021-08-19 18:44:53 -03:00
Niko Matsakis
947c0de028 introduce a Coerce predicate 2021-08-19 17:28:24 -04:00
Niko Matsakis
5a8edc0b76 cleanup: extract a helper for coercion from inference variables 2021-08-19 17:28:24 -04:00
Niko Matsakis
5eca626e40 shallow resolve target type in coercion
We used to avoid doing this because we didn't want to make coercion depend on
the state of inference. For better or worse, we have moved away from this
position over time. Therefore, I am going to go ahead and resolve the `b`
target type early on so that it is done uniformly.

(The older technique for managing this was always something of a hack
regardless; if we really wanted to avoid integrating coercion and inference we
needed to be more disciplined about it.)
2021-08-19 17:28:24 -04:00
Niko Matsakis
7e0ae7d89b introduce a Diverging enum instead of a bool 2021-08-19 17:28:24 -04:00
Niko Matsakis
c1b4824800 factor fallback code into its own module 2021-08-19 17:28:24 -04:00
Joe Ardent
52a988344b Update release note for 1.55.0.
Added a line about new formatting option, `{lib}`, for `cargo
tree` (https://github.com/rust-lang/cargo/pull/9663).
2021-08-19 13:54:26 -07:00
bors
6d64f7f695 Auto merge of #88165 - GuillaumeGomez:rollup-4o0v2ps, r=GuillaumeGomez
Rollup of 8 pull requests

Successful merges:

 - #86123 (Preserve more spans in internal `rustc_queries!` macro)
 - #87874 (Add TcpStream type to TcpListener::incoming docs)
 - #88034 (rustc_privacy: Replace `HirId`s and `DefId`s with `LocalDefId`s where possible)
 - #88050 (Remove `HashStable` impls for `FileName` and `RealFileName`)
 - #88093 ([rustdoc] Wrap code blocks in `<code>` tag)
 - #88146 (Add tests for some `feature(const_evaluatable_checked)` incr comp issues)
 - #88153 (Update .mailmap)
 - #88159 (Use a trait instead of the now disallowed missing trait there)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-08-19 20:31:05 +00:00
Dan Gohman
e555003e6d Factor out a common RawFd/AsRawFd/etc for Unix and WASI. 2021-08-19 13:27:19 -07:00
Dan Gohman
0377a63352 Fix syntax for non-doc comments, and use crate:: instead of std::. 2021-08-19 12:23:04 -07:00
Cameron Steffen
ada92825c9 Fix clippy let expressions fallout 2021-08-19 14:17:05 -05:00
Dan Gohman
187ee5c824 Add I/O safety trait impls for process::Stdio and process::Child. 2021-08-19 12:02:41 -07:00
Dan Gohman
6f872880b4 Use the correct into_* on Windows to avoid dropping a stdio handle.
Use `into_raw_handle()` rather than `into_inner()` to completely consume a
`Handle` without dropping its contained handle.
2021-08-19 12:02:41 -07:00
Dan Gohman
9b99f8c454 Remove the #![feature(io_safety)] from lib.rs. 2021-08-19 12:02:40 -07:00
Dan Gohman
a7d9ab5835 Fix an unused import warning. 2021-08-19 12:02:40 -07:00
Dan Gohman
cada5fb336 Update PidFd for the new I/O safety APIs. 2021-08-19 12:02:40 -07:00
Dan Gohman
1ae1eeec25 Rename OptionFileHandle to HandleOrInvalid and make it just wrap an Option<OwnedHandle>
The name (and updated documentation) make the FFI-only usage clearer, and wrapping Option<OwnedHandle> avoids the need to write a separate Drop or Debug impl.

Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2021-08-19 12:02:40 -07:00
Dan Gohman
18a9f4628a Don't encourage migration until io_safety is stablized. 2021-08-19 12:02:40 -07:00
Dan Gohman
1dbd6d60f0 Factor out Unix and WASI fd code into a common module. 2021-08-19 12:02:40 -07:00
Dan Gohman
71dab738ac Synchronize minor differences between Unix and WASI implementations. 2021-08-19 12:02:40 -07:00
Dan Gohman
907f00be30 Add more comments about the INVALID_HANDLE_VALUE situation. 2021-08-19 12:02:40 -07:00
Dan Gohman
ab08639e59 Add comments about impls for File, TcpStream, ChildStdin, etc. 2021-08-19 12:02:40 -07:00
Dan Gohman
68964a7d68 Fix copypasta of "Unix" within the WASI directory. 2021-08-19 12:02:40 -07:00
Dan Gohman
1b35f7405a Reword the description of dup2/dup3. 2021-08-19 12:02:40 -07:00
Dan Gohman
6d7211738d Add Safety comments to the As* for Owned* implementations. 2021-08-19 12:02:40 -07:00
Dan Gohman
6486f89cbc Add Owned*, Borrowed*, and As* to the preludes. 2021-08-19 12:02:39 -07:00
Dan Gohman
0cb69dec57 Rename OwnedFd's private field to match it's debug output. 2021-08-19 12:02:39 -07:00
Dan Gohman
45b5de3376 Delete a spurious empty comment line. 2021-08-19 12:02:39 -07:00
Dan Gohman
926344a80f Add a comment about how OwnedHandle should not be used with registry handles. 2021-08-19 12:02:39 -07:00
Dan Gohman
31f7bf8271 Add a comment about OptionFileHandle. 2021-08-19 12:02:39 -07:00
Dan Gohman
6b4dbdbf47 Be more precise about mmap and undefined behavior.
`mmap` doesn't *always* cause undefined behavior; it depends on the
details of how you use it.
2021-08-19 12:02:39 -07:00
Dan Gohman
1f8a450cdd Add a test to ensure that RawFd is the size we assume it is. 2021-08-19 12:02:39 -07:00
Dan Gohman
1c6bf04edb Update library/std/src/os/windows/io/socket.rs
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2021-08-19 12:02:39 -07:00
Dan Gohman
a23ca7ceb1 Update library/std/src/os/windows/io/handle.rs
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2021-08-19 12:02:39 -07:00
Dan Gohman
3a38511ab3 Update library/std/src/os/unix/io/fd.rs
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2021-08-19 12:02:39 -07:00
Dan Gohman
d15418586c I/O safety.
Introduce `OwnedFd` and `BorrowedFd`, and the `AsFd` trait, and
implementations of `AsFd`, `From<OwnedFd>` and `From<T> for OwnedFd`
for relevant types, along with Windows counterparts for handles and
sockets.

Tracking issue:
 - <https://github.com/rust-lang/rust/issues/87074>

RFC:
 - <https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md>
2021-08-19 12:02:39 -07:00
Charles Lew
c22dfab215 Add assertion to ensure the query doesn't get called before type infererence is done. 2021-08-20 02:37:00 +08:00
Guillaume Gomez
1095bb1eb2
Rollup merge of #88159 - spastorino:fix-unused-generic-param-test, r=oli-obk
Use a trait instead of the now disallowed missing trait there

To properly test the unused generic parameter and just that we need to use a trait in the tait. Missing the trait there is already tested and is not what we meant to test here.

r? `@oli-obk`
2021-08-19 19:30:12 +02:00
Guillaume Gomez
bcc3b4ef62
Rollup merge of #88153 - hkmatsumoto:mailmap, r=Mark-Simulacrum
Update .mailmap
2021-08-19 19:30:11 +02:00
Guillaume Gomez
01b0a8dce7
Rollup merge of #88146 - BoxyUwU:tests-cec-incr-comp, r=oli-obk
Add tests for some `feature(const_evaluatable_checked)` incr comp issues

Closes #77650
Closes #79251

#79251 didn't seem to be ICEing anymore so added regression tests for that aswell

r? `@oli-obk`
2021-08-19 19:30:10 +02:00
Guillaume Gomez
10165f8af9
Rollup merge of #88093 - Kobzol:rustdoc-wrap-code-in-code-tag, r=GuillaumeGomez
[rustdoc] Wrap code blocks in <code> tag

This PR modifies Rustdoc output so that fenced code snippets, items and whole file source codes are wrapped in `<pre><code>` instead of just `<pre>`. This should improve the semantic meaning of the generated content.

I'm not sure what to do about `render_attributes_in_pre` and `render_attributes_in_code`. These functions were clearly expected to be used for things inside `<pre>` or `<code>`, and since I added `<code>` in this PR, some of them will be used in a different context than before. However, it seems to me that even before they were not consistent. For example, `item_constant` used `render_attributes_in_code` for its attributes, however there was no `<code>` used for constants before this PR...

Should I create some `rustdoc-gui` tests? For example to check that all `<pre>` tags have a `<code>` child?

Fixes: https://github.com/rust-lang/rust/issues/88020
2021-08-19 19:30:09 +02:00
Guillaume Gomez
09d56a749c
Rollup merge of #88050 - Aaron1011:filename-hash-stable, r=michaelwoerister
Remove `HashStable` impls for `FileName` and `RealFileName`

These impls were unused, and incorrectly hashed the local
(non-remapped) path for `RealFileName::Remapped` (which would
break reproducible builds if these impls were used).
2021-08-19 19:30:07 +02:00