about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-03-27Rollup merge of #109633 - GuillaumeGomez:fix-go-to-only-setting, r=notriddleMatthias Krüger-0/+63
Fix "Directly go to item in search if there is only one result" setting Part of #66181. The setting was actually broken, so I fixed it when I added the GUI test. r? `@notriddle`
2023-03-27Rollup merge of #109613 - lukas-code:match-str-to-char-suggestion, ↵Matthias Krüger-1/+32
r=compiler-errors fix type suggestions in match arms fix https://github.com/rust-lang/rust/issues/109586
2023-03-26Add GUI test for "Directly go to item in search if there is only one result" ↵Guillaume Gomez-0/+63
setting
2023-03-26Auto merge of #109626 - matthiaskrgr:rollup-k0y7bdd, r=matthiaskrgrbors-13/+166
Rollup of 6 pull requests Successful merges: - #109007 (rustdoc: skip `// some variants omitted` if enum is `#[non_exhaustive]`) - #109593 (Rustdoc Book refer to rustdoc::missing_doc_code_examples. Fixes #109592.) - #109595 (Improve "Auto-hide trait implementation documentation" GUI test) - #109619 (Still-further-specializable projections are ambiguous in new solver) - #109620 (Correct typo (`back_box` -> `black_box`)) - #109621 (Refactor: `VariantIdx::from_u32(0)` -> `FIRST_VARIANT`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-26Rollup merge of #109619 - ↵Matthias Krüger-0/+108
compiler-errors:new-solver-still-further-specializable, r=BoxyUwU Still-further-specializable projections are ambiguous in new solver Fixes https://github.com/rust-lang/rust/pull/108896/files#r1148450781 r? ``@BoxyUwU`` (though feel free to re-roll) --- This can be used to create an unsound transmute function with the new solver: ```rust #![feature(specialization)] trait Default { type Id; fn intu(&self) -> &Self::Id; } impl<T> Default for T { default type Id = T; fn intu(&self) -> &Self::Id { self } } fn transmute<T: Default<Id = U>, U: Copy>(t: T) -> U { *t.intu() } use std::num::NonZeroU8; fn main() { let s = transmute::<u8, Option<NonZeroU8>>(0); assert_eq!(s, None); } ```
2023-03-26Rollup merge of #109595 - GuillaumeGomez:improve-gui-test-auto-hide-trait, ↵Matthias Krüger-13/+47
r=notriddle Improve "Auto-hide trait implementation documentation" GUI test Part of #66181. I'll start working on the `include` command for `browser-ui-test` so we can greatly reduce the duplicated code between setting tests. r? ``@notriddle``
2023-03-26Auto merge of #106428 - saethlin:inline-diverging-functions, r=cjgillotbors-74/+711
Permit the MIR inliner to inline diverging functions This heuristic prevents inlining of `hint::unreachable_unchecked`, which in turn makes `Option/Result::unwrap_unchecked` a bad inlining candidate. I looked through the changes to `core`, `alloc`, `std`, and `hashbrown` by hand and they all seem reasonable. Let's see how this looks in perf... --- Based on rustc-perf it looks like this regresses ctfe-stress, and the cachegrind diff indicates that this regression is in `InterpCx::statement`. I don't know how to do any deeper analysis because that function is _enormous_ in the try toolchain, which has no debuginfo in it. And a local build produces significantly different codegen for that function, even with LTO.
2023-03-26rustdoc: tweak `some variants omitted`Ezra Shaw-0/+11
Don't display `// some variants omitted` if enum is marked `#[non_exhaustive]`
2023-03-26transmute testMichael Goulet-0/+61
2023-03-25Still-further-specializable projections are ambiguousMichael Goulet-0/+47
2023-03-25Ignore the unwrap_unchecked test on wasm32-unknown-unknownBen Kimock-3/+4
2023-03-25fix type suggestions in match armsLukas Markeffsky-1/+32
2023-03-25Auto merge of #109474 - nikic:llvm-16-again, r=cuviperbors-3/+3
Upgrade to LLVM 16, again Relative to the previous attempt in https://github.com/rust-lang/rust/pull/107224: * Update to GCC 8.5 on dist-x86_64-linux, to avoid std::optional ABI-incompatibility between libstdc++ 7 and 8. * Cherry-pick https://github.com/llvm/llvm-project/commit/96df79af029b85616ab90e73143e0e8ae89c7b46. * Cherry-pick https://github.com/llvm/llvm-project/commit/6fc670e5e370e90759b5adecd9980b63609dc2f8. r? `@cuviper`
2023-03-25Improve "Auto-hide trait implementation documentation" GUI testGuillaume Gomez-13/+47
2023-03-25Rollup merge of #109570 - GuillaumeGomez:add-gui-test, r=notriddleMatthias Krüger-0/+48
Add GUI test for "Auto-hide item methods' documentation" setting Part of https://github.com/rust-lang/rust/issues/66181. r? `@notriddle`
2023-03-25Rollup merge of #109545 - compiler-errors:rpitit-wf, r=eholkMatthias Krüger-11/+36
Deeply check well-formedness of return-position `impl Trait` in trait Walk the bounds of RPITITs to see if we find any more RPITITs 😸
2023-03-25Rollup merge of #109355 - chenyukang:yukang/fix-108470, r=compiler-errorsMatthias Krüger-0/+85
Fix bad suggestion for clone/is_some in field init shorthand Fixes #108470
2023-03-24Auto merge of #107932 - petrochenkov:onlyexport, r=jyn514bors-0/+13
rustdoc: Skip doc link resolution for non-exported items
2023-03-24Add GUI test for "Auto-hide item methods' documentation" settingGuillaume Gomez-0/+48
2023-03-24Auto merge of #109220 - nikic:poison, r=cuviperbors-1/+1
Use poison instead of undef In cases where it is legal, we should prefer poison values over undef values. This replaces undef with poison for aggregate construction and for uninhabited types. There are more places where we can likely use poison, but I wanted to stay conservative to start with. In particular the aggregate case is important for newer LLVM versions, which are not able to handle an undef base value during early optimization due to poison-propagation concerns. r? `@cuviper`
2023-03-24Fix bad suggestion for clone/is_some in field init shorthandyukang-0/+85
2023-03-24Rollup merge of #109495 - compiler-errors:new-solver-destruct, r=eholk,lcnrMatthias Krüger-0/+14
Implement non-const `Destruct` trait in new solver Makes it so that we can call stdlib methods like `Option::map` in **non-const** environments, since *many* stdlib methods have `Destruct` bounds 😅 This doesn't bother to implement `const Destruct` yet, but it shouldn't be too hard to do so. Just didn't bother since we already don't have much support for const traits in the new solver anyways. I'd be happy to add skeleton support for `const Destruct`, though, if the reviewer desires.
2023-03-24Rollup merge of #109433 - chenyukang:yukang/fix-109188-ice, r=lcnrMatthias Krüger-0/+41
Return equal for two identical projections Fixes #109188
2023-03-24Rollup merge of #109493 - compiler-errors:new-solver-vars-obligations, r=lcnrMatthias Krüger-0/+40
Return nested obligations from canonical response var unification Handle alias-eq obligations being emitted from `instantiate_and_apply_query_response` in: * `EvalCtxt` - by processing the nested obligations in the next loop by `new_goals` * `FulfillCtxt` - by adding the nested obligations to the fulfillment's pending obligations * `InferCtxt::evaluate_obligation` - ~~by returning `EvaluationResult::EvaluatedToAmbig` (boo :-1:, see the FIXME)~~ same behavior as above, since we use fulfillment and `select_where_possible` The only one that's truly sketchy is `evaluate_obligation`, but it's not hard to modify this behavior moving forward. From #109037, I think a smaller repro could be crafted if I were smarter, but I am not, so I just took this from #105878. r? `@lcnr` cc `@BoxyUwU`
2023-03-24Rollup merge of #108986 - fortanix:raoul/sync_lvi_patches, r=cuviperMatthias Krüger-39/+48
sync LVI tests The LVI tests for the `x86_64-fortanix-unknown-sgx` target have gotten out of sync. LVI is still mitigated correctly, but the LVI tests need minor modifications. Other (non LVI-related) tests fail when the target applies LVI mitigations as they assume the generated code contains forbidden instructions such as `retq`. These tests are ignored for the sgx environment. cc: `@jethrogb`
2023-03-24Rollup merge of #108961 - compiler-errors:refine-ct-errors, r=BoxyUwUMatthias Krüger-8/+8
Refine error spans for const args in hir typeck Improve just a couple of error messages having to do with mismatched consts. r? `@ghost` i'll put this up when the dependent commits are merged
2023-03-24Rollup merge of #108629 - notriddle:notriddle/item-type-advanced, ↵Matthias Krüger-95/+181
r=GuillaumeGomez rustdoc: add support for type filters in arguments and generics This makes sense, since the search index has the information in it, and it's more useful for function signature searches since a function signature search's item type is, by definition, some type of function (there's more than one, but not very many).
2023-03-23Deeply check WF for RPITITsMichael Goulet-11/+36
2023-03-23Auto merge of #109538 - matthiaskrgr:rollup-ct58npj, r=matthiaskrgrbors-51/+149
Rollup of 8 pull requests Successful merges: - #106964 (Clarify `Error::last_os_error` can be weird) - #107718 (Add `-Z time-passes-format` to allow specifying a JSON output for `-Z time-passes`) - #107880 (Lint ambiguous glob re-exports) - #108549 (Remove issue number for `link_cfg`) - #108588 (Fix the ffi_unwind_calls lint documentation) - #109231 (Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize`) - #109472 (Add parentheses properly for method calls) - #109487 (Move useless_anynous_reexport lint into unused_imports) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-23Note type mismatch on ConstArgHasTypeMichael Goulet-3/+3
2023-03-23Return nested obligations from canonical response var unificationMichael Goulet-0/+40
2023-03-23Rollup merge of #109487 - GuillaumeGomez:move-useless-reexport-check, ↵Matthias Krüger-43/+30
r=petrochenkov Move useless_anynous_reexport lint into unused_imports As mentioned in https://github.com/rust-lang/rust/pull/109003, this check should have been merged with `unused_imports` in the start. r? `@petrochenkov`
2023-03-23Rollup merge of #109472 - MU001999:patch-3, r=eholkMatthias Krüger-0/+28
Add parentheses properly for method calls Fixes #109436
2023-03-23Rollup merge of #108549 - clubby789:fix-link-cfg-issue, r=eholkMatthias Krüger-1/+0
Remove issue number for `link_cfg` Fixes #72059 Per #37406 and its [unstable book entry](https://doc.rust-lang.org/beta/unstable-book/language-features/link-cfg.html), this is an internal feature, and therefore perma-unstable and not being tracked
2023-03-23Rollup merge of #107880 - jieyouxu:issue-107563, r=petrochenkovMatthias Krüger-7/+90
Lint ambiguous glob re-exports Attempts to fix #107563. We currently already emit errors for ambiguous re-exports when two names are re-exported *specifically*, i.e. not from glob exports. This PR attempts to emit deny-by-default lints for ambiguous glob re-exports.
2023-03-23Rollup merge of #107718 - Zoxc:z-time, r=nnethercoteMatthias Krüger-0/+1
Add `-Z time-passes-format` to allow specifying a JSON output for `-Z time-passes` This adds back the `-Z time` option as that is useful for [my rustc benchmark tool](https://github.com/Zoxc/rcb), reverting https://github.com/rust-lang/rust/pull/102725. It now uses nanoseconds and bytes as the units so it is renamed to `time-precise`.
2023-03-23Refine error spans for const args in hir typeckMichael Goulet-6/+6
2023-03-23Auto merge of #108442 - scottmcm:mir-transmute, r=oli-obkbors-82/+772
Add `CastKind::Transmute` to MIR ~~Nothing actually produces it in this commit, so I don't know how to test it, but it also means it shouldn't be possible for it to break anything.~~ Includes lowering `transmute` calls to it, so it's used. Zulip Conversation: <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Good.20first.20isssue/near/321849610>
2023-03-23Auto merge of #108221 - petrochenkov:cratecfg, r=michaelwoeristerbors-0/+72
rustc_interface: Add a new query `pre_configure` It partially expands crate attributes before the main expansion pass (without modifying the crate), and the produced preliminary crate attribute list is used for querying a few attributes that are required very early. Crate-level cfg attributes on the crate itself are then expanded normally during the main expansion pass, like attributes on any other nodes. This is a continuation of https://github.com/rust-lang/rust/pull/92473 and one more step to very unstable crate-level proc macro attributes maybe actually working. Previously crate attributes were pre-configured simultaneously with feature extraction, and then written directly into `ast::Crate`.
2023-03-23Auto merge of #109517 - matthiaskrgr:rollup-m3orqzd, r=matthiaskrgrbors-50/+402
Rollup of 7 pull requests Successful merges: - #108541 (Suppress `opaque_hidden_inferred_bound` for nested RPITs) - #109137 (resolve: Querify most cstore access methods (subset 2)) - #109380 (add `known-bug` test for unsoundness issue) - #109462 (Make alias-eq have a relation direction (and rename it to alias-relate)) - #109475 (Simpler checked shifts in MIR building) - #109504 (Stabilize `arc_into_inner` and `rc_into_inner`.) - #109506 (make param bound vars visibly bound vars with -Zverbose) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-23rustdoc: Skip doc link resolution for non-exported itemsVadim Petrochenkov-0/+13
2023-03-23Add some tests for the current `#![cfg(FALSE)]` crate behaviorVadim Petrochenkov-0/+72
2023-03-23Auto merge of #108355 - dpaoliello:dlltoolm, r=michaelwoeristerbors-0/+42
Fix cross-compiling with dlltool for raw-dylib Fix for #103939 Issue Details: When attempting to cross-compile using the `raw-dylib` feature and the GNU toolchain, rustc would attempt to find a cross-compiling version of dlltool (e.g., `i686-w64-mingw32-dlltool`). The has two issues 1) on Windows dlltool is always `dlltool` (no cross-compiling named versions exist) and 2) it only supported compiling to i686 and x86_64 resulting in ARM 32 and 64 compiling as x86_64. Fix Details: * On Windows always use the normal `dlltool` binary. * Add the ARM64 cross-compiling dlltool name (support for this is coming: https://sourceware.org/bugzilla/show_bug.cgi?id=29964) * Provide the `-m` argument to dlltool to indicate the target machine type. (This is the first of two PRs to fix the remaining issues for the `raw-dylib` feature (#58713) that is blocking stabilization (#104218))
2023-03-23Rollup merge of #109475 - scottmcm:simpler-shifts, r=WaffleLapkinMatthias Krüger-14/+316
Simpler checked shifts in MIR building Doing masking to check unsigned shift amounts is overcomplicated; just comparing the shift directly saves a statement and a temporary, as well as is much easier to read as a human. And shifting by unsigned is the canonical case -- notably, all the library shifting methods (that don't support every type) take shift RHSs as `u32` -- so we might as well make that simpler since it's easy to do so. This PR also changes *signed* shift amounts to `IntToInt` casts and then uses the same check as for unsigned. The bit-masking is a nice trick, but for example LLVM actually canonicalizes it to an unsigned comparison anyway <https://rust.godbolt.org/z/8h59fMGT4> so I don't think it's worth the effort and the extra `Constant`. (If MIR's `assert` was `assert_nz` then the masking might make sense, but when the `!=` uses another statement I think the comparison is better.) To review, I suggest looking at https://github.com/rust-lang/rust/pull/109475/commits/2ee0468c49be9f8ea68b7b935ea1f4c2555849e9 first -- that's the interesting code change and has a MIR diff. My favourite part of the diff: ```diff - _20 = BitAnd(_19, const 340282366920938463463374607431768211448_u128); // scope 0 at $DIR/shifts.rs:+2:34: +2:44 - _21 = Ne(move _20, const 0_u128); // scope 0 at $DIR/shifts.rs:+2:34: +2:44 - assert(!move _21, "attempt to shift right by `{}`, which would overflow", _19) -> [success: bb3, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:34: +2:44 + _18 = Lt(_17, const 8_u128); // scope 0 at $DIR/shifts.rs:+2:34: +2:44 + assert(move _18, "attempt to shift right by `{}`, which would overflow", _17) -> [success: bb3, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:34: +2:44 ```
2023-03-23Rollup merge of #109462 - compiler-errors:alias-relate, r=BoxyUwU,lcnrMatthias Krüger-0/+34
Make alias-eq have a relation direction (and rename it to alias-relate) Emitting an "alias-eq" is too strict in some situations, since we don't always want strict equality between a projection and rigid ty. Adds a relation direction. * I could probably just reuse this [`RelationDir`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/combine/enum.RelationDir.html) -- happy to uplift that struct into middle and use that instead, but I didn't feel compelled to... 🤷 * Some of the matching in `compute_alias_relate_goal` is a bit verbose -- I guess I could simplify it by using [`At::relate`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/at/struct.At.html#method.relate) and mapping the relation-dir to a variance. * Alternatively, I coulld simplify things by making more helper functions on `EvalCtxt` (e.g. `EvalCtxt::relate_with_direction(T, T)` that also does the nested goal registration). No preference. r? ```@lcnr``` cc ```@BoxyUwU``` though boxy can claim it if she wants NOTE: first commit is all the changes, the second is just renaming stuff
2023-03-23Rollup merge of #109380 - Randl:patch-1, r=oli-obkMatthias Krüger-0/+52
add `known-bug` test for unsoundness issue Test for https://github.com/rust-lang/rust/issues/97156
2023-03-23Rollup merge of #108541 - compiler-errors:lol-nested-rpits, r=oli-obkMatthias Krüger-36/+0
Suppress `opaque_hidden_inferred_bound` for nested RPITs They trigger too much, making repos like linkerd/linkerd2-proxy#2275 sad. Ideally, at least for RPITs (and probably TAITs?), specifically when we have `impl Trait<Assoc = impl ..>`, that nested opaque should have the necessary `Assoc` item bounds elaborated into its own item bounds. But that's another story. r? ```@oli-obk```
2023-03-23Auto merge of #109503 - matthiaskrgr:rollup-cnp7kdd, r=matthiaskrgrbors-122/+301
Rollup of 9 pull requests Successful merges: - #108954 (rustdoc: handle generics better when matching notable traits) - #109203 (refactor/feat: refactor identifier parsing a bit) - #109213 (Eagerly intern and check CrateNum/StableCrateId collisions) - #109358 (rustc: Remove unused `Session` argument from some attribute functions) - #109359 (Update stdarch) - #109378 (Remove Ty::is_region_ptr) - #109423 (Use region-erased self type during IAT selection) - #109447 (new solver cleanup + implement coherence) - #109501 (make link clickable) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-23Nested impl traits trigger opaque_hidden_inferred_bound too muchMichael Goulet-36/+0
2023-03-23Include relation direction in AliasEq predicateMichael Goulet-0/+34