about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-05-05Add regression test for #111064Guillaume Gomez-0/+52
2023-04-29Extend foreign inlined item with `#[repr()]` testGuillaume Gomez-5/+39
2023-04-29Rollup merge of #110965 - compiler-errors:anon-lt-dupe-oops, r=cjgillotDylan DPC-3/+163
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-1/+1
Make drop_flags an IndexVec. Fixes https://github.com/rust-lang/rust/issues/91943
2023-04-29Rollup merge of #110614 - compiler-errors:new-solver-overflow-response, r=lcnrDylan DPC-0/+43
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-29Auto merge of #110643 - pietroalbini:pa-bump-stage0, r=Mark-Simulacrumbors-4/+3
[master] Bump stage0 r? `@Mark-Simulacrum`
2023-04-28Auto merge of #110967 - matthiaskrgr:rollup-vfbl7gm, r=matthiaskrgrbors-71/+184
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-28Rollup merge of #110960 - lukas-code:unused-mut, r=compiler-errorsMatthias Krüger-8/+24
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-0/+30
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 #110877 - compiler-errors:binop-err, r=cjgillotMatthias Krüger-62/+129
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-0/+17
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-3/+163
2023-04-28Make drop_flags an IndexVec.Camille GILLOT-1/+1
2023-04-28remove unused `mut`sLukas Markeffsky-7/+7
2023-04-28Fix an ICE in conflict errors diagnosticsMaybe Waffle-314/+17
2023-04-28fix false negative for `unused_mut`Lukas Markeffsky-1/+17
2023-04-28Add regression test for issue 110929Maybe Waffle-0/+327
2023-04-28handle cfg(bootstrap)Pietro Albini-4/+3
2023-04-28run-make test: using single quotes to not trigger the shellTim Neumann-1/+1
2023-04-28Auto merge of #110837 - scottmcm:offset-for-add, r=compiler-errorsbors-6/+348
Use MIR's `Offset` for pointer `add` too ~~Status: draft while waiting for #110822 to land, since this is built atop that.~~ ~~r? `@ghost~~` Canonical Rust code has mostly moved to `add`/`sub` on pointers, which take `usize`, instead of `offset` which takes `isize`. (And, relatedly, when `sub_ptr` was added it turned out it replaced every single in-tree use of `offset_from`, because `usize` is just so much more useful than `isize` in Rust.) Unfortunately, `intrinsics::offset` could only accept `*const` and `isize`, so there's a *huge* amount of type conversions back and forth being done. They're identity conversions in the backend, but still end up producing quite a lot of unhelpful MIR. This PR changes `intrinsics::offset` to accept `*const` *and* `*mut` along with `isize` *and* `usize`. Conveniently, the backends and CTFE already handle this, since MIR's `BinOp::Offset` [already supports all four combinations](https://github.com/rust-lang/rust/blob/adaac6b166df57ea5a20d56e4cce503b55aca927/compiler/rustc_const_eval/src/transform/validate.rs#L523-L528). To demonstrate the difference, I added some `mir-opt/pre-codegen/` tests around slice indexing. Here's the difference to `[T]::get_mut`, since it uses `<*mut _>::add` internally: ```diff `@@` -79,30 +70,21 `@@` fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { StorageLive(_12); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL StorageLive(_9); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL _9 = _8 as *mut u32 (PtrToPtr); // scope 11 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - StorageLive(_13); // scope 13 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - _13 = _2 as isize (IntToInt); // scope 13 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - StorageLive(_14); // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - StorageLive(_15); // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - _15 = _9 as *const u32 (Pointer(MutToConstPointer)); // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - _14 = Offset(move _15, _13); // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - StorageDead(_15); // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - _7 = move _14 as *mut u32 (PtrToPtr); // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - StorageDead(_14); // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - StorageDead(_13); // scope 13 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL + _7 = Offset(_9, _2); // scope 13 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL StorageDead(_9); // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL StorageDead(_12); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL StorageDead(_11); // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL ``` https://github.com/rust-lang/rust/pull/110837/commits/1c1c8e442add0f46905a57a25a6cba52b8b0c54d#diff-a841b6a4538657add3f39bc895744331453d0625e7aace128b1f604f0b63c8fdR80
2023-04-28Auto merge of #110924 - matthiaskrgr:rollup-jvznpq2, r=matthiaskrgrbors-96/+155
Rollup of 6 pull requests Successful merges: - #110766 (More core::fmt::rt cleanup.) - #110873 (Migrate trivially translatable `rustc_parse` diagnostics) - #110904 (rustdoc: rebind bound vars to type-outlives predicates) - #110913 (Add some missing built-in lints) - #110918 (`remove_dir_all`: try deleting the directory even if `FILE_LIST_DIRECTORY` access is denied) - #110920 (Fix unavailable url) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-27Also use `mir::Offset` for pointer `add`Scott McMurray-70/+64
2023-04-28Rollup merge of #110913 - compiler-errors:missing-lints, r=NilstriebMatthias Krüger-19/+30
Add some missing built-in lints (and also sort them, so this is best reviewed one commit at a time) Fixes #110911 I wonder if there's a good way to detect when a lint is built-in (i.e. not associated to a lint pass). If so, it needs to be added to this list, or else we're unable to `allow` or `deny` it. Leaving that for future work, I guess...
2023-04-28Rollup merge of #110904 - fmease:rustdoc-fix-110900, r=compiler-errorsMatthias Krüger-0/+28
rustdoc: rebind bound vars to type-outlives predicates Fixes #110900.
2023-04-28Rollup merge of #110873 - clubby789:migrate-rustc-parse-trivial, ↵Matthias Krüger-46/+66
r=compiler-errors Migrate trivially translatable `rustc_parse` diagnostics cc #100717 Migrate diagnostics in `rustc_parse` which are emitted in a single statement. I worked on this by expanding the lint introduced in #108760, although that isn't included here as there is much more work to be done to satisfy it
2023-04-28Rollup merge of #110766 - m-ou-se:fmt-rt, r=jyn514Matthias Krüger-31/+31
More core::fmt::rt cleanup. - Removes the `V1` suffix from the `Argument` and `Flag` types. - Moves more of the format_args lang items into the `core::fmt::rt` module. (The only remaining lang item in `core::fmt` is `Arguments` itself, which is a public type.) Part of https://github.com/rust-lang/rust/issues/99012 Follow-up to https://github.com/rust-lang/rust/pull/110616
2023-04-28Auto merge of #110919 - JohnTitor:rollup-9phs2vx, r=JohnTitorbors-0/+38
Rollup of 7 pull requests Successful merges: - #109702 (configure --set support list as arguments) - #110620 (Document `const {}` syntax for `std::thread_local`.) - #110721 (format panic message only once) - #110881 (refactor(docs): remove macro resolution fallback) - #110893 (remove inline const deadcode in typeck) - #110898 (Remove unused std::sys_common::thread_local_key::Key) - #110909 (Skip `rustc` version detection on macOS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-28Rollup merge of #110881 - bvanjoi:fix-110879, r=jyn514Yuki Okushi-0/+14
refactor(docs): remove macro resolution fallback close https://github.com/rust-lang/rust/issues/110879 r?`@jyn514`
2023-04-28Rollup merge of #110721 - lukas-code:panic-fmt, r=AmanieuYuki Okushi-0/+24
format panic message only once Formatting the panic message multiple times can cause problems for some real-world crates, so here's a test to ensure that we don't do that. This was regressed in https://github.com/rust-lang/rust/pull/109507 and reverted in https://github.com/rust-lang/rust/pull/110782. fixes https://github.com/rust-lang/rust/issues/110717 fixes https://github.com/rust-itertools/itertools/issues/694
2023-04-28Auto merge of #110801 - WaffleLapkin:io-tests, r=jyn514bors-56/+38
Fix `ui/io-checks/inaccessbile-temp-dir.rs` test Fixes #110794 r? `@jyn514`
2023-04-27Rollup merge of #110878 - whtahy:105107/known-bug-tests-for-unsound-issues, ↵Matthias Krüger-0/+152
r=jackh726 Add `known-bug` tests for 4 unsound issues This PR adds `known-bug` tests for 4 unsound issues as part of #105107 - #40582 - #49682 - #74629 - #105782
2023-04-27Add invalid_macro_export_arguments to built-in macro listMichael Goulet-19/+30
2023-04-27rustdoc: rebind bound vars to type-outlives predicatesLeón Orell Valerian Liehr-0/+28
2023-04-27Add regression test for #110698Guillaume Gomez-0/+17
2023-04-27Rollup merge of #110866 - compiler-errors:test, r=jyn514Matthias Krüger-5/+5
Make `method-not-found-generic-arg-elision.rs` error message not path dependent Every time I bless `tests/ui/methods/method-not-found-generic-arg-elision.rs`, I get some nonsense "type is too long" + "written to disk" that shows up and have to manually revert because the combination of my rustc repo path + the UI test directory hits the length limit for printing types spilling to disk (since this happens before UI test path sanitization). The fact that we use a closure in this test doesn't have to do with the UI test, so just box the closure to make the type name smaller and not path dependent.
2023-04-27Rollup merge of #110864 - compiler-errors:into-future-stable, r=jackh726Matthias Krüger-1/+1
`IntoFuture::into_future` is no longer unstable We don't need to gate the `IntoFuture::into_future` call in `.await` lowering anymore. ``@bors`` rollup
2023-04-27Rollup merge of #110816 - clubby789:rustc-passes-diagnostics, r=compiler-errorsMatthias Krüger-5/+5
Migrate `rustc_passes` to translatable diagnostics cc #100717
2023-04-27Rollup merge of #110804 - cuishuang:master, r=jyn514Matthias Krüger-2/+2
Remove repeated definite articles
2023-04-27ignore failing test on armMaybe Waffle-0/+1
2023-04-27fix typo in the `inaccessible-temp-dir` test nameMaybe Waffle-0/+0
(formally `...inaccessbile...`)
2023-04-27test(doc): no fallback marco resolutionbohan-0/+14
2023-04-26add known-bug test for unsound issue 105782whtahy-0/+30
2023-04-26add known-bug test for unsound issue 74629whtahy-0/+41
2023-04-26add known-bug test for unsound issue 49682whtahy-0/+46
2023-04-26add known-bug test for unsound issue 40582whtahy-0/+35
2023-04-27Fix a bad binop error when we need a callMichael Goulet-4/+5
2023-04-27Provide RHS type hint when reporting operator errorMichael Goulet-58/+124
2023-04-27Migrate trivially translatable `rustc_parse` diagnosticsclubby789-46/+66
2023-04-26IntoFuture::into_future is no longer unstableMichael Goulet-1/+1