about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-05-08Only assert for unstable expectation ids after conversion (RFC 2383)xFrednet-6/+53
This ICE was reported by `@matthiaskrgr`. A big THANK YOU to him. See `rust#94953`
2022-05-08Auto merge of #96659 - thatzopoulos:issue-90679-fix, r=Mark-Simulacrumbors-1/+12
Improve error for missing cmake This PR updates the error message for a missing `cmake` to be more in line with the error message for a missing installation of `ninja`. The original issue, (#90679), suggests that both `ninja` and `cmake` are only needed for building LLVM, so I have included the suggestion from `ninja` to set `download-ci-llvm = true` if the user would rather download LLVM. If `cmake` actually is used in other areas, I can remove that part of the message. Fixes: #90679
2022-05-08Auto merge of #96457 - yungkneez:fix-bootstrap, r=Mark-Simulacrumbors-2/+11
Initialize rust-analyzer submodule on bootstrap Fixes #96456
2022-05-08Auto merge of #96155 - jackh726:param-heuristics-followup, r=estebankbors-312/+265
Followups for method call error change Each commit is self-contained. Fixes most of the followup reviews from that PR. r? `@estebank`
2022-05-08Auto merge of #94206 - PrestonFrom:significant_drop, r=flip1995bors-0/+1204
Create clippy lint against unexpectedly late drop for temporaries in match scrutinee expressions A new clippy lint for issue 93883 (https://github.com/rust-lang/rust/issues/93883). Relies on a new trait in `marker` (called `SignificantDrop` to enable linting), which is why this PR is for the rust-lang repo and not the clippy repo. changelog: new lint [`significant_drop_in_scrutinee`]
2022-05-07Auto merge of #96824 - matthiaskrgr:rollup-silw3ki, r=matthiaskrgrbors-87/+237
Rollup of 10 pull requests Successful merges: - #96336 (Link to correct `as_mut` in docs for `pointer::as_ref`) - #96586 (Add aliases for std::fs::canonicalize) - #96667 (Add regression test) - #96671 (Remove hard links from `env::current_exe` security example) - #96726 (Add regression and bug tests) - #96756 (Enable compiler-docs by default for `compiler`, `codegen`, and `tools` profiles) - #96757 (Don't constantly rebuild clippy on `x test src/tools/clippy`.) - #96769 (Remove `adx_target_feature` feature from active features list) - #96777 (Make the test `check-pass` not to produce a JSON file) - #96822 (Enforce quote rule for JS source code) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-07updated error message for missing cmakeThomas Hatzopoulos-1/+12
2022-05-07Rollup merge of #96822 - GuillaumeGomez:js-quote-rule, r=notriddleMatthias Krüger-52/+56
Enforce quote rule for JS source code We mostly used double quotes but still had a weird mix. This eslint rule will now enforce it. r? `@notriddle`
2022-05-07Rollup merge of #96777 - JohnTitor:do-not-run-pass-save-analysis, ↵Matthias Krüger-1/+1
r=Mark-Simulacrum Make the test `check-pass` not to produce a JSON file `run-pass` produces a JSON file when enabling save analysis. The original ICE happened on `cargo check`, moreover **without** the `generic_const_exprs` feature, so `check-pass` should be enough.
2022-05-07Rollup merge of #96769 - Undin:remove-adx_target_feature-from-active, ↵Matthias Krüger-1/+0
r=joshtriplett Remove `adx_target_feature` feature from active features list The feature was stabilized in https://github.com/rust-lang/rust/pull/93745
2022-05-07Rollup merge of #96757 - jyn514:fewer-clippy-rebuilds, r=Mark-SimulacrumMatthias Krüger-2/+4
Don't constantly rebuild clippy on `x test src/tools/clippy`. This happened because the `SYSROOT` variable was set for `x test`, but not `x build`. Set it consistently for both to avoid unnecessary rebuilds. This is a very small step towards https://github.com/rust-lang/rust/issues/76495.
2022-05-07Rollup merge of #96756 - jyn514:compiler-docs-default, r=Mark-SimulacrumMatthias Krüger-0/+10
Enable compiler-docs by default for `compiler`, `codegen`, and `tools` profiles I had this overridden locally for a while and realized just now it should probably just be a default.
2022-05-07Rollup merge of #96726 - oli-obk:no_cross_inference, r=Mark-SimulacrumMatthias Krüger-0/+103
Add regression and bug tests this tracks the behaviour from https://github.com/rust-lang/rust/issues/96572 in our test suite
2022-05-07Rollup merge of #96671 - mgeisler:current-exe-docstring, r=Mark-SimulacrumMatthias Krüger-30/+17
Remove hard links from `env::current_exe` security example The security example shows that `env::current_exe` will return the path used when the program was started. This is not really surprising considering how hard links work: after `ln foo bar`, the two files are _equivalent_. It is _not_ the case that `bar` is a “link” to `foo`, nor is `foo` a link to `bar`. They are simply two names for the same underlying data. The security vulnerability linked to seems to be different: there an attacker would start a SUID binary from a directory under the control of the attacker. The binary would respawn itself by executing the program found at `/proc/self/exe` (which the attacker can control). This is a real problem. In my opinion, the example given here doesn’t really show the same problem, it just shows a misunderstanding of what hard links are. I looked through the history a bit and found that the example was introduced in https://github.com/rust-lang/rust/pull/33526. That PR actually has two commits, and the first (https://github.com/rust-lang/rust/commit/8478d48dad949b3b1374569a5391089a49094eeb) explains the race condition at the root of the linked security vulnerability. The second commit proceeds to replace the explanation with the example we have today. This commit reverts most of the second commit from https://github.com/rust-lang/rust/pull/33526.
2022-05-07Rollup merge of #96667 - oli-obk:collect_hidden_types, r=Mark-SimulacrumMatthias Krüger-0/+43
Add regression test fixes #69785 This issue seems to have been fixed in the meantime.
2022-05-07Rollup merge of #96586 - ear7h:master, r=joshtriplettMatthias Krüger-0/+2
Add aliases for std::fs::canonicalize The aliases are `realpath` and `GetFinalPathNameByHandle` which are explicitly mentioned in `canonicalize`'s documentation.
2022-05-07Rollup merge of #96336 - Nilstrieb:link-to-correct-as_mut-in-ptr-as_ref, ↵Matthias Krüger-1/+1
r=JohnTitor Link to correct `as_mut` in docs for `pointer::as_ref` It previously linked to the unstable const-mut-cast method instead of the `mut` counterpart for `as_ref`. Closes #96327
2022-05-07Auto merge of #96670 - Urgau:bootstrap-check-cfg-features, r=Mark-Simulacrumbors-5/+14
Enable cfg checking of cargo features for everything but std This PR enable `cfg` checking of cargo features for everything but std, it also adds a `FIXME` to myself. > Note: `std`, `alloc` and `core` imports some dependencies by #[path] (like > backtrace, core_simd, std_float, ...), those dependencies have their own features > but cargo isn't involved in the #[path] and so cannot pass the complete list of > features, so for that reason we don't enable checking of features for std. r? `@Mark-Simulacrum`
2022-05-07Enforce quote rule for JS source codeGuillaume Gomez-52/+56
2022-05-07Auto merge of #96657 - cuviper:time64, r=joshtriplettbors-168/+205
Use 64-bit time on 32-bit linux-gnu The standard library suffered the [Year 2038 problem][Y2038] in two main places on targets with 32-bit `time_t`: - In `std::time::SystemTime`, we stored a `timespec` that has `time_t` seconds. This is now changed to directly store 64-bit seconds and nanoseconds, and on 32-bit linux-gnu we try to use `__clock_gettime64` (glibc 2.34+) to get the larger timestamp. - In `std::fs::Metadata`, we store a `stat64`, which has 64-bit `off_t` but still 32-bit `time_t`, and unfortunately that is baked in the API by the (deprecated) `MetadataExt::as_raw_stat()`. However, we can use `statx` for 64-bit `statx_timestamp` to store in addition to the `stat64`, as we already do to support creation time, and the rest of the `MetadataExt` methods can return those full values. Note that some filesystems may still be limited in their actual timestamp support, but that's not something Rust can change. There remain a few places that need `timespec` for system call timeouts -- I leave that to future work. [Y2038]: https://en.wikipedia.org/wiki/Year_2038_problem
2022-05-07Auto merge of #96816 - GuillaumeGomez:rollup-oumn95i, r=GuillaumeGomezbors-673/+544
Rollup of 7 pull requests Successful merges: - #96581 (make Size and Align debug-printing a bit more compact) - #96636 (Fix jump to def regression) - #96760 (diagnostics: port more diagnostics to derive + add support for `Vec` fields) - #96788 (Improve validator around field projections and checked bin ops) - #96805 (Change eslint rules from configuration comments to configuration file) - #96807 (update Miri) - #96811 (Fix a minor typo in the description of Formatter) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-07Rollup merge of #96811 - createyourpersonalaccount:doc-typofix, r=JohnTitorGuillaume Gomez-1/+1
Fix a minor typo in the description of Formatter
2022-05-07Rollup merge of #96807 - RalfJung:miri, r=RalfJungGuillaume Gomez-9/+7
update Miri Fixes https://github.com/rust-lang/rust/issues/96773 r? ``@ghost``
2022-05-07Rollup merge of #96805 - Folyd:eslint, r=GuillaumeGomezGuillaume Gomez-31/+5
Change eslint rules from configuration comments to configuration file Repeatedly declaring eslint rules in source files is an annoying thing, we should move those rules into the eslint configuration file. r? ``@GuillaumeGomez``
2022-05-07Rollup merge of #96788 - JakobDegen:checked-binop, r=oli-obkGuillaume Gomez-4/+96
Improve validator around field projections and checked bin ops The two commits are unrelated. In both cases, these rules were already documented in MIR docs.
2022-05-07Rollup merge of #96760 - davidtwco:diagnostic-translation-vec, r=oli-obkGuillaume Gomez-70/+165
diagnostics: port more diagnostics to derive + add support for `Vec` fields - Port "unconstrained opaque type" diagnostic to using the derive. - Allow `Vec` fields in diagnostic derive - enables support for diagnostics that have multiple primary spans, or have subdiagnostics repeated at multiple locations. `Vec<..>` fields in the diagnostic derive become loops in the generated code. - Add `create_{err,warning}` - there wasn't a way to create a diagnostic from a struct and not emit it straight away. - Port "explicit generic args w/ impl trait" diagnostic to using the derive. r? `````@oli-obk````` cc `````@pvdrz`````
2022-05-07Rollup merge of #96636 - GuillaumeGomez:fix-jump-to-def-regression, r=notriddleGuillaume Gomez-3/+26
Fix jump to def regression https://github.com/rust-lang/rust/pull/93803 introduced a regression in the "jump to def" feature. This fixes it. Nice side-effect: it adds a new regression test. :) I also used this opportunity to add documentation about this unstable feature in the rustdoc book. cc ``@cjgillot`` r? ``@notriddle``
2022-05-07Rollup merge of #96581 - RalfJung:debug-size-align, r=oli-obkGuillaume Gomez-555/+244
make Size and Align debug-printing a bit more compact In particular in `{:#?}`-mode, these take up a lot of space, so I think this is the better alternative (even though it is a bit longer in `{:?}` mode, I think it is still more readable). We could make it even smaller by deviating further from what the actual code looks like, e.g. via something like `Size(4 bytes)`. Not sure what people would think about that? Cc `````@oli-obk`````
2022-05-07Fix a minor typo in the description of FormatterNikolaos Chatzikonstantinou-1/+1
2022-05-07Auto merge of #96780 - Kobzol:ci-llvm-upgrade-osx-windows, r=Mark-Simulacrumbors-1/+1
Update LLVM version used to build OS X and Windows artifacts to 14.0.2 Let's see what breaks. r? `@Mark-Simulacrum`
2022-05-07update MiriRalf Jung-9/+7
2022-05-07Auto merge of #96094 - Elliot-Roberts:fix_doctests, r=compiler-errorsbors-609/+668
Begin fixing all the broken doctests in `compiler/` Begins to fix #95994. All of them pass now but 24 of them I've marked with `ignore HELP (<explanation>)` (asking for help) as I'm unsure how to get them to work / if we should leave them as they are. There are also a few that I marked `ignore` that could maybe be made to work but seem less important. Each `ignore` has a rough "reason" for ignoring after it parentheses, with - `(pseudo-rust)` meaning "mostly rust-like but contains foreign syntax" - `(illustrative)` a somewhat catchall for either a fragment of rust that doesn't stand on its own (like a lone type), or abbreviated rust with ellipses and undeclared types that would get too cluttered if made compile-worthy. - `(not-rust)` stuff that isn't rust but benefits from the syntax highlighting, like MIR. - `(internal)` uses `rustc_*` code which would be difficult to make work with the testing setup. Those reason notes are a bit inconsistently applied and messy though. If that's important I can go through them again and try a more principled approach. When I run `rg '```ignore \(' .` on the repo, there look to be lots of different conventions other people have used for this sort of thing. I could try unifying them all if that would be helpful. I'm not sure if there was a better existing way to do this but I wrote my own script to help me run all the doctests and wade through the output. If that would be useful to anyone else, I put it here: https://github.com/Elliot-Roberts/rust_doctest_fixing_tool
2022-05-07Auto merge of #96804 - compiler-errors:rollup-1mc6aw3, r=compiler-errorsbors-17/+100
Rollup of 8 pull requests Successful merges: - #96660 ([bootstrap] Give a better error when trying to run a path with no registered step) - #96701 (update `jemallocator` example to use 2018 edition import syntax) - #96746 (Fix an ICE on #96738) - #96758 (bootstrap: bsd platform flags for split debuginfo) - #96778 (Remove closures on `expect_local` to apply `#[track_caller]`) - #96781 (Fix an incorrect link in The Unstable Book) - #96783 (Link to correct issue in issue-95034 known-bug) - #96801 (Add regression test for #96319) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-06Rollup merge of #96801 - Aaron1011:coinductive-cycle-test, r=compiler-errorsMichael Goulet-0/+34
Add regression test for #96319
2022-05-06Rollup merge of #96783 - aliemjay:typo-issue-95034, r=compiler-errorsMichael Goulet-0/+2
Link to correct issue in issue-95034 known-bug fix a typo is issue number: 94034 -> 95034
2022-05-06Rollup merge of #96781 - koic:fix_an_incorrect_link_in_the_unstable_book, ↵Michael Goulet-1/+1
r=ehuss Fix an incorrect link in The Unstable Book https://github.com/rust-lang/rust/blob/master/src/librustc_session/lint/builtin.rs returns page not found. The following is the background of the move. First https://github.com/rust-lang/rust/pull/74862 moves from src/librustc_session/lint/builtin.rs to compiler/rustc_session/src/lint/builtin.rs. Then https://github.com/rust-lang/rust/commit/23018a5 moves from compiler/rustc_session/src/lint/builtin.rs to compiler/rustc_lint_defs/src/builtin.rs. So, the current correct link is https://github.com/rust-lang/rust/blob/master/compiler/rustc_lint_defs/src/builtin.rs. This PR fixes a broken link on the following page: https://doc.rust-lang.org/beta/unstable-book/language-features/plugin.html
2022-05-06Rollup merge of #96778 - JohnTitor:expect-local-track-caller-take-2, ↵Michael Goulet-1/+6
r=petrochenkov Remove closures on `expect_local` to apply `#[track_caller]` Pointed out in https://github.com/rust-lang/rust/pull/96747#discussion_r866576196 Didn't change `expect_non_local` as I'm not sure if it's also the case. r? ``@petrochenkov``
2022-05-06Rollup merge of #96758 - davidtwco:split-debuginfo-bootstrap-bsd, ↵Michael Goulet-2/+6
r=Mark-Simulacrum bootstrap: bsd platform flags for split debuginfo Addresses https://github.com/rust-lang/rust/pull/96597#issuecomment-1118905025. Bootstrap currently provides `-Zunstable-options` for OpenBSD when using split debuginfo - this commit provides it for all BSD targets. We should probably work out a better way of handling the stability of the split debuginfo flag - all options for the flag are unstable but one of them is the default for each platform already. cc `@m-ou-se` r? `@Mark-Simulacrum`
2022-05-06Rollup merge of #96746 - JohnTitor:issue-96738, r=petrochenkovMichael Goulet-10/+38
Fix an ICE on #96738 In the block we don't know if the method actually exists thus `expect_local` panics. Fixes #96738 Fixes #96583
2022-05-06Rollup merge of #96701 - kraktus:alloc_example_2018_edition, r=Mark-SimulacrumMichael Goulet-2/+0
update `jemallocator` example to use 2018 edition import syntax
2022-05-06Rollup merge of #96660 - jyn514:better-missing-path-error, r=Mark-SimulacrumMichael Goulet-1/+13
[bootstrap] Give a better error when trying to run a path with no registered step Before: ``` thread 'main' panicked at 'error: no rules matched invalid', src/bootstrap/builder.rs:287:17 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` After: ``` error: no `check` rules matched 'invalid' help: run `x.py check --help --verbose` to show a list of available paths note: if you are adding a new Step to bootstrap itself, make sure you register it with `describe!` ```
2022-05-06Lint for significant drops who may have surprising lifetimes #1Preston From-0/+1201
author Preston From <prestonfrom@gmail.com> 1645164142 -0600 committer Preston From <prestonfrom@gmail.com> 1650005351 -0600
2022-05-06Mark locks in std lib with clippy::has_significant_dropPreston From-0/+3
2022-05-07Change eslint rules from configuration comments to configuration filesFolyd-31/+5
2022-05-06Resolve vars before emitting coerce suggestions tooJack Huey-0/+22
2022-05-06Resolve vars in note_type_errJack Huey-138/+146
2022-05-06Add regression test for #96319Aaron Hill-0/+34
2022-05-07Auto merge of #96531 - kckeiks:remove-item-like-visitor-from-rustc-typeck, ↵bors-545/+504
r=cjgillot Remove ItemLikeVisitor impls from rustc_typeck Issue #95004 cc `@cjgillot`
2022-05-06Auto merge of #96458 - Aaron1011:no-cycle-caching, r=jackh726,cjgillotbors-59/+18
Don't cache results of coinductive cycle
2022-05-06Point at closure args tooJack Huey-81/+97