about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-04-29Auto merge of #110994 - matthiaskrgr:rollup-wv4u5yi, r=matthiaskrgrbors-38/+1952
Rollup of 6 pull requests Successful merges: - #105848 (rustdoc: Add a new lint for broken inline code) - #110644 (Update tests for libtest `--format json`) - #110950 (Deny the `unsafe_op_in_unsafe_fn` lint in `rustc_arena`.) - #110951 (Add support for LibreSSL 3.7.x) - #110964 (rustdoc: fix weird margins between Deref impl items) - #110979 (windows: kill rust-analyzer-proc-macro-srv before deleting stage0 directory) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-29Rollup merge of #110979 - jyn514:windows-locking, r=ChrisDentonMatthias Krüger-6/+29
windows: kill rust-analyzer-proc-macro-srv before deleting stage0 directory This fixes the following recurring error on windows: ``` Traceback (most recent call last): File "C:\Users\jyn\src\rust\x.py", line 29, in <module> bootstrap.main() File "C:\Users\jyn\src\rust\src\bootstrap\bootstrap.py", line 963, in main bootstrap(args) File "C:\Users\jyn\src\rust\src\bootstrap\bootstrap.py", line 927, in bootstrap build.download_toolchain() File "C:\Users\jyn\src\rust\src\bootstrap\bootstrap.py", line 437, in download_toolchain shutil.rmtree(bin_root) File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 759, in rmtree return _rmtree_unsafe(path, onerror) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 622, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 620, in _rmtree_unsafe os.unlink(fullname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\jyn\\src\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\rust-analyzer-proc-macro-srv.exe' ``` Fixes https://github.com/rust-lang/rust/issues/107018. r? ```@ChrisDenton```
2023-04-29Rollup merge of #110964 - notriddle:notriddle/deref-impl, r=GuillaumeGomezMatthias Krüger-6/+55
rustdoc: fix weird margins between Deref impl items ## Before ![image](https://user-images.githubusercontent.com/1593513/235245977-90770591-22c1-4a27-9464-248a3729a2b7.png) ## After ![image](https://user-images.githubusercontent.com/1593513/235246009-0e83113e-42b7-4e29-981d-969f9d20af01.png) ## Description In the old setup, if the dereffed-to item has multiple impl blocks, each one gets its own `div.impl-items` in the section, but there are no headers separating them. Since the last method in a `div.impl-items` has no bottom margin, and there are no margins between these divs, there is no margin between the last method of one impl and the first method of the following impl. This patch fixes it by simplifying the HTML. Each Deref block gets exactly one `div.impl-items`, no matter how many impl blocks it actually has.
2023-04-29Rollup merge of #110951 - mixi:libressl-3.7.x, r=Mark-SimulacrumMatthias Krüger-2/+2
Add support for LibreSSL 3.7.x This updates the `openssl-sys` crate to 0.9.87 to support building the toolchain against the system libraries provided by LibreSSL version 3.7.x. LibreSSL 3.7.x has been supported since `openssl-sys` version 0.9.85.
2023-04-29Rollup merge of #110950 - JohnBobbo96:rustc_arena_unsafe_fn, r=NilstriebMatthias Krüger-11/+31
Deny the `unsafe_op_in_unsafe_fn` lint in `rustc_arena`. r? ```@Nilstrieb```
2023-04-29Rollup merge of #110644 - pietroalbini:pa-json-formatting-tests, ↵Matthias Krüger-8/+60
r=Mark-Simulacrum Update tests for libtest `--format json` This PR makes the test work on beta and stable, and adds a test ensuring the option is not available on beta and stable. Backported these commits from https://github.com/rust-lang/rust/pull/110414.
2023-04-29Rollup merge of #105848 - lukas-code:backticks, ↵Matthias Krüger-5/+1775
r=GuillaumeGomez,jyn514,notriddle rustdoc: Add a new lint for broken inline code This patch adds `rustdoc::unescaped_backticks`, a new rustdoc lint that will detect broken inline code nodes. The lint woks by finding stray backticks and with some heuristics tries to guess where the second backtick might be missing. Here is how it looks: ```rust #![warn(rustdoc::unescaped_backticks)] /// `add(a, b) is the same as `add(b, a)`. pub fn add(a: i32, b: i32) -> i32 { a + b } ``` ```text warning: unescaped backtick --> src/lib.rs:3:41 | 3 | /// `add(a, b) is the same as `add(b, a)`. | ^ | help: a previous inline code might be longer than expected | 3 | /// `add(a, b)` is the same as `add(b, a)`. | + help: if you meant to use a literal backtick, escape it | 3 | /// `add(a, b) is the same as `add(b, a)\`. | + ``` If we can't get proper spans, for example if the doc comment comes from a macro expansion, we print the suggestion in help messages instead. Here's a [real-world example](https://docs.rs/tracing-subscriber/0.3.17/tracing_subscriber/layer/trait.Filter.html#method.max_level_hint): ```text warning: unescaped backtick --> /tracing-subscriber-0.3.17/src/layer/mod.rs:1400:9 | 1400 | / /// Returns an optional hint of the highest [verbosity level][level] that 1401 | | /// this `Filter` will enable. 1402 | | /// 1403 | | /// If this method returns a [`LevelFilter`], it will be used as a hint to ... | 1427 | | /// [`Interest`]: tracing_core::subscriber::Interest 1428 | | /// [rebuild]: tracing_core::callsite::rebuild_interest_cache | |_____________________________________________________________________^ | = help: a previous inline code might be longer than expected change: Therefore, if the `Filter will change the value returned by this to this: Therefore, if the `Filter` will change the value returned by this = help: if you meant to use a literal backtick, escape it change: [`rebuild_interest_cache`][rebuild] is called after the value of the max to this: [`rebuild_interest_cache\`][rebuild] is called after the value of the max ``` You can find more examples [here](https://gist.github.com/lukas-code/7678ddf5c608aee97b3a669de80d3465). A limitation of the current implementation is, that it cannot suggest removing misplaced backticks, for example [here](https://docs.rs/tikv-jemalloc-sys/0.5.3+5.3.0-patched/tikv_jemalloc_sys/fn.mallctl.html). The lint is allowed by default ~~and nightly-only~~ for now, ~~but without a feature gate. This is similar to how `rustdoc::invalid_html_tags` and `rustdoc::bare_urls` were handled.~~
2023-04-29Auto merge of #110992 - bjorn3:sync_cg_clif-2023-04-29, r=bjorn3bors-680/+1464
Sync rustc_codegen_cranelift Updated Cranelift and fixed a couple of bugs. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2023-04-29Update list of allowed cg_clif dependenciesbjorn3-10/+0
2023-04-29Merge commit 'ef07e8e60f994ec014d049a95591426fb92ebb79' into ↵bjorn3-670/+1464
sync_cg_clif-2023-04-29
2023-04-29Integrate better with Cranelift's profiling infrastructurebjorn3-21/+37
2023-04-29Update Cranelift to 0.95.1bjorn3-30/+30
This version was released as part of a security fix for Wasmtime. The fix didn't change Cranelift though, so this commit is not strictly necessary, but also doesn't hurt.
2023-04-29Rustup to rustc 1.71.0-nightly (f49560538 2023-04-28)bjorn3-1/+1
2023-04-29Add `rustdoc::unescaped_backtick` lintLukas Markeffsky-5/+1775
2023-04-29Sync from rust f4956053816439a5884cb2ad1247835858f92218bjorn3-5/+31
2023-04-29Auto merge of #108106 - the8472:layout-opt, r=wesleywiserbors-298/+511
Improve niche placement by trying two strategies and picking the better result Fixes #104807 Fixes #105371 Determining which sort order is better requires calculating the struct size (so we can calculate the niche offset). But that in turn depends on the field order, so happens after sorting. So the simple way to solve that is to run the whole thing twice and pick the better result. 1st commit is just code motion, the meat is in the later ones.
2023-04-29windows: kill rust-analyzer-proc-macro-srv before deleting stage0 directoryjyn-6/+29
This fixes the following recurring error on windows: ``` Traceback (most recent call last): File "C:\Users\jyn\src\rust\x.py", line 29, in <module> bootstrap.main() File "C:\Users\jyn\src\rust\src\bootstrap\bootstrap.py", line 963, in main bootstrap(args) File "C:\Users\jyn\src\rust\src\bootstrap\bootstrap.py", line 927, in bootstrap build.download_toolchain() File "C:\Users\jyn\src\rust\src\bootstrap\bootstrap.py", line 437, in download_toolchain shutil.rmtree(bin_root) File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 759, in rmtree return _rmtree_unsafe(path, onerror) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 622, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 620, in _rmtree_unsafe os.unlink(fullname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\jyn\\src\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\rust-analyzer-proc-macro-srv.exe' ```
2023-04-29Auto merge of #110978 - Dylan-DPC:rollup-xclzwax, r=Dylan-DPCbors-63/+390
Rollup of 6 pull requests Successful merges: - #110614 (Clear response values for overflow in new solver) - #110894 (Bump libffi-sys to 2.3.0) - #110932 (include source error for LoadLibraryExW) - #110958 (Make sure that some stdlib method signatures aren't accidental refinements) - #110962 (Make drop_flags an IndexVec.) - #110965 (Don't duplicate anonymous lifetimes for async fn in traits) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-29Rollup merge of #110965 - compiler-errors:anon-lt-dupe-oops, r=cjgillotDylan DPC-8/+164
Don't duplicate anonymous lifetimes for async fn in traits `record_lifetime_params_for_async` needs to be called outside of the scope of the function, or else it'll end up collecting anonymous lifetimes twice (those on the function and those within the `AnonymousCreateParameter` rib). This matches how `record_lifetime_params_for_async` is being used for functions with bodies below. This fixes (partially) #110963 when the lifetimes are late-bound, but does not do so when the lifetimes are early-bound (as seen from the known-bug that I added).
2023-04-29Rollup merge of #110962 - cjgillot:no-hash-drops, r=compiler-errorsDylan DPC-8/+9
Make drop_flags an IndexVec. Fixes https://github.com/rust-lang/rust/issues/91943
2023-04-29Rollup merge of #110958 - compiler-errors:stdlib-refinement, r=cuviperDylan DPC-24/+84
Make sure that some stdlib method signatures aren't accidental refinements In the process of implementing https://rust-lang.github.io/rfcs/3245-refined-impls.html, I found a bunch of stdlib implementations that accidentally "refined" their method signatures by dropping (unnecessary) bounds. This isn't currently a problem, but may become one if/when method signature refining is stabilized in the future. Shouldn't hurt to make these signatures a bit more accurate anyways. NOTE (just to be clear lol): This does not affect behavior at all, since we don't actually take advantage of refined implementations yet!
2023-04-29Rollup merge of #110932 - sameer:master, r=michaelwoeristerDylan DPC-1/+9
include source error for LoadLibraryExW In #107595, we added retry behavior for LoadLibraryExW on Windows. If it fails we do not print the underlying error that Windows returned. This made #110889 a little harder to debug. In this PR I am adding the source error in the message if it is available.
2023-04-29Rollup merge of #110894 - loongarch-rs:bump-libffi-sys, r=Mark-SimulacrumDylan DPC-2/+2
Bump libffi-sys to 2.3.0 Bump libffi-sys to 2.3.0 that includes LoongArch support. Thanks Related: https://github.com/rust-lang/miri/pull/2858
2023-04-29Rollup merge of #110614 - compiler-errors:new-solver-overflow-response, r=lcnrDylan DPC-20/+122
Clear response values for overflow in new solver When we have an overflow, return a trivial query response. This fixes an ICE with the code described in #110544: ```rust trait Trait {} struct W<T>(T); impl<T, U> Trait for W<(W<T>, W<U>)> where W<T>: Trait, W<U>: Trait, {} fn impls<T: Trait>() {} fn main() { impls::<W<_>>() } ``` Where, while proving `W<?0>: Trait`, we overflow but still apply the query response of `?0 = (W<?1>, W<?2>)`. Then while re-processing the query to validate that our evaluation result was stable, we get a different query response that looks like `?1 = (W<?3>, W<?4>), ?2 = (W<?5>, W<?6>)`, and so we trigger the ICE. Also, by returning a trivial query response we also avoid the infinite-loop/OOM behavior of the old solver. r? ``@lcnr``
2023-04-28Deny the `unsafe_op_in_unsafe_fn` lint inJohn Bobbo-11/+31
`rustc_arena`.
2023-04-29Auto merge of #110643 - pietroalbini:pa-bump-stage0, r=Mark-Simulacrumbors-1020/+606
[master] Bump stage0 r? `@Mark-Simulacrum`
2023-04-28Auto merge of #110967 - matthiaskrgr:rollup-vfbl7gm, r=matthiaskrgrbors-342/+449
Rollup of 8 pull requests Successful merges: - #110877 (Provide better type hints when a type doesn't support a binary operator) - #110917 (only error combining +whole-archive and +bundle for rlibs) - #110921 (Use `NonNull::new_unchecked` and `NonNull::len` in `rustc_arena`.) - #110927 (Encoder/decoder cleanups) - #110944 (share BinOp::Offset between CTFE and Miri) - #110948 (run-make test: using single quotes to not trigger the shell) - #110957 (Fix an ICE in conflict error diagnostics) - #110960 (fix false negative for `unused_mut`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-28layout-alignment-promotion logic should depend on the niche-biasThe 8472-7/+41
For start-biased layout we want to avoid overpromoting so that the niche doesn't get pushed back. For end-biased layout we want to avoid promoting fields that may contain one of the niches of interest.
2023-04-28[review] add comments, turn flag into enumThe 8472-23/+44
2023-04-28fix codegen testThe 8472-3/+6
2023-04-28Rollup merge of #110960 - lukas-code:unused-mut, r=compiler-errorsMatthias Krüger-17/+34
fix false negative for `unused_mut` fixes https://github.com/rust-lang/rust/issues/110849 We want to avoid double diagnostics for code like this, but only if an error actually occurs: ```rust fn main() { let mut x: (i32, i32); x.0 = 1; } ``` The first commit fixes the lint and the second one removes all the unused `mut`s it found.
2023-04-28Rollup merge of #110957 - WaffleLapkin:reach_generator_conflict_error, ↵Matthias Krüger-1/+31
r=cjgillot Fix an ICE in conflict error diagnostics Fixes #110929 r? ``@cjgillot``
2023-04-28Rollup merge of #110948 - TimNN:patch-1, r=WaffleLapkinMatthias Krüger-1/+1
run-make test: using single quotes to not trigger the shell This test got added in #110801. I'm no expert on Makefiles, but IIUC this command is passed to the shell, which usually tries to execute commands specified in between backticks in double-quoted strings. Using single quotes should fix this, I think. (Note: Waiting for CI to test this, since I only have a web browser available right now). r? ``@jyn514`` cc ``@WaffleLapkin`` Since this is breaking our build bot, even if it is not directly LLVM related: ``@rustbot`` label: +llvm-main
2023-04-28Rollup merge of #110944 - RalfJung:offset, r=compiler-errorsMatthias Krüger-25/+29
share BinOp::Offset between CTFE and Miri r? ``@oli-obk``
2023-04-28Rollup merge of #110927 - nnethercote:Encoder-Decoder-cleanups, r=scottmcmMatthias Krüger-175/+130
Encoder/decoder cleanups Best reviewed one commit at a time. r? ``@scottmcm``
2023-04-28Rollup merge of #110921 - JohnBobbo96:rustc_arena_nonnull, r=NilstriebMatthias Krüger-5/+5
Use `NonNull::new_unchecked` and `NonNull::len` in `rustc_arena`. This avoids a few extra dereferences as well as an `unwrap`. According to the docs for [`NonNull::len`](https://doc.rust-lang.org/std/ptr/struct.NonNull.html#method.len) this also ensures that: > This function is safe, even when the non-null raw slice cannot be dereferenced to a slice because the pointer does not have a valid address. I am also fairly sure that the `unwrap` is unneeded in this case, as the docs for [`Box::into_raw`](https://doc.rust-lang.org/std/boxed/struct.Box.html#method.into_raw) also state: > Consumes the Box, returning a wrapped raw pointer. **The pointer will be properly aligned and non-null.**
2023-04-28Rollup merge of #110917 - Be-ing:whole_archive_with_staticlib_fix, ↵Matthias Krüger-1/+4
r=petrochenkov only error combining +whole-archive and +bundle for rlibs Fixes https://github.com/rust-lang/rust/issues/110912 Checking `flavor == RlibFlavor::Normal` was accidentally lost in 601fc8b36b1962285e371cf3c54eeb3b1b9b3a74 https://github.com/rust-lang/rust/pull/105601 That caused combining +whole-archive and +bundle link modifiers on non-rlib crates to fail with a confusing error message saying that combination is unstable for rlibs. In particular, this caused the build to fail when +whole-archive was used on staticlib crates, even though +whole-archive effectively does nothing on non-bin crates because the final linker invocation is left to an external build system. cc ``@petrochenkov``
2023-04-28Rollup merge of #110877 - compiler-errors:binop-err, r=cjgillotMatthias Krüger-117/+215
Provide better type hints when a type doesn't support a binary operator For example, when checking whether `vec![A] == vec![A]` holds, we first evaluate the LHS's ty, then probe for any `PartialEq` implementations for that. If none is found, we report an error by evaluating `Vec<A>: PartialEq<?0>` for fulfillment errors, but the RHS is not yet evaluated and remains an inference variable `?0`! To fix this, we evaluate the RHS and equate it to that RHS infer var `?0`, so that we are able to provide more detailed fulfillment errors for why `Vec<A>: PartialEq<Vec<A>>` doesn't hold (namely, the nested obligation `A: PartialEq<A>` doesn't hold). Fixes #95285 Fixes #110867
2023-04-28Auto merge of #110901 - GuillaumeGomez:inlined-repr-rustdoc, r=notriddlebors-1/+18
rustdoc: Fix missing `repr` attribute in doc(inline) on foreign items Fixes https://github.com/rust-lang/rust/issues/110698. r? `@notriddle`
2023-04-28Don't duplicate anonymous lifetimes for async fn in traitsMichael Goulet-8/+164
2023-04-28rustdoc: fix weird margins between Deref impl itemsMichael Howell-6/+55
In the old setup, if the dereffed-to item has multiple impl blocks, each one gets its own `div.impl-items` in the section, but there are no headers separating them. Since the last method in a `div.impl-items` has no bottom margin, and there are no margins between these divs, there is no margin between the last method of one impl and the first method of the following impl. This patch fixes it by simplifying the HTML. Each Deref block gets exactly one `div.impl-items`, no matter how many impl blocks it actually has.
2023-04-28Make drop_flags an IndexVec.Camille GILLOT-8/+9
2023-04-28rustdoc: move deref tests into a directoryMichael Howell-0/+0
2023-04-28remove unused `mut`sLukas Markeffsky-11/+11
2023-04-28Fix an ICE in conflict errors diagnosticsMaybe Waffle-315/+18
2023-04-28Make sure that signatures aren't accidental refinementsMichael Goulet-24/+84
2023-04-28fix false negative for `unused_mut`Lukas Markeffsky-6/+23
2023-04-28Auto merge of #110952 - ehuss:update-awscli, r=cuviperbors-3/+4
Update awscli The Windows GitHub Actions image just updated to pip 23.1.1 which broke the PyYaml installer in the current AWS CLI mirror. It now requires setuptools, wheel, and Cython to be installed manually. This updates to include that, as well as updating the versions of all the packages. This also now uses python3 on macOS since python2 doesn't work with the newer versions. I have only tested that these install correctly, but not that they work correctly. Pietro mentioned that we should just switch to aws cli 2, which I agree is probably the better solution. I'm posting this PR in case it helps unblock CI.
2023-04-28Add regression test for issue 110929Maybe Waffle-0/+327
2023-04-28bless line changes in tests-listing-format-json.run.stdoutJosh Stone-3/+3