about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-10-17Use named arguments to make test clearerGuillaume Gomez-27/+27
2022-10-17Rollup merge of #103091 - notriddle:notriddle/sidebar-title, r=GuillaumeGomezMatthias Krüger-23/+23
rustdoc: remove unused HTML class `sidebar-title` Since 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, this class is no longer styled.
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-17Rollup merge of #103129 - notriddle:notriddle/sub-logo-container, ↵Matthias Krüger-3/+3
r=GuillaumeGomez rustdoc: remove unused `.sub-logo-container` DOM on non-source pages
2022-10-17Make diagnostic for unsatisfied Termination bounds more preciseLeón Orell Valerian Liehr-3/+63
2022-10-17macros: allow subdiagnostic-kind-less variantsDavid Wood-50/+43
Sometimes it is convenient to return a subdiagnostic enum where one or more of the variants don't add anything to the diagnostic. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-17macros: support doc comments in diag derivesDavid Wood-0/+30
Documentation comments shouldn't affect the diagnostic derive in any way, but explicit support has to be added for ignoring the `doc` attribute. Signed-off-by: David Wood <david.wood@huawei.com>
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-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-16rustdoc: remove unused `.sub-logo-container` DOM on non-source pagesMichael Howell-3/+3
2022-10-17trivial fix for comments feedbackyukang-10/+10
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-16Don't consider `Let` exprs terminating scopesNathan Whitaker-6/+18
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-17Add tests for autoderef on block tailbogon-right-0/+149
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-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-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: update test cases for `.sidebar-title` -> `.sidebar-elems h3`Michael Howell-23/+23
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-14Fix line numbers for MIR inlined codeWesley Wiser-1/+1
`should_collapse_debuginfo` detects if the specified span is part of a macro expansion however it does this by checking if the span is anything other than a normal (non-expanded) kind, then the span sequence is walked backwards to the root span. This doesn't work when the MIR inliner inlines code as it creates spans with expansion information set to `ExprKind::Inlined` and results in the line number being attributed to the inline callsite rather than the normal line number of the inlined code.