about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-10-18Rollup merge of #103168 - Amanieu:stable_asm_sym, r=davidtwcoYuki Okushi-71/+36
Stabilize asm_sym Tracking issue #93333 Reference PR: https://github.com/rust-lang/reference/pull/1270
2022-10-18Rollup merge of #103142 - fmease:fix-103052, r=oli-obkYuki Okushi-3/+63
Make diagnostic for unsatisfied `Termination` bounds more precise Don't blindly emit a diagnostic claiming that “*`main` has an invalid return type*” if we encounter a type that should but doesn't implement `std::process::Termination` and isn't actually the return type of the program entry `main`. Fixes #103052. ``@rustbot`` label A-diagnostics T-compiler T-libs r? diagnostics
2022-10-18Rollup merge of #103023 - andrewpollack:i-fuchsia-finals, r=tmandryYuki Okushi-2/+9
Adding `fuchsia-ignore` and `needs-unwind` to compiler test cases Final tests covering missing privileges r? ``@tmandry`` cc. ``@djkoloski``
2022-10-18handle core dumps output in qemu user modePietro Albini-4/+18
In addition to the whole-system emulation/virtualization, QEMU also supports user-mode emulation, where the emulation happens as a normal process inside the parent system. This allows running most tests by simply spawning remote-test-server inside user-mode emulation. Unfortunately, QEMU always writes its own message in addition to the system one when a core dump happens, which breaks a few tests which match on the exact output of the system. This PR changes those tests to strip the (possible) QEMU output before checking if the output is expected.
2022-10-18Fix `TyKind::is_simple_path`.Nicholas Nethercote-0/+44
PR #98758 introduced code to avoid redundant assertions in derived code like this: ``` let _: ::core::clone::AssertParamIsClone<u32>; let _: ::core::clone::AssertParamIsClone<u32>; ``` But the predicate `is_simple_path` introduced as part of this failed to account for generic arguments. Therefore the deriving code erroneously considers types like `Option<bool>` and `Option<f32>` to be the same. This commit fixes `is_simple_path`. Fixes #103157.
2022-10-18Tweak `deriving-all-codegen.rs`.Nicholas Nethercote-3/+5
To include some `Option<>` fields of different types in a single enum. The test output is currently buggy, but the next commit will fix that.
2022-10-17Stabilize asm_symAmanieu d'Antras-71/+36
2022-10-17Rollup merge of #102945 - compiler-errors:placeholder-region-outlives, r=lcnrMatthias Krüger-0/+61
Do not register placeholder `RegionOutlives` obligations when `considering_regions` is false **NOTE:** I'm kinda just putting this up for discussion. I'm not certain this is correct...? This was introduced in [`608625d`](https://github.com/rust-lang/rust/commit/608625dae95cde00e4570eb6c2d63b2244bbf34c#diff-6e54b18681342ec725d75591dbf384ad08cd73df29db00485fe51b4e90f76ff7R361). Interestingly, we only check `data.has_placeholders()` for `RegionOutlives`, and not for `TypeOutlives`... why? For the record, that different treatment between `RegionOutlives` and `TypeOutlives` is why the fix "The compiling succeeds when all `'a : 'b` are replaced with `&'a () : 'b`" in #100689 _"works"_, but it seems like an implementation detail considering this. Also, why do we care about placeholder regions being registered if `considering_regions` is false? It doesn't seem to affect any UI tests, for example. r? `@lcnr` Fixes #102899 Fixes #100689
2022-10-17Rollup merge of #102454 - chenyukang:fix-102396-missing-parentheses, r=lcnrMatthias Krüger-10/+267
Suggest parentheses for possible range method calling Fixes #102396
2022-10-17Make diagnostic for unsatisfied Termination bounds more preciseLeón Orell Valerian Liehr-3/+63
2022-10-17`order_dependent_trait_objects` to `ReportNow`lcnr-0/+112
2022-10-17Auto merge of #103116 - TaKO8Ki:fix-103053, r=lcnrbors-0/+32
Fix `own_substs` ICE Fixes #103053
2022-10-17trivial fix for comments feedbackyukang-10/+10
2022-10-16Auto merge of #103125 - matthiaskrgr:rollup-82xttcl, r=matthiaskrgrbors-24/+59
Rollup of 5 pull requests Successful merges: - #103087 (Documentation BTreeMap::append's behavior for already existing keys) - #103089 (Mark derived StructuralEq as automatically derived.) - #103102 (Clarify the possible return values of `len_utf16`) - #103109 (PhantomData: inline a macro that is used only once) - #103120 (rustdoc: Do not expect `doc(primitive)` modules to always exist) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-16Don't consider `Let` exprs terminating scopesNathan Whitaker-6/+18
2022-10-16Rollup merge of #103089 - cjgillot:automatic-structural-eq, r=oli-obkMatthias Krüger-24/+59
Mark derived StructuralEq as automatically derived. Fixes https://github.com/rust-lang/rust/issues/69952 Drive-by: use correct spans for generic params.
2022-10-16Auto merge of #102026 - Bryanskiy:resolve_update, r=petrochenkovbors-40/+33
Populate effective visibilities in 'rustc_resolve' Next part of RFC https://github.com/rust-lang/rust/issues/48054. previous: https://github.com/rust-lang/rust/pull/101713 `@rustbot` author r? `@petrochenkov`
2022-10-17Add tests for autoderef on block tailbogon-right-0/+149
2022-10-16Populate effective visibilities in 'rustc_resolve'Bryanskiy-40/+33
2022-10-16Rollup merge of #102857 - saethlin:derived-enum-hash-test, r=Mark-SimulacrumMatthias Krüger-0/+20
Add a regression test for #39137 The problem in the issue has been fixed in the meantime, so since this adds a regression test I think this closes https://github.com/rust-lang/rust/issues/39137
2022-10-16fix `own_substs` ICETakayuki Maeda-0/+32
2022-10-16Auto merge of #102334 - compiler-errors:rpitit-substs-issue, r=cjgillotbors-0/+33
Fix subst issues with return-position `impl Trait` in trait 1. Fix an issue where we were rebase impl substs onto trait method substs, instead of trait substs 2. Fix an issue where early-bound regions aren't being mapped correctly for RPITIT hidden types Fixes #102301 Fixes #102310 Fixes #102334 Fixes #102918
2022-10-16remove redundant Send impls for referencesRalf Jung-1/+1
also move them next to the trait they are implementing
2022-10-16Point to shadowed name when it exists.Camille GILLOT-4/+11
2022-10-16Account for hygiene when suggesting typos.Camille GILLOT-14/+22
2022-10-16Auto merge of #102080 - yanchen4791:issue-99824-fix, r=cjgillotbors-8/+18
Fix missing explanation of where the borrowed reference is used when the same borrow occurs multiple times due to loop iterations Fix #99824. Problem of the issue: If a borrow occurs in a loop, the borrowed reference could be invalidated at the same place at next iteration of the loop. When this happens, the point where the borrow occurs is the same as the intervening point that might invalidate the reference in the loop. This causes a problem for the current code finding the point where the resulting reference is used, so that the explanation of the cause will be missing. As the second point of "explain all errors in terms of three points" (see [leveraging intuition framing errors in terms of points"](https://rust-lang.github.io/rfcs/2094-nll.html#leveraging-intuition-framing-errors-in-terms-of-points), this explanation is very helpful for user to understand the error. In the current implementation, the searching region for finding the location where the borrowed reference is used is limited to between the place where the borrow occurs and the place where the reference is invalidated. If those two places happen to be the same, which indicates that the borrow and invalidation occur at the same place in a loop, the search will fail. One solution to the problem is when these two places are the same, find the terminator of the loop, and then use the location of the loop terminator instead of the location of the borrow for the region to find the place where the borrowed reference is used.
2022-10-15Add testMichael Goulet-0/+15
2022-10-15Fix subst issues with RPITITMichael Goulet-0/+18
2022-10-15Mark derived StructuralEq as automatically derived.Camille GILLOT-24/+59
2022-10-15Auto merge of #103083 - Dylan-DPC:rollup-97cvwdv, r=Dylan-DPCbors-0/+228
Rollup of 6 pull requests Successful merges: - #102773 (Use semaphores for thread parking on Apple platforms) - #102884 (resolve: Some cleanup, asserts and tests for lifetime ribs) - #102954 (Add missing checks for `doc(cfg_hide(...))`) - #102998 (Drop temporaries created in a condition, even if it's a let chain) - #103003 (Fix `suggest_floating_point_literal` ICE) - #103041 (Update cargo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-15Rollup merge of #103003 - TaKO8Ki:fix-102989, r=compiler-errorsDylan DPC-0/+75
Fix `suggest_floating_point_literal` ICE Fixes #102989
2022-10-15Rollup merge of #102998 - nathanwhit:let-chains-drop-order, r=eholkDylan DPC-0/+64
Drop temporaries created in a condition, even if it's a let chain Fixes #100513. During the lowering from AST to HIR we wrap expressions acting as conditions in a `DropTemps` expression so that any temporaries created in the condition are dropped after the condition is executed. Effectively this means we transform ```rust if Some(1).is_some() { .. } ``` into (roughly) ```rust if { let _t = Some(1).is_some(); _t } { .. } ``` so that if we create any temporaries, they're lifted into the new scope surrounding the condition, so for example something along the lines of ```rust if { let temp = Some(1); let _t = temp.is_some(); _t }. ``` Before this PR, if the condition contained any let expressions we would not introduce that new scope, instead leaving the condition alone. This meant that in a let-chain like ```rust if get_drop("first").is_some() && let None = get_drop("last") { println!("second"); } else { .. } ``` the temporary created for `get_drop("first")` would be lifted into the _surrounding block_, which caused it to be dropped after the execution of the entire `if` expression. After this PR, we wrap everything but the `let` expression in terminating scopes. The upside to this solution is that it's minimally invasive, but the downside is that in the worst case, an expression with `let` exprs interspersed like ```rust if get_drop("first").is_some() && let Some(_a) = get_drop("fifth") && get_drop("second").is_some() && let Some(_b) = get_drop("fourth") { .. } ``` gets _multiple_ new scopes, roughly ```rust if { let _t = get_drop("first").is_some(); _t } && let Some(_a) = get_drop("fifth") && { let _t = get_drop("second").is_some(); _t } && let Some(_b) = get_drop("fourth") { .. } ``` so instead of all of the temporaries being dropped at the end of the entire condition, they will be dropped right after they're evaluated (before the subsequent `let` expr). So while I'd say the drop behavior around let-chains is _less_ surprising after this PR, it still might not exactly match what people might expect. For tests, I've just extended the drop order tests added in #100526. I'm not sure if that's the best way to go about it, though, so suggestions are welcome.
2022-10-15Rollup merge of #102884 - petrochenkov:liferib, r=cjgillotDylan DPC-0/+89
resolve: Some cleanup, asserts and tests for lifetime ribs Follow up to https://github.com/rust-lang/rust/pull/98279 and friends. r? ``@cjgillot``
2022-10-15Auto merge of #101832 - compiler-errors:dyn-star-plus, r=eholkbors-5/+81
Make `dyn*` casts into a coercion, allow `dyn*` upcasting I know that `dyn*` is likely not going to be a feature exposed to surface Rust, but this makes it slightly more ergonomic to write tests for these types anyways. ... and this was just fun to implement anyways. 1. Make `dyn*` into a coercion instead of a cast 2. Enable `dyn*` upcasting since we basically get it for free 3. Simplify some of the cast checking code since we're using the coercion path now r? `@eholk` but feel free to reassign cc `@nikomatsakis` and `@tmandry` who might care about making `dyn*` casts into a coercion
2022-10-15Auto merge of #99292 - Aaron1011:stability-use-tree, r=cjgillotbors-3/+38
Correctly handle path stability for 'use tree' items PR #95956 started checking the stability of path segments. However, this was not applied to 'use tree' items (e.g. 'use some::path::{ItemOne, ItemTwo}') due to the way that we desugar these items in HIR lowering. This PR modifies 'use tree' lowering to preserve resolution information, which is needed by stability checking.
2022-10-15remove no_core featureTakayuki Maeda-28/+12
2022-10-14Auto merge of #102783 - RalfJung:tls, r=thomccbors-2/+2
sync thread_local key conditions exactly with what the macro uses This makes the `cfg` in `mod.rs` syntactically the same as those in `local.rs`. I don't think this should actually change anything, but seems better to be consistent? I looked into this due to https://github.com/rust-lang/rust/issues/102549, but this PR would make it *less* likely that `__OsLocalKeyInner` is going to get provided, so this cannot help with that issue. r? `@thomcc`
2022-10-14Rollup merge of #103031 - est31:match_guard_irrefutable_let, r=oli-obkDylan DPC-14/+23
Suppress irrefutable let patterns lint for prefixes in match guards In match guards, irrefutable prefixes might use the bindings created by the match pattern. Ideally, we check for this, but we can do the next best thing and just not lint for irrefutable prefixes in match guards. Fixes #98361
2022-10-14Rollup merge of #103018 - Rageking8:more-dupe-word-typos, r=TaKO8KiDylan DPC-6/+4
More dupe word typos I only picked those changes (from the regex search) that I am pretty certain doesn't change meaning and is just a typo fix. Do correct me if any fix is undesirable and I can revert those. Thanks.
2022-10-14Rollup merge of #102938 - c410-f3r:here-we-go-again, r=petrochenkovDylan DPC-28/+0
Move some tests to more reasonable directories r? ``@petrochenkov``
2022-10-14Rollup merge of #102856 - cjgillot:impl-single-check, r=petrochenkovDylan DPC-29/+30
Only test duplicate inherent impl items in a single place Based on https://github.com/rust-lang/rust/pull/100387 r? ``@petrochenkov``
2022-10-14Require lifetime bounds for opaque types in order to allow hidden types to ↵Oli Scherer-25/+65
capture said lifetimes
2022-10-14wasm-ignore some tests that access thread-local private detailsRalf Jung-2/+2
2022-10-14Address nits, add test for implicit dyn-star coercion without feature gateMichael Goulet-0/+42
2022-10-14Add testMichael Goulet-0/+42
2022-10-14more dupe word typosRageking8-6/+4
2022-10-14Allow dyn* upcastingMichael Goulet-0/+33
2022-10-14normalize stderrTakayuki Maeda-9/+10
2022-10-14check if the self type is `ty::Float` before getting second substsTakayuki Maeda-0/+90
2022-10-14Make dyn* cast into a coercionMichael Goulet-6/+7