about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-10-17Auto merge of #103116 - TaKO8Ki:fix-103053, r=lcnrbors-0/+32
Fix `own_substs` ICE Fixes #103053
2022-10-17Auto merge of #103096 - petrochenkov:indresdoc, r=cjgillotbors-0/+12
resolve: Shadow erroneous glob imports with erroneous single imports If such shadowing doesn't happen we end up in a weird state that may cause ICEs. (In non-erroneous cases single imports always shadow glob imports too.) Fixes https://github.com/rust-lang/rust/issues/100047 Fixes https://github.com/rust-lang/rust/issues/100241
2022-10-16Auto merge of #103125 - matthiaskrgr:rollup-82xttcl, r=matthiaskrgrbors-24/+74
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-16Rollup merge of #103120 - petrochenkov:docice, r=GuillaumeGomezMatthias Krüger-0/+15
rustdoc: Do not expect `doc(primitive)` modules to always exist The second commit fixes one more ICE by processing impls in crates loaded through the "load all `--extern`s" hack. Fixes https://github.com/rust-lang/rust/issues/96288 Fixes https://github.com/rust-lang/rust/issues/103028
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-16Populate effective visibilities in 'rustc_resolve'Bryanskiy-40/+33
2022-10-16rustdoc: Do not expect `doc(primitive)` modules to always existVadim Petrochenkov-0/+15
2022-10-16Rollup merge of #103115 - GuillaumeGomez:clean-up-anchors-gui-test, r=notriddleMatthias Krüger-147/+100
Clean up anchors.goml rustdoc GUI test r? ``@notriddle``
2022-10-16Rollup merge of #103060 - notriddle:notridddle/help-page, r=GuillaumeGomezMatthias Krüger-11/+55
rustdoc: make the help button a link to a page This allows you to open the help section in a new browser tab, which is a pretty reasonable thing to want for a documentation page. Preview: http://notriddle.com/notriddle-rustdoc-demos/help-page/std/index.html
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-16Clean up anchors.goml rustdoc GUI testGuillaume Gomez-147/+100
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-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-16Rollup merge of #103088 - GuillaumeGomez:fix-settings-page, r=notriddleYuki Okushi-2/+9
Fix settings page Thanks to https://github.com/rust-lang/rust/pull/103060, I discovered that the settings page was badly rendered. This PR fixes it. Before: ![Screenshot from 2022-10-15 16-02-41](https://user-images.githubusercontent.com/3050060/195990668-42e0b16b-3146-4864-b822-6f6a80fb77a5.png) After: ![Screenshot from 2022-10-15 16-02-31](https://user-images.githubusercontent.com/3050060/195990664-20f967df-8989-4336-bca9-be52baab8e81.png) r? ```@notriddle```
2022-10-16Rollup merge of #103080 - ohno418:fix-hir-pretty-print-lifetimes, r=cjgillotYuki Okushi-0/+36
pretty: fix to print some lifetimes on HIR pretty-print HIR pretty-printer doesn't seem to print some lifetimes in types. This PR fixes that. Closes https://github.com/rust-lang/rust/issues/85089
2022-10-16resolve: Shadow erroneous glob imports with erroneous single importsVadim Petrochenkov-0/+12
2022-10-15rustdoc: add test cases for links inside the help popoverMichael Howell-4/+24
2022-10-15rustdoc: make the help button a link to a pageMichael Howell-8/+32
This allows you to open the help section in a new browser tab, which is a pretty reasonable thing to want for a documentation page.
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-15pretty: fix to print some lifetimes on HIR pretty-printYutaro Ohno-0/+36
2022-10-15Add more GUI tests for settings pageGuillaume Gomez-2/+9
2022-10-15Auto merge of #103083 - Dylan-DPC:rollup-97cvwdv, r=Dylan-DPCbors-0/+279
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 #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=ManishearthDylan DPC-0/+51
Add missing checks for `doc(cfg_hide(...))` Part of #43781. The `doc(cfg_hide(...))` attribute can only be used at the crate level and takes a list of attributes as argument. r? ```@Manishearth```
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-14Rollup merge of #103054 - GuillaumeGomez:cleanup-rust-logo-test, r=notriddleMatthias Krüger-70/+26
Clean up rust-logo rustdoc GUI test r? `@notriddle`
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-14Clean up rust-logo rustdoc GUI testGuillaume Gomez-70/+26
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-7/+5
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 #102914 - ↵Dylan DPC-1/+73
GuillaumeGomez:migrate-css-highlight-without-change, r=notriddle Migrate css highlight without change This is a "previous" version of https://github.com/rust-lang/rust/pull/102663: only migrating to CSS variables, no changes. It's a bit more verbose because rules are not coherent between themes. r? ``@notriddle``
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-14Add UI test for invalid `doc(cfg_hide(...))` attributesGuillaume Gomez-0/+51
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-7/+5
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