about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-03-20Preserve the Windows `GetLastError` error in `HandleOrInvalid`.Dan Gohman-2/+18
In the `TryFrom<HandleOrInvalid> for OwnedHandle` and `TryFrom<HandleOrNull> for OwnedHandle` implemenations, `forget` the owned handle on the error path, to avoid calling `CloseHandle` on an invalid handle. It's harmless, except that it may overwrite the thread's `GetLastError` error.
2022-03-20Auto merge of #95144 - RalfJung:miri, r=RalfJungbors-8/+8
update Miri
2022-03-20update MiriRalf Jung-8/+8
2022-03-20Auto merge of #95142 - bjorn3:sync_cg_clif-2022-03-20, r=bjorn3bors-506/+454
Sync rustc_codegen_cranelift r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2022-03-20Add once_cell as allowed cg_clif dependencybjorn3-0/+1
2022-03-20Merge commit '370c397ec9169809e5ad270079712e0043514240' into ↵bjorn3-506/+453
sync_cg_clif-2022-03-20
2022-03-20Auto merge of #95071 - RalfJung:arbitrary-self-dyn, r=oli-obkbors-15/+40
Miri: implement arbitrary-self dyn receivers Roughly follows the [codegen logic](https://github.com/rust-lang/rust/blob/851fcc7a54262748b1aa9e16de91453998d896f3/compiler/rustc_codegen_ssa/src/mir/block.rs#L809). Fixes https://github.com/rust-lang/miri/issues/1038 r? `@oli-obk` Cc `@eddyb`
2022-03-20Auto merge of #92962 - frank-king:btree_entry_no_insert, r=Amanieubors-41/+86
BTreeMap::entry: Avoid allocating if no insertion This PR allows the `VacantEntry` to borrow from an empty tree with no root, and to lazily allocate a new root node when the user calls `.insert(value)`.
2022-03-20Run part of the simd test suitebjorn3-1/+16
2022-03-20Ignore rustc tests with needs-unwind directivebjorn3-25/+5
2022-03-20Move test and clarify problem of some other testsbjorn3-1/+4
2022-03-20Wrap write_mir_fn call in with_no_trimmed_paths!()bjorn3-1/+4
2022-03-20Auto merge of #95133 - matthiaskrgr:rollup-4q0u804, r=matthiaskrgrbors-17/+22
Rollup of 5 pull requests Successful merges: - #94749 (remove_dir_all: use fallback implementation on Miri) - #94948 (Fix diagnostics for `#![feature(deprecated_suggestion)]`) - #94989 (Add Stream alias for AsyncIterator) - #95108 (Give more details in `Display` for `hir::Target`) - #95110 (Provide more useful documentation of conversion methods) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-20Rollup merge of #95110 - wmstack:patch-1, r=Dylan-DPCMatthias Krüger-4/+4
Provide more useful documentation of conversion methods I thought that the documentation for these methods needed to be a bit more explanatory for new users. For advanced users, the comments are relatively unnecessary. I think it would be useful to explain precisely what the method does. As a new user, when you see the `into` method, where the type is inferred, if you are new you don't even know what you convert to, because it is implicit. I believe this can help new users understand.
2022-03-20Rollup merge of #95108 - scottmcm:more-in-target-display, r=Dylan-DPCMatthias Krüger-1/+5
Give more details in `Display` for `hir::Target` Made because I was making a code change and got a very confusing "should be applied to a method, not a method" error. ``` error[E0718]: `into_try_type` language item must be applied to a method --> library\core\src\ops\try_trait.rs:352:32 | 352 | #[cfg_attr(not(bootstrap), lang = "into_try_type")] | ^^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a method, not a method ``` With this change the error is more actionable ``` error[E0718]: `into_try_type` language item must be applied to a required trait method --> library\core\src\ops\try_trait.rs:352:32 | 352 | #[cfg_attr(not(bootstrap), lang = "into_try_type")] | ^^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a required trait method, not a provided trait method ```
2022-03-20Rollup merge of #94989 - compiler-errors:stream-alias, r=Dylan-DPCMatthias Krüger-0/+1
Add Stream alias for AsyncIterator Fixes #94965
2022-03-20Rollup merge of #94948 - jhpratt:rustc_deprecated, r=Dylan-DPCMatthias Krüger-6/+5
Fix diagnostics for `#![feature(deprecated_suggestion)]` Follow up from #94635, where I missed a couple things.
2022-03-20Rollup merge of #94749 - RalfJung:remove-dir-all-miri, r=cuviperMatthias Krüger-6/+7
remove_dir_all: use fallback implementation on Miri Fixes https://github.com/rust-lang/miri/issues/1966 The new implementation requires `openat`, `unlinkat`, and `fdopendir`. These cannot easily be shimmed in Miri since libstd does not expose APIs corresponding to them. So for now it is probably easiest to just use the fallback code in Miri. Nobody should run Miri as root anyway...
2022-03-20Auto merge of #95063 - tromey:fix-94458-gdb-char, r=Mark-Simulacrumbors-8/+25
Fix debuginfo tests with GDB 11.2 GDB 11.2 added support for DW_ATE_UTF, which caused some test failures. This fixes these tests by changing the format that is used, and adds a new test to verify that characters are emitted as something that GDB can print in a char-like way. Fixes #94458
2022-03-20Auto merge of #94976 - jclulow:solaris-festival, r=Mark-Simulacrumbors-8/+12
solaris build environment should include libsendfile/liblgrp As of version 0.2.120 of the libc crate, the solaris target now requires some additional libraries to be present in the sysroot. Note that the solaris target doesn't really build against files from Solaris, but rather against some files from DilOS (a platform similar to both Solaris and illumos). Pull in the extra libraries and their compilation links from that apt repository. This aims to assist with rust-lang/rust#94052.
2022-03-19Auto merge of #94372 - erikdesjardins:asrefinl, r=dtolnaybors-0/+3
Add #[inline] to trivial AsRef/AsMut impls These appeared uninlined in some perf runs, but they're trivial. r? `@ghost`
2022-03-19Auto merge of #95103 - ehuss:update-cargo, r=ehussbors-4/+4
Update cargo 9 commits in 65c82664263feddc5fe2d424be0993c28d46377a..109bfbd055325ef87a6e7f63d67da7e838f8300b 2022-03-09 02:32:56 +0000 to 2022-03-17 21:43:09 +0000 - Refactor RegistryData::load to handle management of the index cache (rust-lang/cargo#10482) - Separate VCS command paths with "--" (rust-lang/cargo#10483) - Fix panic when artifact target is used for `[target.'cfg(&lt;target&gt;)'.dependencies` (rust-lang/cargo#10433) - Bump git2@0.14.2 and libgit2-sys@0.13.2 (rust-lang/cargo#10479) - vendor: Don't allow multiple values for --sync (rust-lang/cargo#10448) - Use types to make clere (credential process || token) (rust-lang/cargo#10471) - Warning on conflicting keys (rust-lang/cargo#10316) - Registry functions return Poll to enable parallel fetching of index data (rust-lang/cargo#10064) - Refine the contributor guide (rust-lang/cargo#10468)
2022-03-19Auto merge of #95112 - Dylan-DPC:rollup-0jo0loj, r=Dylan-DPCbors-19/+220
Rollup of 5 pull requests Successful merges: - #93858 (Add a `process_group` method to UNIX `CommandExt`) - #94650 (Relax tests for Windows dos device names) - #94991 (Make Weak::new const) - #95072 (Re-enable parallel debuginfo tests) - #95109 (Extend --check-cfg tests to all predicate inside all/any) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-19Rollup merge of #95109 - Urgau:check-cfg-all-any, r=petrochenkovDylan DPC-1/+117
Extend --check-cfg tests to all predicate inside all/any Now that https://github.com/rust-lang/rust/pull/94295 is merged it's time to add more tests to check that all predicate inside `all` and `any` are always checked. r? `@petrochenkov`
2022-03-19Rollup merge of #95072 - tromey:parallel-debug-tests, r=tmiaskoDylan DPC-5/+0
Re-enable parallel debuginfo tests Debuginfo tests are serialized due to some older version of LLDB. However, that comment was last touched in 2014, so presumably these older versions are long since obsolete. Partially fixes bug #72719.
2022-03-19Rollup merge of #94991 - CAD97:const-weak-new, r=dtolnayDylan DPC-4/+6
Make Weak::new const Simple enough. This is const creation of an allocating container, but no actual allocation is done, because it's defined to.
2022-03-19Rollup merge of #94650 - ChrisDenton:windows-absolute-fix, r=dtolnayDylan DPC-7/+7
Relax tests for Windows dos device names Windows 11 no longer turn paths ending with dos device names into device paths. E.g. `C:\path\to\COM1.txt` used to get turned into `\\.\COM1`. Whereas now this path is left as is. Note though that if the given path is an exact (case-insensitive) match for the string `COM1` then it'll still be converted to `\\.\COM1`.
2022-03-19Rollup merge of #93858 - krallin:process-process_group, r=dtolnayDylan DPC-2/+90
Add a `process_group` method to UNIX `CommandExt` - Tracking issue: #93857 - RFC: https://github.com/rust-lang/rfcs/pull/3228 Add a `process_group` method to `std::os::unix::process::CommandExt` that allows setting the process group id (i.e. calling `setpgid`) in the child, thus enabling users to set process groups while leveraging the `posix_spawn` fast path.
2022-03-19Rustup to rustc 1.61.0-nightly (1bfe40d11 2022-03-18)bjorn3-5/+5
2022-03-19Sync from rust 31535841701e0bf7ef33998024376f2cedd8b3e3bjorn3-3/+17
2022-03-19Codegen 128bit atomic loads and stores for compiler builtins as trapbjorn3-75/+39
128bit atomics are unstable and only enabled on AArch64 and x86_64 macOS. Cranelift doesn't support 128bit atomics yet.
2022-03-19Extend --check-cfg tests to all predicate inside all/anyLoïc BRANSTETT-1/+117
2022-03-19Give more details in `Display` for `hir::Target`Scott McMurray-1/+5
Made because I was making a code change and got a very confusing "should be applied to a method, not a method" error. ``` error[E0718]: `into_try_type` language item must be applied to a method --> library\core\src\ops\try_trait.rs:352:32 | 352 | #[cfg_attr(not(bootstrap), lang = "into_try_type")] | ^^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a method, not a method ```
2022-03-19Provide more useful documentation of conversion methodsWaleed Dahshan-4/+4
I thought that the documentation for these methods needed to be a bit more explanatory for new users. For advanced users, the comments are relatively unnecessary. I think it would be useful to explain precisely what the method does. As a new user, when you see the `into` method, where the type is inferred, if you are new you don't even know what you convert to, because it is implicit. I believe this can help new users understand.
2022-03-18Update cargoEric Huss-4/+4
2022-03-19Auto merge of #95101 - Dylan-DPC:rollup-r1f1v9t, r=Dylan-DPCbors-114/+1159
Rollup of 6 pull requests Successful merges: - #92519 (Use verbatim paths for `process::Command` if necessary) - #92612 (Update stdlib for the l4re target) - #92663 (Implement `Write for Cursor<[u8; N]>`, plus `A: Allocator` cursor support) - #93263 (Consistently present absent stdio handles on Windows as NULL handles.) - #93692 (keyword_docs: document use of `in` with `pub` keyword) - #94984 (add `CStr` method that accepts any slice containing a nul-terminated string) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-19Rollup merge of #94984 - ericseppanen:cstr_from_bytes, r=Mark-SimulacrumDylan DPC-0/+106
add `CStr` method that accepts any slice containing a nul-terminated string I haven't created an issue (tracking or otherwise) for this yet; apologies if my approach isn't correct. This is my first code contribution. This change adds a member fn that converts a slice into a `CStr`; it is intended to be safer than `from_ptr` (which is unsafe and may read out of bounds), and more useful than `from_bytes_with_nul` (which requires that the caller already know where the nul byte is). The reason I find this useful is for situations like this: ```rust let mut buffer = [0u8; 32]; unsafe { some_c_function(buffer.as_mut_ptr(), buffer.len()); } let result = CStr::from_bytes_with_nul(&buffer).unwrap(); ``` This code above returns an error with `kind = InteriorNul`, because `from_bytes_with_nul` expects that the caller has passed in a slice with the NUL byte at the end of the slice. But if I just got back a nul-terminated string from some FFI function, I probably don't know where the NUL byte is. I would wish for a `CStr` constructor with the following properties: - Accept `&[u8]` as input - Scan for the first NUL byte and return the `CStr` that spans the correct sub-slice (see [future note below](https://github.com/rust-lang/rust/pull/94984#issuecomment-1070754281)). - Return an error if no NUL byte is found within the input slice I asked on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/CStr.20from.20.26.5Bu8.5D.20without.20knowing.20the.20NUL.20location.3F) whether this sounded like a good idea, and got a couple of positive-sounding responses from ``@joshtriplett`` and ``@AzureMarker.`` This is my first draft, so feedback is welcome. A few issues that definitely need feedback: 1. Naming. ``@joshtriplett`` called this `from_bytes_with_internal_nul` on Zulip, but after staring at all of the available methods, I believe that this function is probably what end users want (rather than the existing fn `from_bytes_with_nul`). Giving it a simpler name (**`from_bytes`**) implies that this should be their first choice. 2. Should I add a similar method on `CString` that accepts `Vec<u8>`? I'd assume the answer is probably yes, but I figured I'd try to get early feedback before making this change bigger. 3. What should the error type look like? I made a unit struct since `CStr::from_bytes` can only fail in one obvious way, but if I need to do this for `CString` as well then that one may want to return `FromVecWithNulError`. And maybe that should dictate the shape of the `CStr` error type also? Also, cc ``@poliorcetics`` who wrote #73139 containing similar fns.
2022-03-19Rollup merge of #93692 - mfrw:mfrw/document-keyword-in, r=dtolnayDylan DPC-0/+14
keyword_docs: document use of `in` with `pub` keyword Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Fixes: #93609
2022-03-19Rollup merge of #93263 - sunfishcode:sunfishcode/detatched-console-handle, ↵Dylan DPC-16/+100
r=dtolnay Consistently present absent stdio handles on Windows as NULL handles. This addresses #90964 by making the std API consistent about presenting absent stdio handles on Windows as NULL handles. Stdio handles may be absent due to `#![windows_subsystem = "windows"]`, due to the console being detached, or due to a child process having been launched from a parent where stdio handles are absent. Specifically, this fixes the case of child processes of parents with absent stdio, which previously ended up with `stdin().as_raw_handle()` returning `INVALID_HANDLE_VALUE`, which was surprising, and which overlapped with an unrelated valid handle value. With this patch, `stdin().as_raw_handle()` now returns null in these situation, which is consistent with what it does in the parent process. And, document this in the "Windows Portability Considerations" sections of the relevant documentation.
2022-03-19Rollup merge of #92663 - cuviper:generic-write-cursor, r=dtolnayDylan DPC-51/+86
Implement `Write for Cursor<[u8; N]>`, plus `A: Allocator` cursor support This implements `Write for Cursor<[u8; N]>`, and also adds support for generic `A: Allocator` in `Box` and `Vec` cursors. This was inspired by a user questioning why they couldn't write a `Cursor<[u8; N]>`: https://users.rust-lang.org/t/why-vec-and-not-u8-makes-cursor-have-write/68210 Related history: - #27197 switched `AsRef<[u8]>` for reading and seeking - #67415 tried to use `AsMut<[u8]>` for writing, but did not specialize `Vec`.
2022-03-19Rollup merge of #92612 - atopia:update-lib-l4re, r=dtolnayDylan DPC-17/+809
Update stdlib for the l4re target This PR contains the work by ``@humenda`` and myself to update standard library support for the x86_64-unknown-l4re-uclibc tier 3 target, split out from humenda/rust as requested in #85967. The changes have been rebased on current master and updated in follow up commits by myself. The publishing of the changes is authorized and preferred by the original author. To preserve attribution, when standard library changes were introduced as part of other changes to the compiler, I have kept the changes concerning the standard library and altered the commit messages as indicated. Any incompatibilities have been remedied in follow up commits, so that the PR as a whole should result in a clean update of the target.
2022-03-19Rollup merge of #92519 - ChrisDenton:command-maybe-verbatim, r=dtolnayDylan DPC-30/+44
Use verbatim paths for `process::Command` if necessary In #89174, the standard library started using verbatim paths so longer paths are usable by default. However, `Command` was originally left out because of the way `CreateProcessW` was being called. This was changed as a side effect of #87704 so now `Command` paths can be converted to verbatim too (if necessary).
2022-03-18Make Weak::new constCAD97-4/+6
2022-03-18add CStr::from_bytes_until_nulEric Seppanen-0/+106
This adds a member fn that converts a slice into a CStr; it is intended to be safer than from_ptr (which is unsafe and may read out of bounds), and more useful than from_bytes_with_nul (which requires that the caller already know where the nul byte is). feature gate: cstr_from_bytes_until_nul Also add an error type FromBytesUntilNulError for this fn.
2022-03-18Auto merge of #95090 - matthiaskrgr:rollup-pho6x6s, r=matthiaskrgrbors-31/+215
Rollup of 7 pull requests Successful merges: - #94115 (Let `try_collect` take advantage of `try_fold` overrides) - #94295 (Always evaluate all cfg predicate in all() and any()) - #94848 (Compare installed browser-ui-test version to the one used in CI) - #94993 (Add test for >65535 hashes in lexing raw string) - #95017 (Derive Eq for std::cmp::Ordering, instead of using manual impl.) - #95058 (Add use of bool::then in sys/unix/process) - #95083 (Document that `Option<extern "abi" fn>` discriminant elision applies for any ABI) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-18Bump impl Write for Cursor<[u8; N]> to 1.61David Tolnay-1/+1
2022-03-18Rollup merge of #95083 - danielhenrymantilla:patch-2, r=RalfJungMatthias Krüger-1/+3
Document that `Option<extern "abi" fn>` discriminant elision applies for any ABI The current phrasing was not very clear on that aspect. r? `@RalfJung` `@rustbot` modify labels: A-docs A-ffi
2022-03-18Rollup merge of #95058 - wcampbell0x2a:use-then-in-unix-process, r=dtolnayMatthias Krüger-3/+3
Add use of bool::then in sys/unix/process Remove `else { None }` in favor of using `bool::then()`
2022-03-18Rollup merge of #95017 - zachs18:cmp_ordering_derive_eq, r=Dylan-DPCMatthias Krüger-4/+14
Derive Eq for std::cmp::Ordering, instead of using manual impl. This allows consts of type Ordering to be used in patterns, and with feature(adt_const_params) allows using `Ordering` as a const generic parameter. Currently, `std::cmp::Ordering` implements `Eq` using a manually written `impl Eq for Ordering {}`, instead of `derive(Eq)`. This means that it does not implement `StructuralEq`. This commit removes the manually written impl, and adds `derive(Eq)` to `Ordering`, so that it will implement `StructuralEq`.
2022-03-18Rollup merge of #94993 - GrishaVar:too-many-hashes-test, r=Dylan-DPCMatthias Krüger-0/+17
Add test for >65535 hashes in lexing raw string