summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-04-16rustdoc: Correctly merge import's and its target's docs in one more caseVadim Petrochenkov-0/+16
2023-04-16Don't collect return-position impl traits for documentationMichael Goulet-0/+15
2023-04-16Move a const-prop-lint specific hack from mir interpret to const-prop-lint ↵Oli Scherer-0/+51
and make it fallible
2023-04-16Revert "Don't recover lifetimes/labels containing emojis as character literals"Michael Goulet-135/+4
Reverts PR #108031 Fixes (doesnt close until beta backported) #109746 This reverts commit e3f9db5fc319c6d8eee5d47d216ea6a426070c41. This reverts commit 98b82aedba3f3f581e89df54352914b27f42c6f7. This reverts commit 380fa264132ad481e73cbbf0f3a0feefd99a1d78.
2023-03-31Add regression testOli Scherer-0/+8
2023-03-11tweak debug output and bless testsAli MJ Al-Nasrawy-16/+16
2023-03-11ignore bivariant regions in opaque typesAli MJ Al-Nasrawy-20/+2
2023-03-11smarter algorithm for finding an equal regionAli MJ Al-Nasrawy-14/+2
Smarter and simpler!
2023-03-11promote subject even if it has unnamed regionsAli MJ Al-Nasrawy-33/+4
Don't require a region to have an `external_name` in order to be promoted.
2023-03-11add known-bug testsAli MJ Al-Nasrawy-0/+137
2023-03-11fix: evaluate with wrong obligation stackyifei-0/+45
2023-03-04Rollup merge of #108656 - GuillaumeGomez:rustdoc-search-unclosed-generic, ↵Dylan DPC-0/+10
r=notriddle Rustdoc search: Emit an error for unclosed generic Now, search like `a<` will error as it should (and as written in the eBNF). r? `@notriddle`
2023-03-04Rollup merge of #108298 - TaKO8Ki:fix-104440, r=cjgillotDylan DPC-0/+13
Fix ICE: check if snippet is `)` Fixes #107705
2023-03-03Auto merge of #108709 - matthiaskrgr:rollup-j2tjbyx, r=matthiaskrgrbors-28/+82
Rollup of 8 pull requests Successful merges: - #104549 (add -Zexport-executable-symbols to unstable book) - #108292 (Label opaque type for 'captures lifetime' error message) - #108540 (Add `Atomic*::from_ptr`) - #108634 (Add link to component dashboard) - #108647 (Remove dead pgo.sh file) - #108678 (Use `Option::as_slice` where applicable) - #108681 (Improve comments in `needs_process_obligation`.) - #108688 (Match unmatched backticks in library/) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-03Add test for unclosed genericGuillaume Gomez-0/+10
2023-03-03Rollup merge of #108292 - compiler-errors:opaque-captures-where, r=oli-obkMatthias Krüger-28/+82
Label opaque type for 'captures lifetime' error message Providing more information may help make this somewhat opaque (lol) error message a bit clearer.
2023-03-03Rollup merge of #108685 - est31:backticks_matchmaking, r=petrochenkovMatthias Krüger-4/+4
Match unmatched backticks in compiler/ Found with GNU grep: ``` grep -rEn '^(([^`]*`){2})*[^`]*`[^`]*$' compiler/ | rg -v '\s*[//]?.{1,2}```' ```
2023-03-03Rollup merge of #108674 - flip1995:clippy_backport, r=ManishearthMatthias Krüger-0/+40
Clippy Fix array-size-threshold config deserialization error Complementary PR to https://github.com/rust-lang/rust/pull/108673 in order to also get this into the **next** beta. r? ``@Mark-Simulacrum``
2023-03-03Rollup merge of #108667 - compiler-errors:issue-108664, r=estebankMatthias Krüger-0/+26
Fix another ICE in `point_at_expr_source_of_inferred_type` Types coming from method probes must only be investigated *structurally*, since they often contain escaping infer variables from generalization and autoderef. We already have a hack in this PR that erases variables from types, so just use that. Fixes #108664 The note attached to this error is pretty bad: ``` here the type of `primes` is inferred to be `[_]` ``` But that's unrelated to the PR. --- Side-note: This is a pretty easy to trigger beta regression, so I've nominated it. Alternatively, I'm slightly inclined to remove this code altogether until it can be reformulated to be more accurate and less ICEy.
2023-03-03Rollup merge of #108553 - compiler-errors:non-lt-late-bound-in-anon-ct, ↵Matthias Krüger-0/+38
r=petrochenkov Deny capturing late-bound non-lifetime param in anon const Introduce a new AnonConstBoundary so we can detect when we capture a late-bound non-lifetime param with `non_lifetime_binders` enabled. In the future, we could technically do something like introduce an early-bound parameter on the anon const, and stick the late-bound param in its substs (kinda like how we turn late-bound lifetimes in opaques into early-bound ones). But for now, just deny it so we don't ICE. Fixes #108191
2023-03-03Match end user facing unmatched backticks in compiler/est31-4/+4
2023-03-03check if snippet is `)`Takayuki Maeda-0/+13
2023-03-03Label opaque type for 'captures lifetime' error messageMichael Goulet-28/+82
2023-03-02Rollup merge of #108672 - spastorino:new-rpitit-impl-side, r=compiler-errorsMatthias Krüger-0/+11
Feed queries on impl side for RPITITs when using lower_impl_trait_in_trait_to_assoc_ty I've added a test for traits that were already working and what I think is probably the last bit of infrastructure work needed. In following PRs I'm going to start adding things TDD style, tests and code that make it work. r? `@compiler-errors`
2023-03-02Rollup merge of #108624 - Nilstrieb:move-it-up, r=WaffleLapkinMatthias Krüger-9/+9
Make `ExprKind` the first field in `thir::Expr` This makes its `Debug` impl print it first which is useful, as it's the most important part when looking at an expr.
2023-03-02Rollup merge of #108584 - GuillaumeGomez:rustdoc-search-background, r=notriddleMatthias Krüger-2/+41
Put backtick content from rustdoc search errors into a <code> elements Some screenshots of the result: ![Screenshot from 2023-02-28 22-37-09](https://user-images.githubusercontent.com/3050060/221990290-fa84f1cf-5a64-4ce5-8433-ee36cedf4c00.png) ![Screenshot from 2023-02-28 22-36-59](https://user-images.githubusercontent.com/3050060/221990298-f8177eeb-894b-4fce-a6fc-06d17c8b7ca2.png) ![Screenshot from 2023-02-28 22-36-51](https://user-images.githubusercontent.com/3050060/221990301-41bffd64-d041-41f1-995a-983925b1fbb1.png) You can test it [here](https://rustdoc.crud.net/imperio/rustdoc-search-background/foo/index.html?search=%22). r? ```@notriddle```
2023-03-02Rollup merge of #108573 - kornelski:runtimeenvs, r=WaffleLapkinMatthias Krüger-10/+13
Explain compile-time vs run-time difference in env!() error message This PR is clarifying error message of `env!()` based on this user question: https://users.rust-lang.org/t/environment-variable-out-dir-is-undefined/90067 It makes it clear that `env!()` is for env variables defined at compile-time. There's special-case help text for common Cargo build script variables. I've also rearranged the code to avoid allocating error message on the happy path when the env var is defined.
2023-03-02Rollup merge of #108557 - Nathan-Fenner:nathanf/adjust-error-span-fix-Some, ↵Matthias Krüger-5/+446
r=WaffleLapkin Point error span at Some constructor argument when trait resolution fails This is a follow up to #108254 and #106477 which extends error span refinement to handle a case which I mistakenly believed was handled in #106477. The goal is to refine the error span depicted below: ```rs trait Fancy {} impl <T> Fancy for Option<T> where T: Iterator {} fn want_fancy<F>(f: F) where F: Fancy {} fn example() { want_fancy(Some(5)); // (BEFORE) ^^^^^^^ `{integer}` is not an iterator // (AFTER) ^ `{integer}` is not an iterator } ``` I had used a (slightly more complex) example as an illustrative example in #108254 , but hadn't actually turned it into a test, because I had (incorrectly) believed at the time it was covered by existing behavior. It turns out that `Some` is slightly "special" in that it resolves differently from the other `enum` constructors I had tried, and therefore this test was actually broken. I've now updated the tests to include this example, and fixed the code to correctly resolve the `Some` constructor so that the span of the error is reduced.
2023-03-02Fix array-size-threshold config deserialization errorAlex Macleod-0/+40
2023-03-02Add simple trait testSantiago Pastorino-0/+11
2023-03-02Fix another ICE in point_at_expr_source_of_inferred_typeMichael Goulet-0/+26
2023-03-02Make `ExprKind` the first field in `thir::Expr`Nilstrieb-9/+9
This makes its `Debug` impl print it first which is useful, as it's the most important part when looking at an expr.
2023-03-02Auto merge of #108654 - LeSeulArtichaut:revert-99767, r=compiler-errorsbors-58/+119
Revert stabilization of `#![feature(target_feature_11)]` This reverts #99767 due to the presence of bugs #108645 and #108646. cc `@joshtriplett` cc tracking issue #69098 r? `@ghost`
2023-03-02Auto merge of #108640 - matthiaskrgr:rollup-rii4t5t, r=matthiaskrgrbors-9/+147
Rollup of 5 pull requests Successful merges: - #108516 (Restrict `#[rustc_box]` to `Box::new` calls) - #108575 (Erase **all** regions when probing for associated types on ambiguity in astconv) - #108585 (Run compiler test suite in parallel on Fuchsia) - #108606 (Add test case for mismatched open/close delims) - #108609 (Highlight whole expression for E0599) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-02Revert "Stabilize `#![feature(target_feature_11)]`"Léo Lanteri Thauvin-58/+119
This reverts commit b379d216eefaba083a0627b1724d73f99d4bdf5c.
2023-03-02Add GUI test for rustdoc search errors backgroundGuillaume Gomez-2/+41
2023-03-02Rollup merge of #108609 - clubby789:e0599-highlight, r=estebankMatthias Krüger-9/+21
Highlight whole expression for E0599 Fixes #108603 This adds a secondary label to highlight the whole expression leading to the error. It also prevents empty labels being recognised as 'unexpected' by compiletest - otherwise, tests with NOTE annotations would pick up empty labels. `@rustbot` label +A-diagnostics
2023-03-02Rollup merge of #108606 - chenyukang:yukang/fix-104367, r=compiler-errorsMatthias Krüger-0/+57
Add test case for mismatched open/close delims Fixes #104367 Fixes #105209 After landing https://github.com/rust-lang/rust/pull/108297, these issues are resolved.
2023-03-02Rollup merge of #108575 - compiler-errors:erase, r=estebankMatthias Krüger-0/+17
Erase **all** regions when probing for associated types on ambiguity in astconv Fixes #108562
2023-03-02Rollup merge of #108516 - clubby789:rustc-box-restrict, r=compiler-errorsMatthias Krüger-0/+52
Restrict `#[rustc_box]` to `Box::new` calls Currently, `#[rustc_box]` can be applied to any call expression with a single argument. This PR only allows it to be applied to calls to `Box::new`
2023-03-02Auto merge of #107879 - icedrocket:update-llvm, r=cuviperbors-0/+17
Update LLVM submodule Fixes #105626
2023-03-02Restrict `#[rustc_box]` to `Box::new` callsclubby789-0/+52
2023-03-02Auto merge of #106673 - flba-eb:add_qnx_nto_stdlib, r=workingjubileebors-2/+15
Add support for QNX Neutrino to standard library This change: - adds standard library support for QNX Neutrino (7.1). - upgrades `libc` to version `0.2.139` which supports QNX Neutrino `@gh-tr` ⚠️ Backtraces on QNX require https://github.com/rust-lang/backtrace-rs/pull/507 which is not yet merged! (But everything else works without these changes) ⚠️ Tested mainly with a x86_64 virtual machine (see qnx-nto.md) and partially with an aarch64 hardware (some tests fail due to constrained resources).
2023-03-01Auto merge of #108483 - scottmcm:unify-bytewise-eq-traits, r=the8472bors-2/+84
Merge two different equality specialization traits in `core` Arrays and slices each had their own version of this, without a matching set of `impl`s. Merge them into one (still-`pub(crate)`) `cmp::BytewiseEq` trait, so we can stop doing all these things twice. And that means that the `[T]::eq` → `memcmp` specialization picks up a bunch of types where that previously only worked for arrays, so examples like <https://rust.godbolt.org/z/KjsG8MGGT> will use it now instead of emitting loops. r? the8472
2023-03-01Merge two different equality specialization traits in `core`Scott McMurray-2/+84
2023-03-01Auto merge of #108620 - Dylan-DPC:rollup-o5c4evy, r=Dylan-DPCbors-41/+410
Rollup of 7 pull requests Successful merges: - #108143 (rustdoc: search by macro when query ends with `!`) - #108394 (Make `x doc --open` work on every book) - #108427 (Recover from for-else and while-else) - #108462 (Fix `VecDeque::append` capacity overflow for ZSTs) - #108568 (Make associated_item_def_ids for traits use an unstable option to also return associated types for RPITITs) - #108604 (Add regression test for #107280) - #108605 (Add regression test for #105821) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-01Rollup merge of #108605 - JohnTitor:issue-105821, r=compiler-errorsDylan DPC-0/+23
Add regression test for #105821 Closes #105821 r? compiler-errors
2023-03-01Rollup merge of #108604 - JohnTitor:issue-107280, r=compiler-errorsDylan DPC-0/+97
Add regression test for #107280 Closes #107280 r? compiler-errors
2023-03-01Rollup merge of #108568 - spastorino:new-rpitit-flag, r=compiler-errorsDylan DPC-0/+1
Make associated_item_def_ids for traits use an unstable option to also return associated types for RPITITs r? `@compiler-errors`
2023-03-01Rollup merge of #108427 - y21:for-else-diagnostic, r=compiler-errorsDylan DPC-22/+181
Recover from for-else and while-else This recovers from attempts at writing for-else or while-else loops, which might help users coming from e.g. Python. ```rs for _ in 0..0 { // ... } else { // ... } ``` Combined with trying to store it in a let binding, the current diagnostic can be a bit confusing. It mentions let-else and suggests wrapping the loop in parentheses, which the user probably doesn't want. let-else doesn't make sense for `for` and `while` loops, as they are of type `()` (which already is an irrefutable pattern and doesn't need let-else). <details> <summary>Current diagnostic</summary> ```rs error: right curly brace `}` before `else` in a `let...else` statement not allowed --> src/main.rs:4:5 | 4 | } else { | ^ | help: wrap the expression in parentheses | 2 ~ let _x = (for _ in 0..0 { 3 | 4 ~ }) else { | ``` </details> Some questions: - Can the wording for the error message be improved? Would "for...else loops are not allowed" fit better? - Should we be more "conservative" in case we want to support this in the future (i.e. say "for...else loops are **currently** not allowed/supported")? - Is there a better way than storing a `&'static str` for the loop type? It is used for substituting the placeholder in the locale file (since it can emit either `for...else` or `while...else`). Maybe there is an enum I could use that I couldn't find