about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
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-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-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-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`
2023-02-08Rollup merge of #107813 - compiler-errors:bad-impl-trait-in-macro-is-ok, ↵Michael Goulet-0/+32
r=estebank Do not eagerly recover for bad `impl Trait` types in macros Fixes #107796 cc #106712, ```@estebank``` and ```@Ezrashaw``` please make sure to use [`Parser::may_recover`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/parser/struct.Parser.html#method.may_recover) for all eager-token-consuming parser recoveries. This also fixes a separate regression from #99915, that was introduced before we added `may_recover` though.
2023-02-08Rollup merge of #107799 - lcnr:update-provisional-result, r=oli-obkMichael Goulet-0/+43
correctly update goals in the cache we may want to actually write the response for our goal into the provisional or global cache instead of simply using the result from the last iteration '^^ r? ```@rust-lang/initiative-trait-system-refactor```
2023-02-08Rollup merge of #107761 - oli-obk:miri_🪵, r=TaKO8KiMichael Goulet-3/+2
Replace a command line flag with an env var to allow tools to initialize the tracing loggers at their own discretion fixes https://github.com/rust-lang/miri/issues/2778 this was introduced in https://github.com/rust-lang/rust/pull/104645, so this PR reverts the flag-part and uses an env var instead.
2023-02-09Test XRay only for supported targetsOleksii Lozovskyi-0/+8
Now that the compiler accepts "-Z instrument-xray" option only when targeting one of the supported targets, make sure to not run the codegen tests where the compiler will fail. Like with other compiletests, we don't have access to internals, so simply hardcode a list of supported architectures here.
2023-02-09Emit an error if -Z instrument-xray is not supportedOleksii Lozovskyi-0/+13
This is somewhat important because LLVM enables the pass based on target architecture, but support by the target OS also matters. For example, XRay attributes are processed by codegen for macOS targets, but Apple linker fails to process relocations in XRay data sections, so the feature as a whole is not supported there for the time being.
2023-02-09Codegen tests for -Z instrument-xrayOleksii Lozovskyi-0/+29
Let's add at least some tests to verify that this option is accepted and produces expected LLVM attributes. More tests can be added later with attribute support.
2023-02-09UI tests for -Z instrument-xrayOleksii Lozovskyi-0/+40
I'm tired of testing it manually, just codify my expectations in tests. They're pretty low-maintenance.
2023-02-09Parse "-Z instrument-xray" codegen optionOleksii Lozovskyi-0/+9
Recognize all bells and whistles that LLVM's XRay pass is capable of. The always/never settings are a bit dumb without attributes but they're still there. The default instruction count is chosen by the compiler, not LLVM pass. We'll do it later.
2023-02-09Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.Nicholas Nethercote-1/+41
To temporarily allow a `str` field in a packed struct using `derive`, along with `[u8]`.
2023-02-08Do not assemble supertraits for trait aliasesAlan Egerton-0/+21
2023-02-08add (currently ICEing) testlcnr-0/+43
2023-02-08Do not eagerly recover for bad impl-trait in macrosMichael Goulet-0/+32
2023-02-08Rollup merge of #107777 - ↵Matthias Krüger-3/+24
compiler-errors:derive_const-actually-derive-const, r=fee1-dead Make `derive_const` derive properly const-if-const impls Fixes #107774 Fixes #107666 Also fixes rendering of const-if-const bounds in pretty printing. r? ```@oli-obk``` or ```@fee1-dead```
2023-02-08Rollup merge of #107779 - compiler-errors:issue-107775, r=jackh726Matthias Krüger-0/+56
Remove astconv usage in diagnostic Fixes #107775 Location of the test sucks, I know, but I needed to put it somewhere :sweat: The issue here is that the root cause of the issue has nothing to do with what's being tested, so I couldn't really give it a better name. Oh well.
2023-02-08Rollup merge of #107771 - estebank:ice-msg, r=compiler-errorsMatthias Krüger-13/+8
Tweak ICE message Modify main message to be more conversational and emit one fewer note.
2023-02-08Rollup merge of #107770 - notriddle:notriddle/br2nl, r=GuillaumeGomezMatthias Krüger-22/+47
rustdoc: use a newline instead of `<br>` to format code headers Since these elements now use `white-space: pre-wrap` since #107615, it's fine to use newlines for formatting, which is smaller and a bit less complicated.
2023-02-08Rollup merge of #107769 - compiler-errors:pointer-like, r=eholkMatthias Krüger-53/+55
Rename `PointerSized` to `PointerLike` The old name was unnecessarily vague. This PR renames a nightly language feature that I added, so I don't think it needs any additional approval, though anyone can feel free to speak up if you dislike the rename. It's still unsatisfying that we don't the user which of {size, alignment} is wrong, but this trait really is just a stepping stone for a more generalized mechanism to create `dyn*`, just meant for nightly testing, so I don't think it really deserves additional diagnostic machinery for now. Fixes #107696, cc ``@RalfJung`` r? ``@eholk``
2023-02-08Auto merge of #107688 - lukas-code:projection-with-lifetime, r=jackh726bors-1/+65
ReErased regions are local fix https://github.com/rust-lang/rust/issues/107678 fix https://github.com/rust-lang/rust/issues/107684 fix https://github.com/rust-lang/rust/issues/107686 fix https://github.com/rust-lang/rust/issues/107691 fix https://github.com/rust-lang/rust/issues/107730
2023-02-07Remove astconv usage in diagnosticMichael Goulet-0/+56
2023-02-07Add ~const bounds trait bounds when using derive_constMichael Goulet-0/+13
2023-02-07Expand const-if-const trait bounds correctlyMichael Goulet-3/+11
2023-02-07Tweak ICE messageEsteban Küber-13/+8
Modify main message to be more conversational and emit one fewer note.
2023-02-07Rename PointerSized to PointerLikeMichael Goulet-53/+55
2023-02-07rustdoc: use a newline instead of `<br>` to format code headersMichael Howell-22/+47
Since these elements now use `white-space: pre-wrap` since 784665d4ce59c5239791f1f96fa2137e47ca1817, it's fine to use newlines for formatting, which is smaller and a bit less complicated.
2023-02-07Auto merge of #107767 - matthiaskrgr:rollup-9m1qfso, r=matthiaskrgrbors-16/+344
Rollup of 8 pull requests Successful merges: - #100599 (Add compiler error E0523 long description and test) - #107471 (rustdoc: do not include empty default-settings tag in HTML) - #107555 (Modify existing bounds if they exist) - #107662 (Turn projections into copies in CopyProp.) - #107695 (Add test for Future inflating arg size to 3x ) - #107700 (Run the tools builder on all PRs) - #107706 (Mark 'atomic_mut_ptr' methods const) - #107709 (Fix problem noticed in PR106859 with char -> u8 suggestion) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-07Rollup merge of #107709 - tialaramex:master, r=compiler-errorsMatthias Krüger-2/+55
Fix problem noticed in PR106859 with char -> u8 suggestion HN reader `@ayosec` noticed that my #106859 a few weeks back, malfunctions if you have a Unicode escape, the code suggested b'\u{0}' if you tried to use '\u{0}' where a byte should be, when of course b'\u{0}' is not a byte literal, regardless of the codepoint you can't write Unicode escapes in a byte literal at all. My proposed fix here just checks that the "character" you wrote is fewer than 5 bytes, thus allowing \x7F and similar escapes but conveniently forbidding even the smallest Unicode escape \u{0} before offering the suggestion as before. I have provided an updated test which includes examples which do and don't work because of this additional rule.
2023-02-07Rollup merge of #107695 - Swatinem:futcallx3, r=compiler-errorsMatthias Krüger-0/+96
Add test for Future inflating arg size to 3x This adds one more test that should track improvements to generator layout, like https://github.com/rust-lang/rust/issues/62958 and https://github.com/rust-lang/rust/issues/62575. In particular, this test highlights suboptimal layout, as the storage for the argument future is not being reused across its usage as `upvar`, `local` and `awaitee` (being polled to completion). This is on top of https://github.com/rust-lang/rust/pull/107692 (as those would conflict with each other) It is a minimal repro for code mentioned in https://github.com/moka-rs/moka/issues/212#issuecomment-1416914616 (CC `@tatsuya6502)`
2023-02-07Rollup merge of #107662 - cjgillot:copy-projection, r=oli-obkMatthias Krüger-1/+66
Turn projections into copies in CopyProp. The current implementation can leave behind projections that are moved out several times. This PR widens the check to turn such moves into copies: a move out of a projection of a copy is equivalent to a copy of the original projection.
2023-02-07Rollup merge of #107555 - edward-shen:edward-shen/dup-trait-suggestion, ↵Matthias Krüger-13/+100
r=compiler-errors Modify existing bounds if they exist Fixes #107335. This implementation is kinda gross but I don't really see a better way to do it. This primarily does two things: Modifies `suggest_constraining_type_param` to accept a new parameter that indicates a span to be replaced instead of added, if presented, and limit the additive suggestions to either suggest a new bound on an existing bound (see newly added unit test) or add the generics argument if a generics argument wasn't found. The former change is required to retain the capability to add an entirely new bounds if it was entirely omitted. r? ``@compiler-errors``
2023-02-07Rollup merge of #100599 - MatthewPeterKelly:add-E0523-description-and-test, ↵Matthias Krüger-0/+27
r=compiler-errors,GuillaumeGomez Add compiler error E0523 long description and test This PR is one step towards addressing: https://github.com/rust-lang/rust/issues/61137.
2023-02-07Replace a command line flag with an env var to allow tools to initialize the ↵Oli Scherer-3/+2
tracing loggers at their own discretion