about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-01-18rustdoc: add test case for setting-line margin on settings.htmlMichael Howell-0/+7
2023-01-18Auto merge of #107021 - matthiaskrgr:rollup-0dzxfyi, r=matthiaskrgrbors-53/+255
Rollup of 7 pull requests Successful merges: - #106244 (Improve Markdown styling in README) - #106747 (Add 'static lifetime suggestion when GAT implied 'static requirement from HRTB) - #106873 (dont randomly use `_` to print out const generic arguments) - #106992 (Remove unused `#![feature(box_syntax)]` in `alloc`) - #106995 (bump failing assembly & codegen tests from LLVM 14 to LLVM 15) - #106996 (rustdoc: instead of `.setting-name { width: 100% }`, use default div CSS) - #106997 (Add heapsort fallback in `select_nth_unstable`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-18Rollup merge of #106996 - notriddle:notriddle/settings-line-div, ↵Matthias Krüger-0/+27
r=GuillaumeGomez rustdoc: instead of `.setting-name { width: 100% }`, use default div CSS This has no discernible change in appearance.
2023-01-18Rollup merge of #106995 - lukas-code:align_offset_assembly_test, r=cuviperMatthias Krüger-2/+2
bump failing assembly & codegen tests from LLVM 14 to LLVM 15 These tests need LLVM 15. Found by ```@Robert-Cunningham``` in https://github.com/rust-lang/rust/pull/100601#issuecomment-1385400008 Passed tests at 006506e93fc80318ebfd7939fe1fd4dc19ecd8cb in https://github.com/rust-lang/rust/actions/runs/3942442730/jobs/6746104740.
2023-01-18Rollup merge of #106873 - BoxyUwU:ty_const_formatting, r=compiler-errorsMatthias Krüger-51/+96
dont randomly use `_` to print out const generic arguments const generics seem to get printed out as `_` for no reason a lot of the time, as someone who spends a lot of time with const generics this has gotten :sparkles: very annoying :sparkles:. Latest example would be #106423 where the ICE messaged formatted a `ty::Const` containing no infer vars, as `_`. For some reason printing of the const argument on arrays was custom instead of using the existing logic for printing `ty::Const`. Additionally the existing logic for printing `ty::Const` would print out `_` for anon consts that are in a separate crate leading to weird diagnostics (see second commit). There ought to be less cases of consts randomly getting printed as `_` hiding valuable info now.
2023-01-18Rollup merge of #106747 - yanchen4791:issue-105507-fix, r=estebankMatthias Krüger-0/+130
Add 'static lifetime suggestion when GAT implied 'static requirement from HRTB Fix for issue #105507 The problem: When generic associated types (GATs) are from higher-ranked trait bounds (HRTB), they are implied 'static requirement (see [Implied 'static requirement from higher-ranked trait bounds](https://blog.rust-lang.org/2022/10/28/gats-stabilization.html#implied-static-requirement-from-higher-ranked-trait-bounds) for more details). If the user did not explicitly specify the `'static` lifetime when using the GAT, the current error message will only point out the type `does not live long enough` where the type is used, but not where the GAT is specified and how to fix the problem. The solution: Add notes at the span where the problematic GATs are specified and suggestions of how to fix the problem by adding `'static` lifetime at the right spans.
2023-01-18i am freeBoxy-7/+7
2023-01-18actually print out non local anon constsBoxy-2/+2
2023-01-18test for non local anon const printingBoxy-0/+36
2023-01-18defer array len printing to const arg printingBoxy-46/+55
2023-01-18Auto merge of #106952 - petrochenkov:docglob, r=notriddle,GuillaumeGomezbors-0/+7
rustdoc: Fix glob import inlining Filter away names that are not actually imported by the glob, e.g. because they are shadowed by something else. Fixes the issue found in https://github.com/rust-lang/rust/pull/94857#issuecomment-1382912356.
2023-01-17Auto merge of #106998 - matthiaskrgr:rollup-hmfisji, r=matthiaskrgrbors-27/+6
Rollup of 7 pull requests Successful merges: - #104505 (Remove double spaces after dots in comments) - #106784 (prevent E0512 from emitting [type error] by checking the references_error) - #106834 (new trait solver: only consider goal changed if response is not identity) - #106889 (Mention the lack of `windows_mut` in `windows`) - #106963 (Use `scope_expr_id` from `ProbeCtxt`) - #106970 (Switch to `EarlyBinder` for `item_bounds` query) - #106980 (Hide `_use_mk_alias_ty_instead` in `<AliasTy as Debug>::fmt`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-17Add 'static lifetime suggestion when GAT implied 'static requirement from HRTByanchen4791-0/+130
2023-01-17Rollup merge of #106980 - Nilstrieb:_use_mk_manual_debug_impl_instead, r=lcnrMatthias Krüger-1/+1
Hide `_use_mk_alias_ty_instead` in `<AliasTy as Debug>::fmt`
2023-01-17Rollup merge of #106784 - lyming2007:issue-106695-fix, r=WaffleLapkinMatthias Krüger-26/+5
prevent E0512 from emitting [type error] by checking the references_error but still emit E0512 this will fix #106695
2023-01-17rustdoc: add test cases for settings radio button layoutMichael Howell-0/+27
2023-01-17bump failing assembly & codegen tests from LLVM 14 to LLVM 15Lukas Markeffsky-2/+2
2023-01-17Auto merge of #106294 - Nilstrieb:noundef-everything, r=nikicbors-101/+128
Put `noundef` on all scalars that don't allow uninit Previously, it was only put on scalars with range validity invariants like bool, was uninit was obviously invalid for those. Since then, we have normatively declared all uninit primitives to be undefined behavior and can therefore put `noundef` on them. The remaining concern was the `mem::uninitialized` function, which cause quite a lot of UB in the older parts of the ecosystem. After #99182, this function now doesn't return uninit values anymore, making users of it safe from this change. The only real sources of UB where people could encounter uninit primitives are `MaybeUninit::uninit().assume_init()`, which has always be clear in the docs about being UB and from heap allocations (like reading from the spare capacity of a vec). This is hopefully rare enough to not break anything. cc `@nagisa` `@scottmcm` `@nikic`
2023-01-17delay E0512 as a bug by checking the references_errorYiming Lei-26/+5
fix #106695
2023-01-17Add more codegen testsNilstrieb-139/+166
2023-01-17Rollup merge of #106962 - compiler-errors:use-sugg-span, r=oli-obkDylan DPC-38/+38
Fix use suggestion span Fixes #106954
2023-01-17Rollup merge of #106148 - chenyukang:yukang/fix-105061-unused, r=lcnrDylan DPC-0/+159
Fix unused_parens issue for higher ranked function pointers fixes #105061 r? `@lcnr`
2023-01-17Rollup merge of #101698 - raldone01:feat/const_cmp_typeid, r=scottmcmDylan DPC-22/+30
Constify `TypeId` ordering impls Tracking issue: #101871 Adding const ordering to `TypeId` allows rtti crates to optimize some casting scenarios (without transmuting to `u64`). This would also prevent these crates from breaking if the underlying type is changed from `u64` to something different. Feature gate: `#![feature(const_cmp_type_id)]`
2023-01-17Hide `_use_mk_alias_ty_instead` in `<AliasTy as Debug>::fmt`nils-1/+1
2023-01-17Auto merge of #106627 - Ezrashaw:no-e0711-without-staged-api, r=Mark-Simulacrumbors-0/+25
fix: don't emit `E0711` if `staged_api` not enabled Fixes #106589 Simple fix, added UI test. As an aside, it seems a lot of features are susceptible to this, `E0711` stands out to me because it's perma-unstable and we are effectively exposing an implementation detail.
2023-01-17Improve commentsNilstrieb-1/+1
2023-01-17Put `noundef` on all scalars that don't allow uninitNilstrieb-174/+174
Previously, it was only put on scalars with range validity invariants like bool, was uninit was obviously invalid for those. Since then, we have normatively declared all uninit primitives to be undefined behavior and can therefore put `noundef` on them. The remaining concern was the `mem::uninitialized` function, which cause quite a lot of UB in the older parts of the ecosystem. This function now doesn't return uninit values anymore, making users of it safe from this change. The only real sources of UB where people could encounter uninit primitives are `MaybeUninit::uninit().assume_init()`, which has always be clear in the docs about being UB and from heap allocations (like reading from the spare capacity of a vec. This is hopefully rare enough to not break anything.
2023-01-17Rollup merge of #106949 - compiler-errors:is-poly, r=BoxyUwUMatthias Krüger-10/+41
ConstBlocks are poly if their substs are poly r? `@BoxyUwU` fixes #106926
2023-01-17Rollup merge of #106869 - notriddle:notriddle/item-decl-pre-rust, ↵Matthias Krüger-202/+202
r=GuillaumeGomez rustdoc: remove redundant item kind class from `.item-decl > pre` This class originated in the very first commit of `rustdoc_ng`, and was used to add a color border around the item decl based on its kind. https://github.com/rust-lang/rust/blob/4fd061c426902b0904c65e64a3780b21f9ab3afb/src/rustdoc_ng/html/static/main.css#L102-L106 The item decl no longer has a border, and there aren't any kind-specific styles in modern rustdoc's rendering of this UI item. Most of this PR is updating test cases so that they use `item-decl` to find the `<pre>` tag instead of relying on the fact that the class name had `rust {kind}` in it while other `<pre>` tags only had class `rust`.
2023-01-17Rollup merge of #106712 - Ezrashaw:impl-ref-trait, r=estebankMatthias Krüger-0/+117
make error emitted on `impl &Trait` nicer Fixes #106694 Turned out to be simpler than I thought, also added UI test. Before: ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=9bda53271ef3a8886793cf427b8cea91)) ```text error: expected one of `:`, ``@`,` or `|`, found `)` --> src/main.rs:2:22 | 2 | fn foo(_: impl &Trait) {} | ^ expected one of `:`, ``@`,` or `|` | = note: anonymous parameters are removed in the 2018 edition (see RFC 1685) help: if this is a parameter name, give it a type | 2 | fn foo(_: impl Trait: &TypeName) {} | ~~~~~~~~~~~~~~~~ help: if this is a type, explicitly ignore the parameter name | 2 | fn foo(_: impl _: &Trait) {} | ++ error: expected one of `!`, `(`, `)`, `,`, `?`, `for`, `~`, lifetime, or path, found `&` --> src/main.rs:2:16 | 2 | fn foo(_: impl &Trait) {} | -^ expected one of 9 possible tokens | | | help: missing `,` error: expected one of `!`, `(`, `,`, `=`, `>`, `?`, `for`, `~`, lifetime, or path, found `&` --> src/main.rs:3:11 | 3 | fn bar<T: &Trait>(_: T) {} | ^ expected one of 10 possible tokens ``` After: ```text error: expected a trait, found type --> <anon>:2:16 | 2 | fn foo(_: impl &Trait) {} | -^^^^^ | | | help: consider removing the indirection error: expected a trait, found type --> <anon>:3:11 | 3 | fn bar<T: &Trait>(_: T) {} | -^^^^^ | | | help: consider removing the indirection ```
2023-01-17Rollup merge of #106591 - Ezrashaw:attempted-integer-identifer, r=EstebankMatthias Krüger-0/+66
suggestion for attempted integer identifier in patterns Fixes #106552 Implemented a suggestion on `E0005` that occurs when no bindings are present and the pattern is a literal integer.
2023-01-17note -> helpMichael Goulet-25/+25
2023-01-17Fix use suggestion spanMichael Goulet-13/+13
2023-01-17rustdoc: Fix glob import inliningVadim Petrochenkov-0/+7
Filter away names that are not actually imported by the glob, e.g. because they are shadowed by something else
2023-01-16Constify `TypeId` ordering implsonestacked-22/+30
2023-01-16Properly pluralize 'generic constants'Michael Goulet-11/+11
2023-01-16ConstBlocks are poly if their substs are polyMichael Goulet-0/+31
2023-01-16Rollup merge of #106940 - oli-obk:tait_error, r=compiler-errorsMatthias Krüger-69/+51
Improve a TAIT error and add an error code plus documentation cc https://github.com/rust-lang/rust/issues/106858
2023-01-16Rollup merge of #106912 - gftea:pr-106736, r=NilstriebMatthias Krüger-0/+8
check -Z query-dep-graph is enabled if -Z dump-dep-graph (#106736) PR to solve #106736, r? `@cjgillot`
2023-01-16Improve a TAIT error and add an error code plus documentationOli Scherer-69/+51
2023-01-16Auto merge of #106853 - TimNN:undo-remap, r=oli-obkbors-1/+62
Heuristically undo path prefix mappings. Because the compiler produces better diagnostics if it can find the source of (potentially remapped) dependencies. The new test fails without the other changes in this PR. Let me know if you have better suggestions for the test directory. I moved the existing remapping test to be in the same location as the new one. Some more context: I'm exploring running UI tests with remapped paths by default in https://github.com/rust-lang/rust/pull/105924 and this was one of the issues discovered. This may also be useful in the context of https://github.com/rust-lang/rfcs/pull/3127 ("New rustc and Cargo options to allow path sanitisation by default").
2023-01-16comments feedbackyukang-3/+21
2023-01-16Auto merge of #106850 - cjgillot:issue-106141, r=oli-obkbors-7/+90
Make the inlining destination a Local. Fixes https://github.com/rust-lang/rust/issues/106141
2023-01-16check -Z query-dep-graph is enabled if -Z dump-dep-graph (#106736)gftea-0/+8
2023-01-16Auto merge of #106872 - dtolnay:nbsp, r=fee1-deadbors-3/+3
Emit only one nbsp error per file Fixes #106101. See https://github.com/rust-lang/rust/issues/106098 for an explanation of how someone would end up with a large number of these nbsp characters in their source code, which is why I think rustc needs to handle this specific case in a friendlier way.
2023-01-15Auto merge of #106914 - matthiaskrgr:rollup-yh0x4gq, r=matthiaskrgrbors-19/+121
Rollup of 5 pull requests Successful merges: - #106888 (Add tidy check to ensure that rustdoc GUI tests start with a small description) - #106896 (suggest `is_empty` for collections when casting to `bool`) - #106900 (Fix regression in `unused_braces` with macros) - #106906 (remove redundant clones) - #106909 (Only suggest adding type param if path being resolved was a type) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-15Rollup merge of #106909 - compiler-errors:only-types-can-be, r=estebankMatthias Krüger-15/+1
Only suggest adding type param if path being resolved was a type
2023-01-15Rollup merge of #106900 - clubby789:unused-braces-regression, r=estebankMatthias Krüger-1/+21
Fix regression in `unused_braces` with macros Fixes #106899
2023-01-15Rollup merge of #106896 - Ezrashaw:str-cast-bool-emptyness, r=compiler-errorsMatthias Krüger-3/+97
suggest `is_empty` for collections when casting to `bool` Fixes #106883 Matches on slices, `String` and `str`. It would be nice to do this with something like `Deref<Target=str>` as well, but AFAIK it's not possible in this part of the compiler.
2023-01-15Rollup merge of #106888 - GuillaumeGomez:tidy-gui-test, r=notriddleMatthias Krüger-0/+2
Add tidy check to ensure that rustdoc GUI tests start with a small description The first commit comes from https://github.com/rust-lang/rust/pull/106865 to prevent CI to fail. This PR adds a tidy check to enforce having a small description at the top of the GUI test. Although the format is made to be as easy as possible to read, it's not always obvious what a test is actually checking. I think enforcing this will make it easier for us to come back on these tests if needed. r? `@notriddle`