about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-01-17rustdoc: add test cases for settings radio button layoutMichael Howell-0/+27
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-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-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-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`
2023-01-15Auto merge of #106393 - the8472:use-ptr-sub, r=scottmcmbors-0/+1
Simplify manual ptr arithmetic in slice::Iter with ptr_sub The old code was introduced in #61885, which predates the ptr_sub method and underlying intrinsic. The codegen test still passes. r? `@scottmcm`
2023-01-15replace manual ptr arithmetic with ptr_subThe 8472-0/+1
2023-01-15Only suggest adding type param if path being resolved was a typeMichael Goulet-15/+1
2023-01-15Auto merge of #106171 - compiler-errors:consolidate-extract_callable_info, ↵bors-0/+34
r=estebank,lcnr Consolidate two almost duplicated fn info extraction routines Moves `extract_callable_info` up to trait selection, because it was being (almost) duplicated fully there for similar diagnostic purposes. This also generalizes the diagnostics we can give slightly (see UI test).
2023-01-15Add small description to GUI testGuillaume Gomez-0/+2
2023-01-15suggest `is_empty` for collections when casting to `bool`Ezra Shaw-3/+97
2023-01-15Fix regression in `unused_braces` with macrosclubby789-1/+21
2023-01-15Rollup merge of #106879 - JohnTitor:issue-42114, r=compiler-errorsMatthias Krüger-0/+20
Add regression test for #42114 Closes #42114 r? compiler-errors Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-15Rollup merge of #106878 - JohnTitor:issue-92157, r=compiler-errorsMatthias Krüger-0/+51
Add regression test for #92157 Closes #92157 r? compiler-errors Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-15Rollup merge of #106865 - GuillaumeGomez:add-gui-test-explanation, r=notriddleMatthias Krüger-0/+2
Add explanation comment for GUI test r? `@notriddle`
2023-01-15Rollup merge of #106859 - tialaramex:master, r=NilstriebMatthias Krüger-0/+60
Suggestion for type mismatch when we need a u8 but the programmer wrote a char literal Today Rust just points out that we have a char and we need a u8, but if I wrote 'A' then I could fix this by just writing b'A' instead. This code should detect the case where we're about to report a type mismatch of this kind, and the programmer wrote a char literal, and the char they wrote is ASCII, so therefore just prefixing b to make a byte literal will do what they meant. I have definitely written this mistake more than once, it's not difficult to figure out what to do, but the compiler might as well tell us anyway. I provided a test with two simple examples where the suggestion is appropriate, and one where it is not because the char literal is not ASCII, showing that the suggestion is only triggered in the former cases. I have contributed only a small typo doc fix before, so this is my first substantive rustc change.
2023-01-15Rollup merge of #106072 - eopb:dyn-derive, r=estebankMatthias Krüger-0/+35
fix: misleading "add dyn keyword before derive macro" suggestion Fixes #106071
2023-01-15make error emitted on `impl &Trait` nicerEzra Shaw-0/+117
2023-01-14Improve E0308: suggest user meant to use byte literal, w/ tests and fixNick Lamb-0/+60
suggested by Nilstrieb Co-authored-by: nils <48135649+Nilstrieb@users.noreply.github.com>
2023-01-15Add regression test for #42114Yuki Okushi-0/+20
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-15Add regression test for #92157Yuki Okushi-0/+51
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-14Emit only one nbsp error per fileDavid Tolnay-40/+1
2023-01-14Add more nbsp to unicode-chars testDavid Tolnay-4/+43
2023-01-14rustdoc: remove redundant item kind class from `.item-decl > pre`Michael Howell-202/+202
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 commit 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-14Rollup merge of #106828 - notriddle:notriddle/notable-trait-docblock, ↵Matthias Krüger-5/+5
r=GuillaumeGomez rustdoc: remove `docblock` class from notable trait popover This commit builds on b72de9be74dd5ac1d8b23d5ece03a7690274a14c, which removes the `docblock` class from the All Items page, and 9457380ac902db3febf92077c5b645db55998ad4, which removes the `docblock` class from the item decl. Fixes #92974
2023-01-14Rollup merge of #106820 - m-ou-se:macro-type-error-thing, r=estebankMatthias Krüger-13/+18
Deprioritize fulfillment errors that come from expansions. Fixes (part of?) #69455
2023-01-14Rollup merge of #106563 - clubby789:gce-macro-braces, r=TaKO8KiMatthias Krüger-1/+15
Fix `unused_braces` on generic const expr macro call Fixes #106545 `@rustbot` label +A-const-generics +A-lint
2023-01-14Add explanation for GUI testGuillaume Gomez-0/+2