about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-02-12fix UB in ancient testRalf Jung-4/+4
2023-02-12Auto merge of #105601 - BelovDV:change-rlib-with-not-stable, r=petrochenkovbors-17/+87
Enable new rlib in non stable cases If bundled static library uses cfg (unstable) or whole-archive (wasn't supported) bundled libs are packed even without packed_bundled_libs. r? `@petrochenkov`
2023-02-11Auto merge of #107851 - cjgillot:sroa-const, r=oli-obkbors-0/+55
Put deaggregated statements after original constant. Fixes https://github.com/rust-lang/rust/issues/107818
2023-02-11Auto merge of #107928 - matthiaskrgr:rollup-qnn380r, r=matthiaskrgrbors-1/+52
Rollup of 7 pull requests Successful merges: - #107657 (Add only modified subcommand for compiletest) - #107864 (rustdoc: clean up `write!` calls with less stuttering) - #107873 (Emit JSON output for the building of bootstrap itself) - #107895 (remove redundant clones) - #107897 (Reexported macros docs) - #107909 (rustdoc: remove redundant `if s.is_empty()` from `find_testable_code`) - #107912 (rustdoc: Don't resolve link to field on different variant) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-11Rollup merge of #107912 - clubby789:doc-bad-enum-field, r=camelid,GuillaumeGomezMatthias Krüger-1/+29
rustdoc: Don't resolve link to field on different variant Fix #107903 This also gives a more specific diagnostic when the enum has any fields
2023-02-11Rollup merge of #107897 - GuillaumeGomez:reexported-macros-docs, r=notriddleMatthias Krüger-0/+23
Reexported macros docs Part of #59368 (doesn't fix it, only improve the current situation a bit). Macros were not correctly handled in reexports and the reexport attributes were not merged with the item either. This PR fixes both. r? `@notriddle`
2023-02-11Auto merge of #107167 - the8472:rawvec-simpler-layout, r=thomccbors-1/+1
simplify layout calculations in rawvec The use of `Layout::array` was introduced in #83706 which lead to a [perf regression](https://github.com/rust-lang/rust/pull/83706#issuecomment-1048377719). This PR basically reverts that change since rust currently only supports stride == size types, but to be on the safe side it leaves a const-assert there to make sure this gets caught if those assumptions ever change.
2023-02-11rustdoc: Don't resolve link to field on different variantclubby789-1/+29
2023-02-11Auto merge of #107919 - Dylan-DPC:rollup-fkl9swa, r=Dylan-DPCbors-28/+223
Rollup of 9 pull requests Successful merges: - #105019 (Add parentheses properly for borrowing suggestion) - #106001 (Stop at the first `NULL` argument when iterating `argv`) - #107098 (Suggest function call on pattern type mismatch) - #107490 (rustdoc: remove inconsistently-present sidebar tooltips) - #107855 (Add a couple random projection tests for new solver) - #107857 (Add ui test for implementation on projection) - #107878 (Clarify `new_size` for realloc means bytes) - #107888 (revert #107074, add regression test) - #107900 (Zero the `REPARSE_MOUNTPOINT_DATA_BUFFER` header) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-11Auto merge of #107507 - BoxyUwU:deferred_projection_equality, r=lcnrbors-0/+188
Implement `deferred_projection_equality` for erica solver Somewhat of a revival of #96912. When relating projections now emit an `AliasEq` obligation instead of attempting to determine equality of projections that may not be as normalized as possible (i.e. because of lazy norm, or just containing inference variables that prevent us from resolving an impl). Only do this when the new solver is enabled
2023-02-11Rollup merge of #107888 - lcnr:opaque-ty-validate, r=wesleywiserDylan DPC-1/+4
revert #107074, add regression test fixes #107346
2023-02-11Rollup merge of #107857 - GuillaumeGomez:ui-test-impl-projections, r=oli-obkDylan DPC-0/+30
Add ui test for implementation on projection The error in full can be seen in https://github.com/rust-lang/rust/pull/107263 and is part of why the PR is blocked (it still requires the approval from the team for supporting it). r? ``@oli-obk``
2023-02-11Rollup merge of #107855 - compiler-errors:new-solver-random-tests, r=lcnrDylan DPC-0/+71
Add a couple random projection tests for new solver Self-explanatory, they're just some cases that have been on my mind in the past (especially `tests/ui/traits/new-solver/param-candidate-doesnt-shadow-project.rs`).
2023-02-11Rollup merge of #107490 - notriddle:notriddle/rm-sidebar-tooltip, ↵Dylan DPC-27/+0
r=GuillaumeGomez rustdoc: remove inconsistently-present sidebar tooltips Discussed in https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Inconsistent.20sidebar.20tooltips/near/323565625
2023-02-11Rollup merge of #107098 - compiler-errors:pat-mismatch-fn-call, r=lcnrDylan DPC-0/+49
Suggest function call on pattern type mismatch Fixes #101208 This could definitely be generalized to support more suggestions in pattern matches. We can't use all of [`FnCtxt::emit_type_mismatch_suggestions`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/fn_ctxt/struct.FnCtxt.html#method.emit_type_mismatch_suggestions), but it's on my to-do list to play around with more suggestions that would be productive in this position.
2023-02-11Rollup merge of #105019 - chenyukang:yukang/fix-104961-borrow, r=cjgillotDylan DPC-0/+69
Add parentheses properly for borrowing suggestion Fixes #104961
2023-02-10Auto merge of #85158 - JulianKnodt:array_const_val, r=cjgillotbors-0/+488
Mir-Opt for copying enums with large discrepancies I have been meaning to make this for quite a while, based off of this [hackmd](https://hackmd.io/`@ft4bxUsFT5CEUBmRKYHr7w/rJM8BBPzD).` I'm not sure where to put this opt now that I've made it, so I'd appreciate suggestions on that! It's also one long chain of statements, not sure if there's a more friendly format to make it. r? `@tmiasko` I would `r` oli but he's on leave so he suggested I `r` tmiasko or wesleywiser.
2023-02-10Suggest fn call on pattern type mismatchMichael Goulet-0/+49
2023-02-10Add a couple random projection testsMichael Goulet-0/+71
2023-02-10Add regression test for reexported macros docsGuillaume Gomez-0/+23
2023-02-10Add testsBoxy-0/+188
2023-02-10Rollup merge of #107836 - chenyukang:yukang/fix-107822, r=oli-obkMatthias Krüger-0/+6
Handle properly when there is no crate attrs Fixes #107822 r? `@oli-obk`
2023-02-10Rollup merge of #107789 - jieyouxu:issue-107745, r=lcnrMatthias Krüger-17/+45
Avoid exposing type parameters and implementation details sourced from macro expansions Fixes #107745. ~~I would like to **request some guidance** for this issue, because I don't think this is a good fix (a band-aid at best).~~ ### The Problem The code ```rust fn main() { println!("{:?}", []); } ``` gets desugared into (`rustc +nightly --edition=2018 issue-107745.rs -Z unpretty=hir`): ```rust #[prelude_import] use std::prelude::rust_2018::*; #[macro_use] extern crate std; fn main() { { ::std::io::_print(<#[lang = "format_arguments"]>::new_v1(&["", "\n"], &[<#[lang = "format_argument"]>::new_debug(&[])])); }; } ``` so the diagnostics code tries to be as specific and helpful as possible, and I think it finds that `[]` needs a type parameter and so does `new_debug`. But since `[]` doesn't have an origin for the type parameter definition, it points to `new_debug` instead and leaks the internal implementation detail since all `[]` has is an type inference variable. ### ~~The Bad Fix~~ ~~This PR currently tries to fix the problem by bypassing the generated function `<#[lang = "format_argument"]>::new_debug` to avoid its generic parameter (I think it is auto-generated from the argument `[_; 0]`?) from getting collected as an `InsertableGenericArg`. This is problematic because it also prevents the help from getting displayed.~~ ~~I think this fix is not ideal and hard-codes the format generated code pattern, but I can't think of a better fix. I have tried asking on Zulip but no responses there yet.~~
2023-02-10revert #107074lcnr-1/+4
2023-02-10Add test for implementation on projectionGuillaume Gomez-0/+30
2023-02-10Auto merge of #107652 - estebank:re_error, r=oli-obkbors-179/+114
Introduce `ReError` CC #69314 r? `@nagisa`
2023-02-10[link] enable packed bundled lib in non stable casesDaniil Belov-17/+87
2023-02-10add test for no input fileyukang-0/+6
2023-02-10Auto merge of #107870 - matthiaskrgr:rollup-3z1q4rm, r=matthiaskrgrbors-16/+5
Rollup of 6 pull requests Successful merges: - #107043 (Support `true` and `false` as boolean flag params) - #107831 (Query refactoring) - #107841 (Handled snap curl issue inside Rust) - #107852 (rustdoc: remove unused fn parameter `tab`) - #107861 (Sync release notes for 1.67.1) - #107863 (Allow multiple candidates with same response in new solver) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-10Rollup merge of #107863 - compiler-errors:new-solver-multiple-candidates, ↵Matthias Krüger-12/+1
r=jackh726 Allow multiple candidates with same response in new solver Treat >1 candidates as *not* ambiguous if they return the same response.
2023-02-10Rollup merge of #107043 - Nilstrieb:true-and-false-is-false, r=wesleywiserMatthias Krüger-4/+4
Support `true` and `false` as boolean flag params Implements [MCP 577](https://github.com/rust-lang/compiler-team/issues/577).
2023-02-10Auto merge of #101680 - jackh726:implied-cleanup, r=lcnrbors-2/+2
Fix implied outlives bounds logic for projections The logic here is subtly wrong. I put a bit of an explanation in a767d7b5165cea8ee5cbe494a4a636c50ef67c9c. TL;DR: we register outlives predicates to be proved, because wf code normalizes projections (from the unnormalized types) to type variables. This causes us to register those as constraints instead of implied. This was "fine", because we later added that implied bound in the normalized type, and delayed registering constraints. When I went to cleanup `free_region_relations` to *not* delay adding constraints, this bug was uncovered. cc. `@aliemjay` because this caused your test failure in #99832 (I only realized as I was writing this) r? `@nikomatsakis`
2023-02-09Cleanup free_region_relations a bitJack Huey-2/+2
2023-02-10Multiple candidates with same response is not ambiguousMichael Goulet-12/+1
2023-02-10Auto merge of #102963 - ilammy:xray-basic, r=estebankbors-0/+99
Add `-Z instrument-xray` flag Implement MCP https://github.com/rust-lang/compiler-team/issues/561, adding `-Z instrument-xray` flag which enables XRay instrumentation in LLVM.
2023-02-09Rollup merge of #107815 - compiler-errors:new-solver-no-auto-if-impl, r=lcnrDylan DPC-0/+8
Disqualify `auto trait` built-in impl in new solver if explicit `impl` exists
2023-02-09Rollup merge of #107803 - ↵Dylan DPC-0/+21
eggyal:do_not_bring_trait_alias_supertraits_into_scope, r=compiler-errors Do not bring trait alias supertraits into scope Fixes #107747 cc #41517
2023-02-09Rollup merge of #107786 - compiler-errors:new-solver-some-tweaks, r=lcnrDylan DPC-9/+44
Implement some tweaks in the new solver I've been testing the new solver on some small codebases, and these are a few small changes I've needed to make. The most "controversial" here is implementing `trait_candidate_should_be_dropped_in_favor_of`, which I just implemented to always return false. This surprisingly allows some code to compile, without us having to actually decide on any semantics yet. r? `@rust-lang/initiative-trait-system-refactor`
2023-02-09Rollup merge of #107659 - bvanjoi:issue-107649, r=estebankDylan DPC-0/+124
test: snapshot for derive suggestion in diff files fixed #107649
2023-02-09Rollup merge of #107655 - notriddle:notriddle/small-url-encode, r=GuillaumeGomezDylan DPC-14/+14
rustdoc: use the same URL escape rules for fragments as for examples Carries over improvements from #107284
2023-02-09Rollup merge of #107648 - matthiaskrgr:unused_lifetime_104432_fix, r=cjgillotDylan DPC-0/+12
unused-lifetimes: don't warn about lifetimes originating from expanded code previously, we would warn like this: ```` warning: lifetime parameter `'s` never used --> /tmp/unusedlif/code.rs:6:62 | 5 | #[derive(Clone)] | - help: elide the unused lifetime 6 | struct ShimMethod4<T: Trait2 + 'static>(pub &'static dyn for<'s> Fn(&'s mut T::As)); | ^^ | = note: requested on the command line with `-W unused-lifetimes` ```` Fixes #104432
2023-02-09Put deaggregated statements after original constant.Camille GILLOT-0/+55
2023-02-09Disqualify auto-trait builtin impl in new solver if impl existsMichael Goulet-0/+8
2023-02-09Implement a dummy drop-in-favor-of for the new solverMichael Goulet-9/+32
2023-02-09Use elaborated item bounds for alias typesMichael Goulet-0/+12
2023-02-09test: snapshot for derive suggestion in diff filesbohan-0/+124
2023-02-09Introduce `ReError`Esteban Küber-179/+114
CC #69314
2023-02-09Rollup merge of #107446 - clubby789:rustc-parse-diag-migrate, r=compiler-errorsMatthias Krüger-0/+14
Migrate some of `rustc_parse` to derive diagnostics `@rustbot` label +A-translation r? rust-lang/diagnostics cc #100717
2023-02-09Don't expose type parameters and implementation details from macro expansion许杰友 Jieyou Xu (Joe)-17/+45
2023-02-09Auto merge of #106938 - GuillaumeGomez:normalize-projection-field-ty, r=oli-obkbors-0/+80
Add missing normalization for union fields types Overshadows https://github.com/rust-lang/rust/pull/106808. From the experiment https://github.com/rust-lang/rust/pull/103985. In short, it allows to use projections as a type for union's fields. cc `@compiler-errors` r? `@oli-obk`