about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-05-12Merge from rustcRalf Jung-1587/+4780
2023-05-12Preparing for merge from rustcRalf Jung-1/+1
2023-05-12Auto merge of #111493 - matthiaskrgr:rollup-iw1z59b, r=matthiaskrgrbors-137/+474
Rollup of 6 pull requests Successful merges: - #111179 (Fix instrument-coverage tests by using Python to sort instantiation groups) - #111393 (bump windows crate 0.46 -> 0.48) - #111441 (Verify copies of mutable pointers in 2 stages in ReferencePropagation) - #111456 (Update cargo) - #111490 (Don't ICE in layout computation for placeholder types) - #111492 (use by ref TokenTree iterator to avoid a few clones) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-05-12Rollup merge of #111492 - calebcartwright:by-ref-tokentree-1, r=compiler-errorsMatthias Krüger-6/+6
use by ref TokenTree iterator to avoid a few clones Just a handful of swaps from the by-value cursor to by-ref cursor so as to avoid some unnecessary clones. I've been doing some analysis on internal cleanup opportunities within rustfmt and as part of that yak-shave I found myself perusing broader token stream and tree usage (which we use within rustfmt). As reflected in some inline comments on the cursor structs (not part of this diff), there's probably many other such cases throughout the code, but figured I'd start small with these while I had the time. May take a look at the other sites in the future
2023-05-12Rollup merge of #111490 - compiler-errors:layout-placeholder, r=aliemjayMatthias Krüger-5/+21
Don't ICE in layout computation for placeholder types We use `layout_of` for the built-in `PointerLike` trait to check if a type can be coerced to a `dyn*`. Since the new solver canonicalizes parameter types to placeholders, that code needs to be able to treat placeholders like params, and for the most part it does, **except** for a call to `is_trivially_sized`. This PR fixes that.
2023-05-12Rollup merge of #111456 - loongarch-rs:bump-cargo, r=weihangloMatthias Krüger-0/+0
Update cargo 2 commits in 26b73d15a68fb94579f6d3590585ec0e9d81d3d5..13413c64ff88dd6c2824e9eb9374fc5f10895d28 2023-05-09 20:28:03 +0000 to 2023-05-10 13:46:18 +0000 * Update libc to 0.2.144 (rust-lang/cargo#12098) * changelog: add entries of some behavior changes (rust-lang/cargo#12119) r? ``````@weihanglo``````
2023-05-12Rollup merge of #111441 - cjgillot:issue-111422, r=JakobDegenMatthias Krüger-34/+230
Verify copies of mutable pointers in 2 stages in ReferencePropagation Fixes #111422 In the first stage, we mark the copies as reborrows, to be checked later. In the second stage, we walk the reborrow chains to verify that all stages are fully replacable. The replacement itself mirrors the check, and iterates through the reborrow chain. r? ``````@RalfJung`````` cc ``````@JakobDegen``````
2023-05-12Rollup merge of #111393 - klensy:win-0.48, r=oli-obkMatthias Krüger-59/+69
bump windows crate 0.46 -> 0.48 This drops duped version of crate(0.46), reduces `rustc_driver.dll` ~800kb and reduces exported functions number from 26k to 22k. Also while here, added `tidy-alphabetical` sorting to lists in tidy allowed lists.
2023-05-12Rollup merge of #111179 - Zalathar:sort-groups, r=Mark-SimulacrumMatthias Krüger-33/+148
Fix instrument-coverage tests by using Python to sort instantiation groups #110942 was intended to fix a set of `-Cinstrument-coverage` tests, but it ended up silently *breaking* those tests on Linux, for annoying reasons detailed at #111171. Dealing with `diff --ignore-matching-lines` across multiple platforms has been such a hassle that I've instead written a simple Python script that can detect instantiation groups in the output of `llvm-cov show`, and sort them in a predictable order so that they can be used as snapshots for an ordinary invocation of `diff`. This approach should be much less error-prone, because it can't accidentally ignore the wrong lines, and any unforeseen problems will tend to result in a Python exception or a failing diff.
2023-05-12Auto merge of #111489 - compiler-errors:rollup-g3vgzss, r=compiler-errorsbors-152/+591
Rollup of 7 pull requests Successful merges: - #106038 (use implied bounds when checking opaque types) - #111366 (Make `NonUseContext::AscribeUserTy` carry `ty::Variance`) - #111375 (CFI: Fix SIGILL reached via trait objects) - #111439 (Fix backtrace normalization in ice-bug-report-url.rs) - #111444 (Only warn single-use lifetime when the binders match.) - #111459 (Update browser-ui-test version to 0.16.0) - #111460 (Improve suggestion for `self: Box<self>`) Failed merges: - #110454 (Require impl Trait in associated types to appear in method signatures) r? `@ghost` `@rustbot` modify labels: rollup
2023-05-11refactor: use by-ref TokenTree iterator to avoid a few clonesCaleb Cartwright-6/+6
2023-05-12Auto merge of #111475 - workingjubilee:sync-simd-2023-may-10, r=workingjubileebors-763/+2199
Sync portable-simd to 2023 May 10 Take 2. r? `@ghost`
2023-05-12Don't ICE in layout computation for placeholder typesMichael Goulet-5/+21
2023-05-11Rollup merge of #111460 - clubby789:lowercase-box-self, r=compiler-errorsMichael Goulet-25/+63
Improve suggestion for `self: Box<self>` Fixes #110642
2023-05-11Rollup merge of #111459 - GuillaumeGomez:update-browser-ui-test, r=notriddleMichael Goulet-81/+70
Update browser-ui-test version to 0.16.0 This new version brings one major improvement: it allows to use the original color format in checks (I plan to slowly continue converting colors back to their "original" format, ie the one used in CSS). It also provides some improvements in some commands API. r? `````@notriddle`````
2023-05-11Rollup merge of #111444 - cjgillot:issue-111400, r=oli-obkMichael Goulet-5/+12
Only warn single-use lifetime when the binders match. Fixes https://github.com/rust-lang/rust/issues/111400
2023-05-11Rollup merge of #111439 - uweigand:backtrace-normalize, r=compiler-errorsMichael Goulet-2/+3
Fix backtrace normalization in ice-bug-report-url.rs This test case currently fails on s390x, and probably other platforms where the last line of a backtrace does not contain and " at <source location>" specification. The problem with the existing normalization lines // normalize-stderr-test "\s*\d{1,}: .*\n" -> "" // normalize-stderr-test "\s at .*\n" -> "" is that \s matches all whitespace, including newlines, so the first (but not second) of these regexes may merge multiple lines. Thus the output differs depending on which of these matches on the last line of a backtrace. As the whitespace used in backtraces is just normal space characters, change both regexes to just match at least one space character instead: // normalize-stderr-test " +\d{1,}: .*\n" -> "" // normalize-stderr-test " + at .*\n" -> ""
2023-05-11Rollup merge of #111375 - rcvalle:rust-cfi-fix-106547, r=bjorn3Michael Goulet-28/+247
CFI: Fix SIGILL reached via trait objects Fix #106547 by transforming the concrete self into a reference to a trait object before emitting type metadata identifiers for trait methods.
2023-05-11Rollup merge of #111366 - obeis:ascribe-user-type-variance, r=lcnrMichael Goulet-7/+7
Make `NonUseContext::AscribeUserTy` carry `ty::Variance` Close #108267
2023-05-11Rollup merge of #106038 - aliemjay:opaque-implied, r=lcnrMichael Goulet-4/+189
use implied bounds when checking opaque types During opaque type inference, we check for the well-formedness of the hidden type in the opaque type's own environment, not the one of the defining site, which are different in the case of TAIT. However in the case of associated-type-impl-trait, we don't use implied bounds from the impl header. This caused us to reject the following: ```rust trait Service<Req> { type Output; fn call(req: Req) -> Self::Output; } impl<'a, Req> Service<&'a Req> for u8 { type Output= impl Sized; // we can't prove WF of hidden type `WF(&'a Req)` although it's implied by the impl //~^ ERROR type parameter Req doesn't live long enough fn call(req: &'a Req) -> Self::Output { req } } ``` although adding an explicit bound would make it pass: ```diff - impl<'a, Req> Service<&'a Req> for u8 { + impl<'a, Req> Service<&'a Req> for u8 where Req: 'a, { ``` I believe it should pass as we already allow the concrete type to be used: ```diff impl<'a, Req> Service<&'a Req> for u8 { - type Output= impl Sized; + type Output= &'a Req; ``` Fixes #95922 Builds on #105982 cc ``@lcnr`` (because implied bounds) r? ``@oli-obk``
2023-05-11Correct swizzle_dyn cfg for armv7 neonJubilee Young-1/+1
2023-05-11Auto merge of #111395 - scottmcm:slice-iter-zst-experiment, r=the8472bors-35/+51
Simplify the implementation of iterators over slices of ZSTs Currently, slice iterators over ZSTs store `end = start.wrapping_byte_add(len)`. That's slightly convenient for `is_empty`, but kinda annoying for pretty much everything else -- see bugs like #42789, for example. This PR instead changes it to just `end = ptr::invalid(len)` instead. That's easier to think about (IMHO, at least) as well as easier to represent. `next` is still to big to get inlined into the mir-opt/pre-codegen/ tests, but if I bump the inline threshold to force it to show the whole thing, this implementation is also less MIR: ``` > git diff --numstat 241 370 tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.mir 255 329 tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.mir 184 216 tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.mir 182 254 tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.mir ``` (That's ≈70 lines less for `Iter::next`, for example.) r? `@ghost` ~~Built atop #111282, so draft until that lands.~~
2023-05-11miri: Move patterns for simd testsJubilee Young-35/+17
It isn't clear to me why these error patterns do not trigger, but I am not going to waste time analyzing bugs in compiletest.
2023-05-11Bless tests for portable-simd syncJubilee Young-5/+5
API changes resulted in subtle MIR and impl differences
2023-05-11Sync portable-simd to 2023 May 10Jubilee Young-723/+2177
Sync up to rust-lang/portable-simd@852762563aa890286eda2f668b8af30f8aa84216
2023-05-11Improve error for `self: Box<self>`clubby789-25/+63
2023-05-11Auto merge of #111454 - RalfJung:miri, r=RalfJungbors-411/+1122
update Miri r? `@ghost`
2023-05-11Fix backtrace normalization in ice-bug-report-url.rsUlrich Weigand-2/+3
This test case currently fails on s390x, and probably other platforms where the last line of a backtrace does not contain and " at <source location>" specification. The problem with the existing normalization lines // normalize-stderr-test "\s*\d{1,}: .*\n" -> "" // normalize-stderr-test "\s at .*\n" -> "" is that \s matches all whitespace, including newlines, so the first (but not second) of these regexes may merge multiple lines. Thus the output differs depending on which of these matches on the last line of a backtrace. As the whitespace used in backtraces is just normal space characters, change both regexes to just match at least one space character instead: // normalize-stderr-test " +\d{1,}: .*\n" -> "" // normalize-stderr-test " + at .*\n" -> ""
2023-05-11Convert some GUI tests color checks to use original formatGuillaume Gomez-14/+14
2023-05-11Migrate to 0.16.0 browser-ui-test versionGuillaume Gomez-66/+55
2023-05-11Update browser-ui-test version to 0.16.0Guillaume Gomez-1/+1
2023-05-11Auto merge of #2889 - oli-obk:ui_test, r=oli-obkbors-0/+2
Emit the compiler flags in CI again fixes #2886
2023-05-11Auto merge of #111029 - Nilstrieb:when-the-errs-are-too-big, r=petrochenkovbors-14/+32
Shrink `SelectionError` a lot `SelectionError` used to be 80 bytes (on 64 bit). That's quite big. Especially because the selection cache contained `Result<_, SelectionError>. The Ok type is only 32 bytes, so the 80 bytes significantly inflate the size of the cache. Most variants of the `SelectionError` seem to be hard errors, only `Unimplemented` shows up in practice (for cranelift-codegen, it occupies 23.4% of all cache entries). We can just box away the biggest variant, `OutputTypeParameterMismatch`, to get the size down to 16 bytes, well within the size of the Ok type inside the cache.
2023-05-11Emit the compiler flags againOli Scherer-0/+2
2023-05-11fix deny_lint testRalf Jung-2/+7
2023-05-11Update cargoWANG Rui-0/+0
2023-05-11update lockfileRalf Jung-2/+2
2023-05-11Auto merge of #111452 - matthiaskrgr:rollup-uic8dgy, r=matthiaskrgrbors-49/+443
Rollup of 7 pull requests Successful merges: - #108705 (Prevent ICE with broken borrow in closure) - #111292 (Fix mishandled `--check-cfg` arguments order) - #111382 (Isolate coverage FFI type layouts from their underlying LLVM C++ types) - #111385 (vec-shrink-panik: update expectations to work on LLVM 17) - #111389 (Add esp-idf platform-support page) - #111432 (Use visit_assign to detect SSA locals.) - #111448 (Use proper impl self type for alias impl in rustdoc) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-05-11Rollup merge of #111448 - compiler-errors:rustdoc-alias-impl, r=notriddleMatthias Krüger-8/+18
Use proper impl self type for alias impl in rustdoc We don't want to use `type_of(type_alias)`, we want to use `type_of(impl)` -- this will give us the self type of the impl *properly substituted* in the case that it's an alias. Fixes #111420
2023-05-11Rollup merge of #111432 - cjgillot:issue-111426, r=oli-obkMatthias Krüger-7/+44
Use visit_assign to detect SSA locals. I screwed up the logic in 3c43b61b870add2daddbd8e480477e5a8aa409c2. Fixes https://github.com/rust-lang/rust/issues/111426
2023-05-11Rollup merge of #111389 - esp-rs:esp-idf-platform-support, r=jyn514Matthias Krüger-1/+43
Add esp-idf platform-support page As mentioned in https://github.com/rust-lang/rust/pull/111369#issuecomment-1539881848, the initial PR for esp-idf didn't include a platform support document which is required for the merge of https://github.com/rust-lang/rust/pull/111369.
2023-05-11Rollup merge of #111385 - durin42:vec-panik-17, r=AmanieuMatthias Krüger-2/+2
vec-shrink-panik: update expectations to work on LLVM 17 For some reason, the called function is `cleanup` on LLVM 17 instead of `filter`. r? `@Amanieu`
2023-05-11Rollup merge of #111382 - Zalathar:ffi, r=cuviperMatthias Krüger-17/+118
Isolate coverage FFI type layouts from their underlying LLVM C++ types I noticed that several of the types used to send coverage information through FFI are not properly isolated from the layout of their corresponding C++ types in the LLVM API. This PR adds more explicitly-defined FFI struct/enum types in `CoverageMappingWrapper.cpp`, so that Rust source files in `rustc_codegen_ssa` and `rustc_codegen_llvm` aren't directly exposed to LLVM C++ types.
2023-05-11Rollup merge of #111292 - Urgau:check-cfg-issue-111291, r=petrochenkovMatthias Krüger-1/+64
Fix mishandled `--check-cfg` arguments order This PR fixes a bug in `--check-cfg` where the order of `--check-cfg=names(a)` and `--check-cfg=values(a,…)` would trip the compiler. Fixes https://github.com/rust-lang/rust/issues/111291 cc `@taiki-e` `@petrochenkov`
2023-05-11Rollup merge of #108705 - clubby789:refutable-let-closure-borrow, r=cjgillotMatthias Krüger-13/+154
Prevent ICE with broken borrow in closure r? `@Nilstrieb` Fixes #108683 This solution isn't ideal, I'm hoping to find a way to continue compilation without ICEing.
2023-05-10Use proper impl self type for alias impl in rustdocMichael Goulet-8/+18
2023-05-10Auto merge of #110820 - cjgillot:faster-dcp, r=oli-obkbors-141/+183
Optimize dataflow-const-prop place-tracking infra Optimization opportunities found while investigating https://github.com/rust-lang/rust/pull/110719 Computing places breadth-first ensures that we create short projections before deep projections, since the former are more likely to be propagated. The most relevant is the pre-computation of flooded places. Callgrind showed `flood_*` methods and especially `preorder_preinvoke` were especially hot. This PR attempts to pre-compute the set of `ValueIndex` that `preorder_invoke` would visit. Using this information, we make some `PlaceIndex` inaccessible when they contain no `ValueIndex`, allowing to skip computations for those places. cc `@jachris` as original author
2023-05-10Simplify the implementation of iterators over slices of ZSTsScott McMurray-35/+51
Currently, slice iterators over ZSTs store `end = start.wrapping_byte_add(len)`. That's slightly convenient for `is_empty`, but kinda annoying for pretty much everything else -- see bugs like 42789, for example. This PR instead changes it to just `end = ptr::invalid(len)` instead. That's easier to think about (IMHO, at least) as well as easier to represent.
2023-05-10Only warn single-use lifetime when the binders match.Camille GILLOT-5/+12
2023-05-10Avoid shadowing.Camille GILLOT-2/+2