about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-08-01Auto merge of #81825 - voidc:pidfd, r=joshtriplettbors-7/+80
Add Linux-specific pidfd process extensions (take 2) Continuation of #77168. I addressed the following concerns from the original PR: - make `CommandExt` and `ChildExt` sealed traits - wrap file descriptors in `PidFd` struct representing ownership over the fd - add `take_pidfd` to take the fd out of `Child` - close fd when dropped Tracking Issue: #82971
2021-08-01Auto merge of #87664 - devnexen:netbsd_sanitizers_support, r=nagisabors-0/+3
netbsd x86_64 arch enable supported sanitizers.
2021-08-01Auto merge of #87546 - rusticstuff:issue87450-take-two, r=davidtwcobors-0/+43
Bail on any found recursion when expanding opaque types Fixes #87450. More of a bandaid because it does not fix the exponential complexity of the type folding used for opaque type expansion.
2021-08-01Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisabors-2/+2
more clippy::complexity fixes (also a couple of clippy::perf fixes)
2021-08-01Check whether clone3 syscall exists in pidfd testDominik Stolz-1/+19
2021-08-01Do not call getpid wrapper after fork in testsDominik Stolz-7/+35
The test calls libc::getpid() in the pre_exec hook and asserts that the returned value is different from the PID of the parent. However, libc::getpid() returns the wrong value. Before version 2.25, glibc caches the PID of the current process with the goal of avoiding additional syscalls. The cached value is only updated when the wrapper functions for fork or clone are called. In PR #81825 we switch to directly using the clone3 syscall. Thus, the cache is not updated and getpid returns the PID of the parent. source: https://man7.org/linux/man-pages/man2/getpid.2.html#NOTES
2021-08-01Auto merge of #85782 - badboy:build-ios-sim-target, r=Mark-Simulacrumbors-1/+1
Build aarch64-apple-ios-sim as part of the full macOS build Part of the [MCP 428](https://github.com/rust-lang/compiler-team/issues/428) to promote this target to Tier 2. This adds the aarch64-apple-ios-sim target as a tier 2 target, currently cross-compiled from our x86_64 apple builders. The compiler team has approved the addition per the MCP noted above, and the infrastructure team has not raised concerns with this addition at this time (as the CI time impact is expected to be minimal; this is only building std).
2021-07-31Auto merge of #87662 - FabianWolff:rb-string, r=estebankbors-0/+30
Suggest `br` if the unknown string prefix `rb` is found Currently, for the following code: ```rust fn main() { rb"abc"; } ``` we issue the following suggestion: ``` help: consider inserting whitespace here | 2 | rb "abc"; | -- ``` With my changes (only in edition 2021, where unknown prefixes became an error), I get: ``` help: use `br` for a raw byte string | 2 | br"abc"; | ^^ ```
2021-07-31Auto merge of #87610 - Aaron1011:bump-llvm-bugfix, r=cuviperbors-6/+2
Bump LLVM for RegAllocFast bugfix Fixes #83854 cc `@cuviper`
2021-07-31netbsd x86_64 arch enable supported sanitizers.David Carlier-0/+3
2021-07-31Auto merge of #87607 - JohnTitor:help-to-unused-must-use-op, r=estebankbors-142/+316
Add a hint that the expressions produce a value Fixes #85913 The second commit is semi-_unrelated_ but it allows us to run the related tests just on `src/test/ui/lint`.
2021-07-31Suggest `br` if the unknown string prefix `rb` is foundFabian Wolff-0/+30
2021-07-31Auto merge of #86264 - crlf0710:trait_upcasting_part1, r=nikomatsakisbors-7/+423
Trait upcasting coercion (part1) This revives the first part of earlier PR #60900 . It's not very clear to me which parts of that pr was design decisions, so i decide to cut it into pieces and land them incrementally. This allows more eyes on the details. This is the first part, it adds feature gates, adds feature gates tests, and implemented the unsize conversion part. (I hope i have dealt with the `ExistentialTraitRef` values correctly...) The next part will be implementing the pointer casting.
2021-07-31Add more tests to cover more corner cases of type-checking.Charles Lew-0/+342
2021-07-30Auto merge of #86754 - estebank:use-multispans-more, r=varkorbors-337/+479
Use `multipart_suggestions` more Built on top of #86532
2021-07-31Apply review suggestionYuki Okushi-60/+150
2021-07-31Move the `unused` dir to `lint`s subdirYuki Okushi-0/+0
2021-07-31Add a hint that the expressions produce a valueYuki Okushi-29/+113
2021-07-30Auto merge of #87640 - JohnTitor:rollup-yq24nq5, r=JohnTitorbors-43/+313
Rollup of 9 pull requests Successful merges: - #86072 (Cross compiling rustc_llvm on Darwin requires zlib.) - #87385 (Make `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` warn by default) - #87547 (Add missing examples for NonNull) - #87557 (Fix issue with autofix for ambiguous associated function from Rust 2021 prelude when struct is generic) - #87559 (Tweak borrowing suggestion in `for` loop) - #87596 (Add warning when whitespace is not skipped after an escaped newline) - #87606 (Add some TAIT-related regression tests) - #87609 (Add docs about performance and `Iterator::map` to `[T; N]::map`) - #87616 (Fix missing word in rustdoc book) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-07-31Rollup merge of #87616 - Wilfred:patch-1, r=jyn514Yuki Okushi-1/+1
Fix missing word in rustdoc book
2021-07-31Rollup merge of #87606 - JohnTitor:tait-tests, r=oli-obkYuki Okushi-0/+53
Add some TAIT-related regression tests Closes #74280, closes #77179. r? ``@oli-obk``
2021-07-31Rollup merge of #87559 - estebank:consider-borrowing, r=oli-obkYuki Okushi-14/+37
Tweak borrowing suggestion in `for` loop
2021-07-31Rollup merge of #87557 - rylev:fix-invalid-prelude-collision-error, ↵Yuki Okushi-0/+108
r=nikomatsakis Fix issue with autofix for ambiguous associated function from Rust 2021 prelude when struct is generic Fixes #86940 The test cases and associated issue should make it clear what specifically this is meant to fix. The fix is slightly hacky in that we check against the literal source code of the call site for the presence of `<` in order to determine if the user has included the generics for the struct (meaning we don't need to include them for them). r? ``@nikomatsakis``
2021-07-31Rollup merge of #87385 - Aaron1011:final-enable-semi, r=petrochenkovYuki Okushi-28/+114
Make `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` warn by default This PR makes the `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lint warn by default. To avoid showing a large number of un-actionable warnings to users, we only enable the lint for macros defined in the same crate. This ensures that users will be able to fix the warning by simply removing a semicolon. In the future, I'd like to enable this lint unconditionally, and eventually make it into a hard error in a future edition. This PR is a step towards that goal.
2021-07-30Add regression test for issue #87450.Hans Kratz-0/+43
2021-07-30Auto merge of #87421 - estebank:perf-run, r=oli-obkbors-2/+470
Do not discard `?Sized` type params and suggest their removal
2021-07-31Implement trait upcasting coercion type-checking.Charles Lew-5/+54
2021-07-31Add feature gate tests.Charles Lew-6/+31
2021-07-30Use multispan suggestions more oftenEsteban Küber-337/+479
* Use more accurate span for `async move` suggestion * Use more accurate span for deref suggestion * Use `multipart_suggestion` more often
2021-07-30Tweak borrowing suggestion in `for` loopEsteban Küber-14/+37
2021-07-30Do not discard `?Sized` type params and suggest their removalEsteban Küber-2/+470
2021-07-30Fix error with suggestion for how to disambiguate associated function when ↵Ryan Levick-0/+108
struct is generic
2021-07-30Auto merge of #85971 - FabianWolff:issue-85586, r=davidtwcobors-0/+21
Use more precise span for E0282 in cast expressions This pull request fixes #85586. The example code given there: ```rust fn main() { let a = [1, 2, 3].iter().sum(); let b = (a + 1) as usize; } ``` currently produces ``` error[E0282]: type annotations needed --> issue-85586.rs:3:13 | 3 | let b = (a + 1) as usize; | ^^^^^^^^^^^^^^^^ cannot infer type | = note: type must be known at this point error: aborting due to previous error ``` even though the type of the entire cast expression quite clearly should be `usize`. The error is in the cast's left-hand side, which is made explicit by the changes in this PR: ``` error[E0282]: type annotations needed --> issue-85586.rs:3:13 | 3 | let b = (a + 1) as usize; | ^^^^^^^ cannot infer type | = note: type must be known at this point error: aborting due to previous error ```
2021-07-30Auto merge of #87237 - jonas-schievink:const-for-and-try, r=oli-obkbors-16/+145
Add feature gates for `for` and `?` in consts These operations seems *relatively* straightforward to support, and only seem to be blocked on `impl const Trait`. I have included a working test for `const_try`, but `const_for` is currently unusable without reimplementing *every single* defaulted `Iterator` method, so I didn't do that. (both features still need tracking issues before this is merged)
2021-07-30Auto merge of #87615 - JohnTitor:rollup-t5jpmrg, r=JohnTitorbors-0/+72
Rollup of 10 pull requests Successful merges: - #87052 (Optimize fmt::PadAdapter::wrap) - #87522 (Fix assert in diy_float) - #87553 (Fix typo in rustc_driver::version) - #87554 (2229: Discr should be read when PatKind is Range) - #87564 (min_type_alias_impl_trait is going to be removed in 1.56) - #87574 (Update the examples in `String` and `VecDeque::retain`) - #87583 (Refactor compression cache in v0 symbol mangler) - #87585 (Add missing links for core::char types) - #87594 (fs File get_path procfs usage for netbsd same as linux.) - #87602 ([backtraces]: look for the `begin` symbol only after seeing `end`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-07-30Fix missing word in commentWilfred Hughes-1/+1
2021-07-30Rollup merge of #87602 - ↵Yuki Okushi-0/+58
wesleywiser:partially_fix_short_backtraces_windows_optimized, r=dtolnay [backtraces]: look for the `begin` symbol only after seeing `end` On `x86_64-pc-windows-msvc`, we often get backtraces which look like this: ``` 10: 0x7ff77e0e9be5 - std::panicking::rust_panic_with_hook 11: 0x7ff77e0e11b4 - std::sys_common::backtrace::__rust_begin_short_backtrace::h5769736bdb11136c 12: 0x7ff77e0e116f - std::sys_common::backtrace::__rust_end_short_backtrace::h61c7ecb1b55338ae 13: 0x7ff77e0f89dd - std::panicking::begin_panic::h8e60ef9f82a41805 14: 0x7ff77e0e108c - d 15: 0x7ff77e0e1069 - c 16: 0x7ff77e0e1059 - b 17: 0x7ff77e0e1049 - a 18: 0x7ff77e0e1039 - core::ptr::drop_in_place<std::rt::lang_start<()>::{{closure}}>::h1bfcd14d5e15ba81 19: 0x7ff77e0e1186 - std::sys_common::backtrace::__rust_begin_short_backtrace::h5769736bdb11136c 20: 0x7ff77e0e100c - std::rt::lang_start::{{closure}}::ha054184bbf9921e3 ``` Notice that `__rust_begin_short_backtrace` appears on frame 11 before `__rust_end_short_backtrace` on frame 12. This is because in typical release binaries without debug symbols, dbghelp.dll, which we use to walk and symbolize the stack, does not know where CGU internal functions start or end and so the closure invoked by `__rust_end_short_backtrace` is incorrectly described as `__rust_begin_short_backtrace` because it happens to be near that symbol. While that can obviously change, this has been happening quite consistently since #75048. Since this is a very small change to the std and the change makes sense by itself, I think this is worth doing. This doesn't completely resolve the situation for release binaries on Windows, since without debug symbols, the stack printed can still show incorrect symbol names (this is why the test uses `#[no_mangle]`) but it does slightly improve the situation in that you see the same backtrace you would see with `RUST_BACKTRACE=full` or in a debugger (without the uninteresting bits at the top and bottom). Fixes part of #87481
2021-07-30Rollup merge of #87554 - sexxi-goose:fix-issue-87426, r=nikomatsakisYuki Okushi-0/+14
2229: Discr should be read when PatKind is Range This PR fixes an issue related to pattern matching in closures when Edition 2021 is enabled. - If any of the patterns the discr is being matched on is `PatKind::Range` then the discr should be read r? ```@nikomatsakis``` Closes https://github.com/rust-lang/rust/issues/87426
2021-07-30Auto merge of #87483 - oli-obk:tait_ice, r=lqdbors-0/+73
Mir borrowck does not generate lifetime variables for 'static lifetimes during opaque type resolution Fixes #87455 This situation was unreachable before #87287 as we used to just grab the resolved opaque type from typeck and replaced all regions with new inference vars. After #87287 we let the `InferCx` in mir borrowck figure out the opaque type all by itself (which it already did before, but it only used the result to sanity check with the typeck result).
2021-07-29Bump LLVM for RegAllocFast bugfixAaron Hill-6/+2
Fixes #83854
2021-07-29Auto merge of #87285 - GuillaumeGomez:intra-doc-span, r=estebankbors-116/+239
Improve intra doc errors display #87169 `@jyn514` This is what I had in mind to avoid having duplicated backticks. I also gave a try to simply updating the span for the suggestion/help messages but I think this current one is better because less "noisy". Anyway, that allows you to see the result. ;)
2021-07-29Update testsJonas Schievink-16/+42
2021-07-29Add `const_for` testJonas Schievink-0/+25
2021-07-29Add feature gates for `for` and `?` in constsJonas Schievink-0/+78
2021-07-30Add some TAIT-related regression testsYuki Okushi-0/+53
2021-07-29[backtraces]: look for the `begin` symbol only after seeing `end`Wesley Wiser-1/+12
On `x86_64-pc-windows-msvc`, we often get backtraces which look like this: ``` 10: 0x7ff77e0e9be5 - std::panicking::rust_panic_with_hook 11: 0x7ff77e0e11b4 - std::sys_common::backtrace::__rust_begin_short_backtrace::h5769736bdb11136c 12: 0x7ff77e0e116f - std::sys_common::backtrace::__rust_end_short_backtrace::h61c7ecb1b55338ae 13: 0x7ff77e0f89dd - std::panicking::begin_panic::h8e60ef9f82a41805 14: 0x7ff77e0e108c - d 15: 0x7ff77e0e1069 - c 16: 0x7ff77e0e1059 - b 17: 0x7ff77e0e1049 - a 18: 0x7ff77e0e1039 - core::ptr::drop_in_place<std::rt::lang_start<()>::{{closure}}>::h1bfcd14d5e15ba81 19: 0x7ff77e0e1186 - std::sys_common::backtrace::__rust_begin_short_backtrace::h5769736bdb11136c 20: 0x7ff77e0e100c - std::rt::lang_start::{{closure}}::ha054184bbf9921e3 ``` Notice that `__rust_begin_short_backtrace` appears on frame 11 before `__rust_end_short_backtrace` on frame 12. This is because in typical release binaries without debug symbols, dbghelp.dll, which we use to walk and symbolize the stack, does not know where CGU internal functions start or end and so the closure invoked by `__rust_end_short_backtrace` is incorrectly described as `__rust_begin_short_backtrace` because it happens to be near that symbol. While that can obviously change, this has been happening quite consistently since #75048. Since this is a very small change to the std and the change makes sense by itself, I think this is worth doing. This doesn't completely resolve the situation for release binaries on Windows, since without debug symbols, the stack printed can still show incorrect symbol names (this is why the test uses `#[no_mangle]`) but it does slightly improve the situation in that you see the same backtrace you would see with `RUST_BACKTRACE=full` or in a debugger (without the uninteresting bits at the top and bottom).
2021-07-29Add regression testWesley Wiser-0/+47
2021-07-29Auto merge of #87579 - flip1995:clippyup, r=Manishearthbors-3113/+3436
Update Clippy r? `@Manishearth`
2021-07-29Update rustdoc-ui tests for intra-doc links errorsGuillaume Gomez-92/+166
2021-07-29Remove unnecessary trailing semicolons from clippy testsAaron Hill-2/+2