about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-10-21testsMichael Goulet-0/+159
2022-10-21Auto merge of #101077 - sunshowers:signal-mask-inherit, r=sunshowersbors-2/+4
Change process spawning to inherit the parent's signal mask by default Previously, the signal mask was always reset when a child process is started. This breaks tools like `nohup` which expect `SIGHUP` to be blocked for all transitive processes. With this change, the default behavior changes to inherit the signal mask. This also changes the signal disposition for `SIGPIPE` to only be changed if the `#[unix_sigpipe]` attribute isn't set.
2022-10-21rustdoc: prevent method summary margin from being applied to docblocksMichael Howell-0/+23
2022-10-21Auto merge of #98450 - lqd:doc-metadata, r=lqd,GuillaumeGomezbors-0/+44
Remove more attributes from metadata A lot of the attributes that are currently stored in the metadata aren't used at all. The biggest metadata usage comes from the doc attributes currently but they are needed by rustdoc so we only removed the ones that cannot be used in downstream crates (doc comments on private items). r? `@ghost`
2022-10-21Handle RPITITs properly in register_hidden_typeMichael Goulet-13/+50
2022-10-21Require Drop impls to have the same constness on its bounds as the bounds on ↵Oli Scherer-46/+115
the struct have
2022-10-21Update UI testsclubby789-9/+44
2022-10-21Rollup merge of #103321 - notriddle:notriddle/source-page-top-bar-layout, ↵Dylan DPC-8/+30
r=GuillaumeGomez rustdoc: improve appearance of source page navigation bar This commit changes things so that the search bar is exactly centered between the top of the page and the top of the source code content area. Preview: https://notriddle.com/notriddle-rustdoc-demos/source-page-header/src/std/lib.rs.html ## Before ![image](https://user-images.githubusercontent.com/1593513/197053420-02a64627-48ed-4bb6-9363-a1863d47b092.png) ## After ![image](https://user-images.githubusercontent.com/1593513/197053355-bd6149f9-0f5c-47da-aeb7-590b5eecb5da.png)
2022-10-21Rollup merge of #103260 - cuviper:needs-asm-support, r=fee1-deadDylan DPC-14/+5
Fixup a few tests needing asm support
2022-10-21Rollup merge of #103111 - cjgillot:shadow-label, r=estebankDylan DPC-18/+33
Account for hygiene in typo suggestions, and use them to point to shadowed names Fixes https://github.com/rust-lang/rust/issues/97459 r? `@estebank`
2022-10-21Rollup merge of #103051 - davidtwco:translation-tidying-up, r=compiler-errorsDylan DPC-50/+73
translation: doc comments with derives, subdiagnostic-less enum variants, more derive use - Adds support for `doc` attributes in the diagnostic derives so that documentation comments don't result in the derive failing. - Adds support for enum variants in the subdiagnostic derive to not actually correspond to an addition to a diagnostic. - Made use of the derive in more places in the `rustc_ast_lowering`, `rustc_ast_passes`, `rustc_lint`, `rustc_session`, `rustc_infer` - taking advantage of recent additions like eager subdiagnostics, multispan suggestions, etc. cc #100717
2022-10-21Rollup merge of #102287 - compiler-errors:unused-must-use-also-supertrait, ↵Dylan DPC-0/+26
r=fee1-dead Elaborate supertrait bounds when triggering `unused_must_use` on `impl Trait` Given `impl Trait`, if one of its supertraits has a `#[must_use]`, then trigger the lint. This means that, for example, `-> impl ExactSizeIterator` also triggers the `must_use` on `trait Iterator`, which fixes #102183. This might need `@rust-lang/lang` sign-off, since it changes the behavior of the lint, so cc'ing them.
2022-10-21add test for issue 97607Rageking8-0/+12
2022-10-21fix some typosRageking8-3/+3
2022-10-21Fix unreachable_pub suggestion for enum with fieldsKitsu-0/+30
2022-10-21Introduce deduced parameter attributes, and use them for deducing `readonly` onPatrick Walton-1/+61
indirect immutable freeze by-value function parameters. Right now, `rustc` only examines function signatures and the platform ABI when determining the LLVM attributes to apply to parameters. This results in missed optimizations, because there are some attributes that can be determined via analysis of the MIR making up the function body. In particular, `readonly` could be applied to most indirectly-passed by-value function arguments (specifically, those that are freeze and are observed not to be mutated), but it currently is not. This patch introduces the machinery that allows `rustc` to determine those attributes. It consists of a query, `deduced_param_attrs`, that, when evaluated, analyzes the MIR of the function to determine supplementary attributes. The results of this query for each function are written into the crate metadata so that the deduced parameter attributes can be applied to cross-crate functions. In this patch, we simply check the parameter for mutations to determine whether the `readonly` attribute should be applied to parameters that are indirect immutable freeze by-value. More attributes could conceivably be deduced in the future: `nocapture` and `noalias` come to mind. Adding `readonly` to indirect function parameters where applicable enables some potential optimizations in LLVM that are discussed in [issue 103103] and [PR 103070] around avoiding stack-to-stack memory copies that appear in functions like `core::fmt::Write::write_fmt` and `core::panicking::assert_failed`. These functions pass a large structure unchanged by value to a subfunction that also doesn't mutate it. Since the structure in this case is passed as an indirect parameter, it's a pointer from LLVM's perspective. As a result, the intermediate copy of the structure that our codegen emits could be optimized away by LLVM's MemCpyOptimizer if it knew that the pointer is `readonly nocapture noalias` in both the caller and callee. We already pass `nocapture noalias`, but we're missing `readonly`, as we can't determine whether a by-value parameter is mutated by examining the signature in Rust. I didn't have much success with having LLVM infer the `readonly` attribute, even with fat LTO; it seems that deducing it at the MIR level is necessary. No large benefits should be expected from this optimization *now*; LLVM needs some changes (discussed in [PR 103070]) to more aggressively use the `noalias nocapture readonly` combination in its alias analysis. I have some LLVM patches for these optimizations and have had them looked over. With all the patches applied locally, I enabled LLVM to remove all the `memcpy`s from the following code: ```rust fn main() { println!("Hello {}", 3); } ``` which is a significant codegen improvement over the status quo. I expect that if this optimization kicks in in multiple places even for such a simple program, then it will apply to Rust code all over the place. [issue 103103]: https://github.com/rust-lang/rust/issues/103103 [PR 103070]: https://github.com/rust-lang/rust/pull/103070
2022-10-21replaced wrong test with the correct mcveSarthak Singh-36/+11
2022-10-20Add fix suggestions for E0199, E0200, and E0569Nicolas Barrios-0/+54
2022-10-20Do not suggest trivially false const predicatesMichael Goulet-61/+0
2022-10-20Add UI regression test when querying visibility of generic parameterGuillaume Gomez-0/+9
2022-10-20Add ui test to ensure attributes generated from macros are kept as expectedGuillaume Gomez-0/+35
2022-10-20Change process spawning to inherit the parent's signal mask by defaultRain-2/+4
Previously, the signal mask is always reset when a child process is started. This breaks tools like `nohup` which expect `SIGHUP` to be blocked. With this change, the default behavior changes to inherit the signal mask. This also changes the signal disposition for `SIGPIPE` to only be changed if the `#[unix_sigpipe]` attribute isn't set.
2022-10-20Rollup merge of #103319 - fee1-dead-contrib:improve_tilde_const_msg, r=oli-obkMatthias Krüger-5/+42
Improve "`~const` is not allowed here" message r? `@oli-obk`
2022-10-20Rollup merge of #103296 - GuillaumeGomez:collapse-expand-shortcuts, r=notriddleMatthias Krüger-0/+18
+/- shortcut now only expand/collapse, not both Fixes https://github.com/rust-lang/rust/issues/102772. r? ```@notriddle```
2022-10-20Rollup merge of #103281 - thomcc:long-overdue, r=jyn514Matthias Krüger-3/+3
Adjust `transmute{,_copy}` to be clearer about which of `T` and `U` is input vs output This is essentially a documentation-only change (although it does touch code in an irrelevant way).
2022-10-20Rollup merge of #103221 - TaKO8Ki:fix-103202, r=oli-obkMatthias Krüger-0/+16
Fix `SelfVisitor::is_self_ty` ICE Fixes #103202
2022-10-20rustdoc: improve appearance of source page navigation barMichael Howell-8/+30
This commit changes things so that the search bar is exactly centered between the top of the page and the top of the source code content area.
2022-10-20Improve "`~const` is not allowed here" messageDeadbeef-5/+42
2022-10-20Elaborate supertrait bounds when triggering unused_must_use on impl TraitMichael Goulet-0/+26
2022-10-20Update tests to match error message changesb4den-126/+126
2022-10-20fix rust-lang#101880: suggest let for assignment, and some code refactoryukang-0/+94
2022-10-20Move some tests for more reasonable placesCaio-0/+0
2022-10-20Auto merge of #103290 - matthiaskrgr:rollup-ngozai3, r=matthiaskrgrbors-6/+153
Rollup of 6 pull requests Successful merges: - #103197 (Stabilize proc_macro::Span::source_text) - #103251 (Fix item declaration highlighting) - #103262 (Adjusting test to needs-unwind, with linking issue) - #103268 (rustdoc: remove no-op CSS `nav.sub { font-size: 1rem }`) - #103272 (Remove extra spaces in docs) - #103276 (Erase regions before checking for `Default` in uninitialized binding error) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-20fix assertion failed for break_last_token and trailing tokenyukang-0/+25
2022-10-20Don't use usub.with.overflow intrinsicNikita Popov-0/+16
The canonical form of a usub.with.overflow check in LLVM are separate sub + icmp instructions, rather than a usub.with.overflow intrinsic. Using usub.with.overflow will generally result in worse optimization potential. The backend will attempt to form usub.with.overflow when it comes to actual instruction selection. This is not fully reliable, but I believe this is a better tradeoff than using the intrinsic in IR. Fixes #103285.
2022-10-20Add GUI tests for collapse/expand actionsGuillaume Gomez-0/+18
2022-10-20Rollup merge of #103276 - compiler-errors:default-on-uninit-ice, r=TaKO8KiMatthias Krüger-0/+54
Erase regions before checking for `Default` in uninitialized binding error Fixes #103250
2022-10-20Rollup merge of #103262 - andrewpollack:switch-needs-unwind, r=tmandryMatthias Krüger-1/+1
Adjusting test to needs-unwind, with linking issue Test requires `needs-unwind` (see linked issue #103261)
2022-10-20Rollup merge of #103251 - GuillaumeGomez:item-decl-highlighting, r=notriddleMatthias Krüger-5/+98
Fix item declaration highlighting Fixes https://github.com/rust-lang/rust/issues/103050. As mentioned in the issue, https://github.com/rust-lang/rust/pull/102924 introduced this regression. This PR partially reverts it and adds a regression test. r? `@notriddle`
2022-10-20Auto merge of #103220 - compiler-errors:deny-infers, r=lcnrbors-22/+22
Deny hashing ty/re/ct inference variables cc `@cjgillot` and https://github.com/rust-lang/rust/pull/102695#issuecomment-1275706528 r? `@lcnr` best reviewed one commit at a time, mostly because the second commit that fixes `ClosureOutlivesRequirement` is mostly noise because of losing its `<'tcx>` lifetime parameter.
2022-10-19Adjust `transmute{,_copy}` to be clearer about which of `T` and `U` is input ↵Thom Chiovoloni-3/+3
vs output
2022-10-20Bless testMichael Goulet-3/+19
2022-10-20fix span for suggestionyukang-2/+3
2022-10-20fix #103112, add diagnostic for calling a function with the same name when a ↵yukang-0/+18
Macro is not found
2022-10-20Auto merge of #103205 - spastorino:fix-rpits-lifetime-remapping, r=cjgillotbors-0/+23
Do anonymous lifetimes remapping correctly for nested rpits Closes #103141 r? `@cjgillot` `@nikomatsakis` This fixes a stable to stable regression that in my opinion is `P-critical` so, we probably want to backport it all the way up to stable.
2022-10-19Bless ui testsRyan Lopopolo-2/+2
2022-10-20Adjusting test to needs-unwind, with linking issueAndrew Pollack-1/+1
2022-10-20Auto merge of #102417 - oli-obk:opaque_lifetimes2, r=jackh726bors-25/+65
Require lifetime bounds for opaque types in order to allow hidden types to capture said lifetimes fixes #96996 cc `@aliemjay`
2022-10-19Erase regions before checking for default in uninitialized binding errorMichael Goulet-0/+54
2022-10-19Do anonymous lifetimes remapping correctly for nested rpitsSantiago Pastorino-0/+23