about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-11-28Rustdoc-Json: Add tests for linking to foreign variants.Nixon Enraght-Moony-0/+25
2022-11-28rustdoc: remove `fnname` CSS class that's styled exactly like `fn`Michael Howell-32/+32
It's not obvious why this was ever a separate class name, since even in c4219a478354b464079b1b7ab081e071e8e39765 when it was first added, it was styled identically to regular `fn` links.
2022-11-28Statics used in reachable function's inline asm are reachableTomasz Miąsko-0/+20
2022-11-28Rollup merge of #104956 - mucinoab:issue-104870, r=compiler-errorsMatthias Krüger-0/+41
Avoid ICE if the Clone trait is not found while building error suggestions Fixes #104870 r? `@compiler-errors`
2022-11-28Rollup merge of #104954 - vincenzopalazzo:macros/prinf, r=estebankMatthias Krüger-0/+23
make simple check of prinf function Fixes https://github.com/rust-lang/rust/issues/92898 With this commit we start to make some simple check when the name resolution fails, and we generate some helper messages in case the name is a C name like in the case of the `printf` and suggest the correct rust method. `@rustbot` r? `@pnkfelix` Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-11-28Rollup merge of #104936 - cjgillot:self-rpit-orig-too, r=oli-obkMatthias Krüger-0/+66
Ignore bivariant parameters in test_type_match. https://github.com/rust-lang/rust/pull/103491 made opaque types bivariant with respect of some of their lifetime parameters. Because of this bivariance, some lifetime variables were not unified to anything during borrowck, and were considered as unequal by borrowck type test. This PR makes type test ignore the bivariant parameters in test_type_match. Fixes https://github.com/rust-lang/rust/issues/104815 r? `@oli-obk`
2022-11-28Auto merge of #105008 - Dylan-DPC:rollup-wcd19yu, r=Dylan-DPCbors-85/+62
Rollup of 6 pull requests Successful merges: - #104360 (Stabilize native library modifier `verbatim`) - #104732 (Refactor `ty::ClosureKind` related stuff) - #104795 (Change multiline span ASCII art visual order) - #104890 (small method code cleanup) - #104907 (Remove `SelectionContext::infcx()` in favor of field access) - #104927 (Simplify some binder shifting logic) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-28Auto merge of #102991 - Sp00ph:master, r=scottmcmbors-3/+3
Update VecDeque implementation to use head+len instead of head+tail (See #99805) This changes `alloc::collections::VecDeque`'s internal representation from using head and tail indices to using a head index and a length field. It has a few advantages over the current design: * It allows the buffer to be of length 0, which means the `VecDeque::new` new longer has to allocate and could be changed to a `const fn` * It allows the `VecDeque` to fill the buffer completely, unlike the old implementation, which always had to leave a free space * It removes the restriction for the size to be a power of two, allowing it to properly `shrink_to_fit`, unlike the old `VecDeque` * The above points also combine to allow the `Vec<T> -> VecDeque<T>` conversion to be very cheap and guaranteed O(1). I mention this in the `From<Vec<T>>` impl, but it's not a strong guarantee just yet, as that would likely need some form of API change proposal. All the tests seem to pass for the new `VecDeque`, with some slight adjustments. r? `@scottmcm`
2022-11-28Rollup merge of #104795 - estebank:multiline-spans, r=TaKO8KiDylan DPC-37/+33
Change multiline span ASCII art visual order Tweak the ASCII art for nested multiline spans so that we minimize line overlaps. Partially addresses https://github.com/rust-lang/rust/issues/61017.
2022-11-28Rollup merge of #104360 - petrochenkov:stabverb, r=TaKO8KiDylan DPC-48/+29
Stabilize native library modifier `verbatim` Stabilization report - https://github.com/rust-lang/rust/pull/104360#issuecomment-1312724787. cc https://github.com/rust-lang/rust/issues/81490 Closes https://github.com/rust-lang/rust/issues/99425
2022-11-28Keep track of the start of the argument block of a closureSarthak Singh-0/+1
2022-11-28Tweak outputEsteban Küber-23/+19
2022-11-28Change multiline span ASCII art visual orderEsteban Küber-50/+50
2022-11-28Run Windows-only tests only on WindowsFlorian Bartels-25/+2
This removes the need to maintain a list of all other OSs which ignore the tests.
2022-11-27Avoid ICE if the Clone trait is not found while building error suggestionsBruno A. Muciño-0/+41
2022-11-27Fix `pretty-std` testMarkus Everling-2/+2
2022-11-27Rollup merge of #104984 - GuillaumeGomez:remote-crate-primitives, r=notriddleMatthias Krüger-0/+15
Remove Crate::primitives field It is a new approach to #90447. Instead of removing primitives from everywhere (ie from `BadImplStripper`), I just removed them from the `Crate` type, allowing to reduce its size. cc `@camelid` r? `@notriddle`
2022-11-27Rollup merge of #104955 - GuillaumeGomez:migrate-to-func, r=notriddleMatthias Krüger-17/+29
Switch rustdoc-gui test to function call r? `@notriddle`
2022-11-27Stabilize native library modifier `verbatim`Vadim Petrochenkov-48/+29
2022-11-28inference test for #104649Ding Xiang Fei-0/+46
2022-11-27Auto merge of #104983 - matthiaskrgr:rollup-018sk73, r=matthiaskrgrbors-70/+121
Rollup of 8 pull requests Successful merges: - #95836 (Use `rust_out{exe_suffix}` for doctests) - #104882 (notify lcnr on changes to `ObligationCtxt`) - #104892 (Explain how to get the discriminant out of a `#[repr(T)] enum` with payload) - #104917 (Allow non-org members to label `requires-debug-assertions`) - #104931 (Pretty-print generators with their `generator_kind`) - #104934 (Remove redundant `all` in cfg) - #104944 (Support unit tests for jsondoclint) - #104946 (rustdoc: improve popover focus handling JS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-27Add rustdoc test for Deref to primitive typesGuillaume Gomez-0/+15
2022-11-27Rollup merge of #104946 - notriddle:notriddle/popover-menu-focus, ↵Matthias Krüger-0/+52
r=GuillaumeGomez rustdoc: improve popover focus handling JS This commit fixes a few inconsistencies and erratic behavior from the notable traits, settings, and sidebar popups: * It makes it so that pressing Escape closes the mobile sidebar. This is a bit difficult to do on iPhone, but on other setups like desktop tiling window managers, it's easy and makes sense. * It makes sure that pressing escape while a notable trait popover is open focuses the popover's toggle button, instead of leaving nothing focused, since that makes more sense with keyboard navigation. Clicking the settings, help, or sidebar buttons, however, will not focus the notable trait popover toggle button. * It ensures that notable trait and settings popovers are exclusive with the mobile sidebar. Nothing should ever overlap a popover, and there should never be more than one popover open at once.
2022-11-27Rollup merge of #104931 - Swatinem:async-pretty, r=eholkMatthias Krüger-69/+68
Pretty-print generators with their `generator_kind` After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally. This now reverses that change so that async fn/blocks are pretty-printed as `[$async-type@$source-position]` in various diagnostics, and updates the tests that this touches.
2022-11-27Rollup merge of #95836 - workingjubilee:doctest-exe, r=notriddleMatthias Krüger-1/+1
Use `rust_out{exe_suffix}` for doctests This was mentioned as an issue to me by ````@bruxisma.```` There are 3 separate instances where "rust_out" can become part of the name of a Rust executable, so I am mostly just hoping that this fixes the problem, given that the other sites which it can slip in seem to be well-behaved.
2022-11-27Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errorsbors-72/+234
Separate lifetime ident from lifetime resolution in HIR Drive-by: change how suggested generic args are computed. Fixes https://github.com/rust-lang/rust/issues/103815 I recommend reviewing commit-by-commit.
2022-11-27make simple check of prinf function.Vincenzo Palazzo-0/+23
With this commit we start to make some simple check when the name resolution fails, and we generate some helper message in case the name is a C name like in the case of the `printf` and suggest the correct rust method. Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-11-27Auto merge of #103917 - oli-obk:layout_math, r=RalfJung,lcnrbors-20/+115
Various cleanups around scalar layout restrictions Pulled out of https://github.com/rust-lang/rust/pull/103724
2022-11-26Add test for scrape-examples next/prev buttonsWill Crichton-1/+15
2022-11-27Auto merge of #96451 - JakobDegen:dest-prop, r=tmiaskobors-365/+425
Fix Dest Prop Closes #82678, #79191 . This was not originally a total re-write of the pass but is has gradually turned into one. Notable changes: 1. Significant improvements to documentation all around. The top of the file has been extended with a more precise argument for soundness. The code should be fairly readable, and I've done my best to add useful comments wherever possible. I would very much like for the bus factor to not be one on this code. 3. Improved handling of conflicts that are not visible in normal dataflow. This was the cause of #79191. Handling this correctly requires us to make decision about the semantics and specifically evaluation order of basically all MIR constructs (see specifically #68364 #71117. The way this is implemented is based on my preferred resolution to these questions around the semantics of assignment statements. 4. Some re-architecting to improve performance. More details below. 5. Possible future improvements to this optimization are documented, and the code is written with the needs of those improvements in mind. The hope is that adding support for more precise analyses will not require a full re-write of this opt, but just localized changes. ### Regarding Performance The previous approach had some performance issues; letting `l` be the number of locals and `s` be the number of statements/terminators, the runtime of the pass was `O(l^2 * s)`, both in theory and in practice. This version is smarter about not calculating unnecessary things and doing more caching. Our runtime is now dominated by one invocation of `MaybeLiveLocals` for each "round," and the number of rounds is less than 5 in over 90% of cases. This means it's linear-ish in practice. r? `@oli-obk` who reviewed the last version of this, but review from anyone else would be more than welcome
2022-11-26Attempt to solve problem with globsJubilee Young-1/+1
2022-11-26Rewrite dest prop.Jakob Degen-365/+425
This fixes a number of correctness issues from the previous version. Additionally, we use a new strategy which has much better performance charactersitics and also finds more opportunities to apply the optimization.
2022-11-27Auto merge of #104818 - scottmcm:refactor-extend-func, r=the8472bors-0/+7
Stop peeling the last iteration of the loop in `Vec::resize_with` `resize_with` uses the `ExtendWith` code that peels the last iteration: https://github.com/rust-lang/rust/blob/341d8b8a2c290b4535e965867e876b095461ff6e/library/alloc/src/vec/mod.rs#L2525-L2529 But that's kinda weird for `ExtendFunc` because it does the same thing on the last iteration anyway: https://github.com/rust-lang/rust/blob/341d8b8a2c290b4535e965867e876b095461ff6e/library/alloc/src/vec/mod.rs#L2494-L2502 So this just has it use the normal `extend`-from-`TrustedLen` code instead. r? `@ghost`
2022-11-26Revert "Do not need to account for overflow in predicate_can_apply"Michael Goulet-27/+0
This reverts commit cbe932801892da06688b53638622be1c8a1c8974.
2022-11-26Revert "Add fatal overflow test"Michael Goulet-41/+0
This reverts commit 9decfff6f87d3e5760fd61375c3d27fa45a83e52.
2022-11-26Switch rustdoc-gui test to function callGuillaume Gomez-17/+29
2022-11-26Pretty-print generators with their `generator_kind`Arpad Borsos-69/+68
After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally. This now reverses that change so that async fn/blocks are pretty-printed as `[$movability `async` $something@$source-position]` in various diagnostics, and updates the tests that this touches.
2022-11-26rustdoc: improve popover focus handling JSMichael Howell-0/+52
This commit fixes a few inconsistencies and erratic behavior from the notable traits, settings, and sidebar popups: * It makes it so that pressing Escape closes the mobile sidebar. This is a bit difficult to do on iPhone, but on other setups like desktop tiling window managers, it's easy and makes sense. * It makes sure that pressing escape while a notable trait popover is open focuses the popover's toggle button, instead of leaving nothing focused, since that makes more sense with keyboard navigation. Clicking the settings, help, or sidebar buttons, however, will not focus the notable trait popover toggle button. * It ensures that notable trait and settings popovers are exclusive with the mobile sidebar. Nothing should ever overlap a popover, and there should never be more than one popover open at once.
2022-11-26Rollup merge of #104943 - aDotInTheVoid:jsondoclint-use-enum, r=GuillaumeGomezGuillaume Gomez-0/+33
jsondoclint: Handle using enum variants and glob using enums. More work on jsondoclint for `core.json` Closes #104942 r? `@GuillaumeGomez` `@rustbot` modify labels: +A-testsuite
2022-11-26Rollup merge of #104924 - aDotInTheVoid:jsondocck-trait-alias, r=GuillaumeGomezGuillaume Gomez-0/+30
jsondoclint: Accept trait alias is places where trait expected. More work to make `jsondoclint` work for `core.json` Closes #104923 r? `@GuillaumeGomez` `@rustbot` modify labels: +A-testsuite
2022-11-26Rollup merge of #104788 - compiler-errors:unresolved-ct-in-gen, r=fee1-deadGuillaume Gomez-0/+92
Do not record unresolved const vars in generator interior Don't record types in the generator interior when we see unresolved const variables. We already do this for associated types -- this is important to avoid unresolved inference variables in the generator results during writeback, since the writeback results get stable hashed in incremental mode. Fixes #104787
2022-11-26jsondoclint: Handle using enum variants and glob using enums.Nixon Enraght-Moony-0/+33
Closes #104942
2022-11-26Auto merge of #104935 - matthiaskrgr:rollup-nuca86l, r=matthiaskrgrbors-21/+56
Rollup of 6 pull requests Successful merges: - #104121 (Refine `instruction_set` MIR inline rules) - #104675 (Unsupported query error now specifies if its unsupported for local or external crate) - #104839 (improve array_from_fn documenation) - #104880 ([llvm-wrapper] adapt for LLVM API change) - #104899 (rustdoc: remove no-op CSS `#help dt { display: block }`) - #104906 (Remove AscribeUserTypeCx) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-26Ignore bivariant parameters in test_type_match.Camille GILLOT-0/+66
2022-11-26Rollup merge of #104121 - ↵Matthias Krüger-21/+56
Lokathor:mir-opt-when-instruction-set-missing-on-callee, r=tmiasko Refine `instruction_set` MIR inline rules Previously an exact match of the `instruction_set` attribute was required for an MIR inline to be considered. This change checks for an exact match *only* if the callee sets an `instruction_set` in the first place. When the callee does not declare an instruction set then it is considered to be platform agnostic code and it's allowed to be inline'd into the caller. cc ``@oli-obk`` [Edit] Zulip Context: https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/What.20exactly.20does.20the.20MIR.20optimizer.20do.3F
2022-11-26will not suggest for postfix operator when can not handle precedences wellyukang-10/+38
2022-11-26Auto merge of #103556 - clubby789:specialize-option-partial-eq, r=scottmcmbors-0/+34
Manually implement PartialEq for Option<T> and specialize non-nullable types This PR manually implements `PartialEq` and `StructuralPartialEq` for `Option`, which seems to produce slightly better codegen than the automatically derived implementation. It also allows specializing on the `core::num::NonZero*` and `core::ptr::NonNull` types, taking advantage of the niche optimization by transmuting the `Option<T>` to `T` to be compared directly, which can be done in just two instructions. A comparison of the original, new and specialized code generation is available [here](https://godbolt.org/z/dE4jxdYsa).
2022-11-26Do not record unresolved const vars in generator interiorMichael Goulet-0/+92
2022-11-26jsondoclint: Accept trait alias is places where trait expected.Nixon Enraght-Moony-0/+30
Closes #104923
2022-11-25Auto merge of #99798 - JulianKnodt:ac1, r=BoxyUwUbors-6/+115
Add `ConstKind::Expr` Starting to implement `ty::ConstKind::Abstract`, most of the match cases are stubbed out, some I was unsure what to add, others I didn't want to add until a more complete implementation was ready. r? `@lcnr`