about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-03-28Auto merge of #109692 - Nilstrieb:rollup-hq65rps, r=Nilstriebbors-4/+179
Rollup of 8 pull requests Successful merges: - #91793 (socket ancillary data implementation for FreeBSD (from 13 and above).) - #92284 (Change advance(_back)_by to return the remainder instead of the number of processed elements) - #102472 (stop special-casing `'static` in evaluation) - #108480 (Use Rayon's TLV directly) - #109321 (Erase impl regions when checking for impossible to eagerly monomorphize items) - #109470 (Correctly substitute GAT's type used in `normalize_param_env` in `check_type_bounds`) - #109562 (Update ar_archive_writer to 0.1.3) - #109629 (remove obsolete `givens` from regionck) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-28Auto merge of #108080 - oli-obk:FnPtr-trait, r=lcnrbors-20/+9
Add a builtin `FnPtr` trait that is implemented for all function pointers r? `@ghost` Rebased version of https://github.com/rust-lang/rust/pull/99531 (plus adjustments mentioned in the PR). If perf is happy with this version, I would like to land it, even if the diagnostics fix in 9df8e1befb5031a5bf9d8dfe25170620642d3c59 only works for `FnPtr` specifically, and does not generally improve blanket impls.
2023-03-28Rollup merge of #109629 - aliemjay:remove-givens, r=lcnrnils-0/+82
remove obsolete `givens` from regionck Revives #107376. The only change is the last commit (https://github.com/rust-lang/rust/pull/109629/commits/2a3177a8bcc4c5a5285dc2908a0f1ce98e9a6377) which should fix the regression. Fixes https://github.com/rust-lang/rust/issues/106567 r? `@lcnr`
2023-03-28Rollup merge of #109470 - compiler-errors:gat-normalize-bound, r=jackh726nils-0/+17
Correctly substitute GAT's type used in `normalize_param_env` in `check_type_bounds` Given: ```rust trait Foo { type Assoc<T>: PartialEq<Self::Assoc<i32>>; } impl Foo for () { type Assoc<T> = Wrapper<T>; } struct Wrapper<T>(T); impl<T> PartialEq<Wrapper<i32>> for Wrapper<T> { } ``` We add an additional predicate in the `normalize_param_env` in `check_type_bounds` that is used to normalize the GAT's bounds to check them in the impl. Problematically, though, that predicate is constructed to be `for<^0> <() as Foo>::Assoc<^0> => Wrapper<T>`, instead of `for<^0> <() as Foo>::Assoc<^0> => Wrapper<^0>`. That means `Self::Assoc<i32>` in the bounds that we're checking normalizes to `Wrapper<T>`, instead of `Wrapper<i32>`, and so the bound `Self::Assoc<T>: PartialEq<Self::Assoc<i32>>` normalizes to `Wrapper<T>: PartialEq<Wrapper<T>>`, which does not hold. Fixes this by properly substituting the RHS of that normalizes predicate that we add to the `normalize_param_env`. That means the bound is properly normalized to `Wrapper<T>: PartialEq<Wrapper<i32>>`, which *does* hold. --- The second commit in this PR just cleans up some substs stuff and some naming. r? `@jackh726` cc #87900
2023-03-28Rollup merge of #109321 - compiler-errors:illegal-mono-w-regions, r=cjgillotnils-0/+19
Erase impl regions when checking for impossible to eagerly monomorphize items We were inserting `ReErased` for method substs, but not for impl substs, leading to the call for `subst_and_check_impossible_predicates` being a bit weaker than it should be (since it ignores predicates that need substitution -- incl early-bound regions). Fixes #109297
2023-03-28Rollup merge of #102472 - lcnr:static-in-eval, r=jackh726nils-4/+61
stop special-casing `'static` in evaluation fixes #102360 I have no idea whether this actually removed all places where `'static` matters. Without canonicalization it's very easy to accidentally rely on `'static` again. Blocked on changing the `order_dependent_trait_objects` future-compat lint to a hard error r? `@nikomatsakis`
2023-03-28Auto merge of #109557 - fee1-dead-contrib:mv-const-traits, r=oli-obkbors-259/+397
Move const trait bounds checks to MIR constck Fixes #109543. When checking paths in HIR typeck, we don't want to check for const predicates since all we want might just be a function pointer. Therefore we move this to MIR constck and check that bounds are met during MIR constck. r? `@oli-obk`
2023-03-28fix long lineDeadbeef-23/+25
2023-03-28Move const trait bounds checks to MIR constckDeadbeef-259/+395
Fixes #109543. When checking paths in HIR typeck, we don't want to check for const predicates since all we want might just be a function pointer. Therefore we move this to MIR constck and check that bounds are met during MIR constck.
2023-03-28Rollup merge of #109661 - ↵Matthias Krüger-7/+7
fortanix:raoul/EDP-107-fix_lvi_mitigation_tests_llvm_16, r=cuviper Fix LVI test post LLVM 16 update #109474 updated LLVM to 16. This causes the LVI mitigation tests for the `x86_64-fortanix-unknown-sgx` platform to fail. This PR fixes those tests again. cc: `@jethrogb`
2023-03-28Rollup merge of #108548 - jamen:master, r=compiler-errorsMatthias Krüger-10/+156
Clarify the 'use a constant in a pattern' error message ```rs use std::borrow::Cow; const ERROR_CODE: Cow<'_, str> = Cow::Borrowed("23505"); fn main() { let x = Cow::from("23505"); match x { ERROR_CODE => {} } } ``` ``` error: to use a constant of type `Cow` in a pattern, `Cow` must be annotated with `#[derive(PartialEq, Eq)]` --> src/main.rs:9:9 | 9 | ERROR_CODE => {} | ^^^^^^^^^^ error: could not compile `playground` due to previous error ``` It seems helpful to link to StructuralEq in this message. I was a little confused, because `Cow<'_, str>` implements PartialEq and Eq, but they're not derived, which I learned is necessary for structural equality and using constants in patterns (thanks to the Rust community Discord server) For tests, should I update every occurrence of this message? I see tests where this is still a warning and I'm not sure if I should update those.
2023-03-28Erase impl regions when checking for impossible to eagerly monomorphize itemsMichael Goulet-0/+19
2023-03-27Auto merge of #109440 - WaffleLapkin:make_tidy_slower, r=jyn514bors-2/+1
Don't skip all directories when tidy-checking This fixes a regression from https://github.com/rust-lang/rust/pull/108772 which basically made it that tidy style checks only `README.md` and `COMPILER_TESTS.md`.
2023-03-27Bless tidyMaybe Waffle-2/+1
2023-03-27Rollup merge of #109637 - bjorn3:add_test_annotation, r=tmiaskoGuillaume Gomez-0/+1
Add missing needs-asm-support annotation to ui/simple_global_asm.rs
2023-03-27Rollup merge of #109330 - ↵Guillaume Gomez-0/+14
GuillaumeGomez:intermediate-reexport-intra-doc-ice, r=petrochenkov rustdoc: Fix ICE for intra-doc link on intermediate re-export Fixes https://github.com/rust-lang/rust/issues/109282. This PR is based on #109266 as it includes its commit to make this work. `@petrochenkov:` It was exactly as you predicted, adding the `DefId` to the attributes fixed the error for intermediate re-exports as well. Thanks a lot! r? `@petrochenkov`
2023-03-27Add notes to non-structural const in pattern error messageJamen Marz-10/+156
2023-03-27Use the FnPtr trait to avoid implementing common traits via macrosOli Scherer-20/+0
2023-03-27Add a builtin `FnPtr` traitlcnr-0/+9
2023-03-27Fix LVI test post LLVM 16 updateRaoul Strackx-7/+7
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 missing needs-asm-support annotation to ui/simple_global_asm.rsbjorn3-0/+1
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-26tolerate region vars in implied boundsAli MJ Al-Nasrawy-0/+24
See https://github.com/rust-lang/rust/issues/109628.
2023-03-26add testAli MJ Al-Nasrawy-0/+58
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).