about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-04-12Auto merge of #110252 - matthiaskrgr:rollup-ovaixra, r=matthiaskrgrbors-463/+205
Rollup of 8 pull requests Successful merges: - #109810 (Replace rustdoc-ui/{c,z}-help tests with a stable run-make test ) - #110035 (fix: ensure bad `#[test]` invocs retain correct AST) - #110089 (sync::mpsc: synchronize receiver disconnect with initialization) - #110103 (Report overflows gracefully with new solver) - #110122 (Fix x check --stage 1 when download-ci-llvm=false) - #110133 (Do not use ImplDerivedObligationCause for inherent impl method error reporting) - #110135 (Revert "Don't recover lifetimes/labels containing emojis as character literals") - #110235 (Fix `--extend-css` option) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-12Rollup merge of #110235 - GuillaumeGomez:fix-extend-css, r=notriddleMatthias Krüger-2/+27
Fix `--extend-css` option Fixes #110002. The file was generated in the wrong folder so I moved it into `static.files` as it made more sense to have there instead of changing the path in the templates. I also added a GUI test to ensure that this option won't break unexpectedly again.
2023-04-12Rollup merge of #110135 - compiler-errors:revert-108031, r=davidtwcoMatthias Krüger-135/+4
Revert "Don't recover lifetimes/labels containing emojis as character literals" Reverts PR #108031 per https://github.com/rust-lang/rust/pull/109754#issuecomment-1490452045 Fixes (doesnt close until beta backported) #109746 This reverts commit e3f9db5fc319c6d8eee5d47d216ea6a426070c41. This reverts commit 98b82aedba3f3f581e89df54352914b27f42c6f7. This reverts commit 380fa264132ad481e73cbbf0f3a0feefd99a1d78.
2023-04-12Rollup merge of #110133 - compiler-errors:issue-110131, r=petrochenkovMatthias Krüger-0/+87
Do not use ImplDerivedObligationCause for inherent impl method error reporting We were constructing a `TraitRef` out of impl substs, for an *inherent* impl that has no corresponding trait. Instead of doing that, let's construct a meaningful obligation cause code, and instead adjust the error reporting machinery to handle that correctly. Fixes #110131 cc #106702, which introduced this regression
2023-04-12Rollup merge of #110103 - compiler-errors:new-solver-overflows, r=lcnrMatthias Krüger-11/+12
Report overflows gracefully with new solver avoid reporting overflows as ambiguity errors, so that the error message is clearer. r? ```@lcnr```
2023-04-12Rollup merge of #110035 - Ezrashaw:improve-test-attr-expansion-code, r=davidtwcoMatthias Krüger-32/+57
fix: ensure bad `#[test]` invocs retain correct AST Fixes #109816 Ensures that a `StmtKind::Item` doesn't get converted into a plain `Item` (causing the ICE from the linked issue) Also unifies the error path a bit.
2023-04-12Rollup merge of #109810 - jyn514:rustdoc-opt-tests, r=TaKO8KiMatthias Krüger-283/+18
Replace rustdoc-ui/{c,z}-help tests with a stable run-make test This make rustdoc resilient to changes in the debugging options while still testing that it matches rustc. Fixes https://github.com/rust-lang/rust/issues/109391.
2023-04-12Auto merge of #110249 - matthiaskrgr:rollup-7iig04q, r=matthiaskrgrbors-237/+351
Rollup of 8 pull requests Successful merges: - #110153 (Fix typos in compiler) - #110165 (rustdoc: use CSS `overscroll-behavior` instead of JavaScript) - #110175 (Symbol cleanups) - #110203 (Remove `..` from return type notation) - #110205 (rustdoc: make settings radio and checks thicker, less contrast) - #110222 (Improve the error message when forwarding a matched fragment to another macro) - #110237 (Split out a separate feature gate for impl trait in associated types) - #110241 (tidy: Issue an error when UI test limits are too high) Failed merges: - #110218 (Remove `ToRegionVid`) r? `@ghost` `@rustbot` modify labels: rollup
2023-04-12Rollup merge of #110237 - oli-obk:impl_trait_in_assoc_tys, r=jackh726Matthias Krüger-138/+193
Split out a separate feature gate for impl trait in associated types in https://github.com/rust-lang/rust/issues/107645 it was decided that we'll take a new route for type alias impl trait. The exact route isn't clear yet, so while I'm working on implementing some of these proposed changes (e.g. in https://github.com/rust-lang/rust/pull/110010) to be able to experiment with them, I will also work on stabilizing another sugar version first: impl trait in associated types. Similarly I'll look into creating feature gates for impl trait in const/static types. This PR does nothing but split the feature gate, so that you need to enable a different feature gate for ```rust impl Trait for Type { type Assoc = impl SomeTrait; } ``` than what you need for `type Foo = impl SomeTrait;`
2023-04-12Rollup merge of #110222 - lovelymono:rustc-expand-mbe-diagnostic, r=davidtwcoMatthias Krüger-1/+3
Improve the error message when forwarding a matched fragment to another macro Adds a link to [Forwarding a matched fragment](https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment) section of the Rust Reference, and suggests a possible fix (using `:tt` instead in the macro definition). Also removes typos from the original message, it should be `:lifetime` instead of `$lifetime`. ## Motivation When trying to write a macro which uses a literal in the matcher from the outer macro, like the following one, using a fragment specified that isn't one of `:ident`, `:lifetime`, or `:tt` currently results in a hard to understand message. ```rs macro_rules! make_t_for_all_tokens { ($($name:literal as $variant:expr,)*) => { macro_rules! t { $( ($name) => { $variant }; )* } }; } make_t_for_all_tokens! { "fn" as Token::Fn, "return" as Token::Return, "let" as Token::Let, } // This creates // // macro_rules! t { // ("fn") => { // Token::Fn // }; // ("return") => { // Token::Return // }; // ("let") => { // Token::Let // }; // } t!["fn"]; ``` ### Before ``` error: no rules expected the token `"fn"` --> src/main.rs:103:10 | 32 | macro_rules! t { | -------------- when calling this macro ... 103 | t!["fn"]; | ^^^^ no rules expected this token in macro call | note: while trying to match `"fn"` --> src/main.rs:34:6 | 34 | ($name) => { | ^^^^^ ... 58 | / make_t_for_all_tokens! { 59 | | "fn" as Token::Fn, 60 | | "return" as Token::Return, 61 | | "let" as Token::Let, 62 | | } | |_- in this macro invocation = note: captured metavariables except for `$tt`, `$ident` and `$lifetime` cannot be compared to other tokens = note: this error originates in the macro `make_t_for_all_tokens` (in Nightly builds, run with -Z macro-backtrace for more info) ``` ### After ``` error: no rules expected the token `"fn"` --> src/main.rs:103:10 | 32 | macro_rules! t { | -------------- when calling this macro ... 103 | t!["fn"]; | ^^^^ no rules expected this token in macro call | note: while trying to match `"fn"` --> src/main.rs:34:6 | 34 | ($name) => { | ^^^^^ ... 58 | / make_t_for_all_tokens! { 59 | | "fn" as Token::Fn, 60 | | "return" as Token::Return, 61 | | "let" as Token::Let, 62 | | } | |_- in this macro invocation = note: captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens = note: see https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment for more information = help: try using `:tt` instead in the macro definition = note: this error originates in the macro `make_t_for_all_tokens` (in Nightly builds, run with -Z macro-backtrace for more info) ``` ## Unresolved questions - Preferrably the suggestion should be attached to the `$name:literal` part of the outer macro, instead of being in the notes section at the end. But I'm not familiar with how the compiler works at all, and I have no idea how to approach this kind of solution. - `@Nilstrieb` raised a question that the suggestion of adding `:tt` isn't accurate when there's more than `tt` being matched, for example when the input is an `item`.
2023-04-12Rollup merge of #110205 - notriddle:notriddle/pixelated-border, r=GuillaumeGomezMatthias Krüger-7/+70
rustdoc: make settings radio and checks thicker, less contrast This is very dependent on subjectivity and what screen you use, but this change makes the radio buttons' outer circle less ugly. This is because I could see the pixels very clearly, thanks to the very thin line and high contrast. This change makes both less severe, giving your browser's antialiasing algorithm more to work with. Since it's thicker, lowering the contrast shouldn't impact visibility. ## Preview https://notriddle.com/rustdoc-demo-html-3/pixelated-border/settings.html ## Before ![image](https://user-images.githubusercontent.com/1593513/231274191-143acbea-c433-4fb1-b46d-e5e4fe328d60.png) ## After ![image](https://user-images.githubusercontent.com/1593513/231287415-c1e59fe8-8bf8-489d-b607-95ebb71e4ac5.png) <details><summary>Original "after" image with 2px border around checked box</summary> ![image](https://user-images.githubusercontent.com/1593513/231274253-8b5011c6-82fb-4396-84d0-47b6bdff2260.png) </details>
2023-04-12Rollup merge of #110203 - compiler-errors:rtn-dots, r=eholkMatthias Krüger-46/+69
Remove `..` from return type notation `@nikomatsakis` and I decided that using `..` in the return-type notation syntax is probably overkill. r? `@eholk` since you reviewed the last one Since this is piggybacking now totally off of a pre-existing syntax (parenthesized generics), let me know if you need any explanation of the logic here, since it's a bit more complicated now.
2023-04-12Rollup merge of #110165 - notriddle:notriddle/overscroll-behavior, ↵Matthias Krüger-41/+12
r=GuillaumeGomez rustdoc: use CSS `overscroll-behavior` instead of JavaScript Fixes the desktop scrolling weirdness mentioned in https://github.com/rust-lang/rust/pull/98775#issuecomment-1182575603 Preview: https://notriddle.com/rustdoc-demo-html-3/overscroll-behavior/issue_107918/index.html As described in the [MDN overscroll-behavior] page: * The current Firefox ESR is 102, and the first Firefox version to support this feature is 59. * The current Chrome version 112, and the first version to support this is 63. * Edge is described as having a minor bug in `none` mode, but we use `contain` mode anyway, so it doesn't matter. * Safari 16, released September 2022, is the last browser to add this feature, and is also the oldest version we officially support. [MDN overscroll-behavior]: https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior
2023-04-12Rollup merge of #110153 - DaniPopes:compiler-typos, r=NilstriebMatthias Krüger-4/+4
Fix typos in compiler I ran [`typos -w compiler`](https://github.com/crate-ci/typos) to fix typos in the `compiler` directory. Refs #110150
2023-04-12Add/update tests for `--extend-css` optionGuillaume Gomez-2/+27
2023-04-12rustdoc: use CSS `overscroll-behavior` instead of JavaScriptMichael Howell-41/+12
Fixes the desktop scrolling weirdness mentioned in https://github.com/rust-lang/rust/pull/98775#issuecomment-1182575603 As described in the MDN page for this property: * The current Firefox ESR is 102, and the first Firefox version to support this feature is 59. * The current Chrome version 112, and the first version to support this is 63. * Edge is described as having a minor bug in `none` mode, but we use `contain` mode anyway, so it doesn't matter. * Safari 16, released September 2022, is the last browser to add this feature, and is also the oldest version we officially support.
2023-04-12Split out a separate feature gate for impl trait in associated typesOli Scherer-138/+193
2023-04-12rustdoc: make settings radio and checks thicker, less contrastMichael Howell-7/+70
This is very dependent on subjectivity and what screen you use, but this change makes the radio buttons' outer circle less ugly. This is because I could see the pixels very clearly, thanks to the very thin line and high contrast. This change makes both less severe, giving your browser's antialiasing algorithm more to work with. Since it's thicker, lowering the contrast shouldn't impact visibility.
2023-04-12Rollup merge of #110209 - JohnTitor:issue-59003, r=compiler-errorsMatthias Krüger-0/+18
Add regression test for #59003 Closes #59003 r? compiler-errors
2023-04-12Rollup merge of #110190 - cbeuw:mir-offset, r=oli-obkMatthias Krüger-0/+21
Custom MIR: Support `BinOp::Offset` Since offset doesn't have an infix operator, a new function `Offset` is added which is lowered to `Rvalue::BinaryOp(BinOp::Offset, ..)` r? ```@oli-obk``` or ```@tmiasko``` or ```@JakobDegen```
2023-04-12Rollup merge of #109959 - JakobDegen:transmute-validate, r=compiler-errorsMatthias Krüger-0/+17
Fix transmute intrinsic mir validation ICE I stumbled across this at work, the minimal reproducer is included as a test which ICEs before this change. I'm not 100% sure this is the right fix, but it matches what we do in `mir_assign_valid_types` so seems reasonable at least. fixes #110151 r? `@lcnr` since they've been keeping the relevant logic correct, cc `@scottmcm`
2023-04-12compiler: print the suggestion only for local macrosLena Milizé-1/+1
And wrap the link in the diagnostic in angle brackets. Signed-off-by: Lena Milizé <me@lvmn.org>
2023-04-12Auto merge of #109935 - michaelwoerister:fix-feed-in-eval-always, r=cjgillotbors-0/+16
incr.comp.: Make sure dependencies are recorded when feeding queries during eval-always queries. This PR makes sure we don't drop dependency edges when feeding queries during an eval-always query. Background: During eval-always queries, no dependencies are recorded because the system knows to unconditionally re-evaluate them regardless of any actual dependencies. This works fine for these queries themselves but leads to a problem when feeding other queries: When queries are fed, we set up their dependency edges by copying the current set of dependencies of the feeding query. But because this set is empty for eval-always queries, we record no edges at all -- which has the effect that the fed query instances always look "green" to the system, although they should always be "red". The fix is to explicitly add a dependency on the artificial "always red" dep-node when feeding during eval-always queries. Fixes https://github.com/rust-lang/rust/issues/108481 Maybe also fixes issue https://github.com/rust-lang/rust/issues/88488. cc `@jyn514` r? `@cjgillot` or `@oli-obk`
2023-04-12Replace rustdoc-ui/{c,z}-help tests with a run-make testJynn Nelson-283/+18
This make rustdoc resilient to changes in the debugging options while still testing that it matches rustc.
2023-04-12compiler: improve captured metavariables diagnosticLena Milizé-1/+3
Adds a link to the relevant part of The Rust Reference in the eror message, and suggests a possible fix (replacing the fragment specifier with :tt in the macro definition). Fixes typos in the original message. Signed-off-by: Lena Milizé <me@lvmn.org>
2023-04-12Auto merge of #107614 - ↵bors-56/+117
compiler-errors:allow-elaborator-to-filter-only-super-traits, r=oli-obk Split implied and super predicate queries, then allow elaborator to filter only supertraits Split the `super_predicates_of` query into a new `implied_predicates_of` query. The former now only returns the *real* supertraits of a trait alias, and the latter now returns the implied predicates (which include all of the `where` clauses of the trait alias). The behavior of these queries is identical for regular traits. Now that the two queries are split, we can add a new filter method to the elaborator, `filter_only_self()`, which can be used in instances that we need only the *supertrait* predicates, such as during the elaboration used in closure signature deduction. This toggles the usage of `super_predicates_of` instead of `implied_predicates_of` during elaboration of a trait predicate. This supersedes #104745, and fixes the four independent bugs identified in that PR. Fixes #104719 Fixes #106238 Fixes #110023 Fixes #109514 r? types
2023-04-12Auto merge of #110214 - compiler-errors:rollup-mkig4t6, r=compiler-errorsbors-122/+1118
Rollup of 10 pull requests Successful merges: - #96971 (Initial support for loongarch64-unknown-linux-gnu) - #109894 (Remove Errors section from var_os docs) - #110000 (Rename tests/ui/unique to tests/ui/box/unit) - #110018 (Pass host linker to compiletest.) - #110104 ( Reword the docstring in todo! macro definition, fixing a typo) - #110113 (Fix `x test ui --target foo` when download-rustc is enabled) - #110126 (Support safe transmute in new solver) - #110155 (Fix typos in librustdoc, tools and config files) - #110162 (rustdoc: remove redundant expandSection code from main.js) - #110173 (kmc-solid: Implement `Socket::read_buf`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-11Rollup merge of #110126 - compiler-errors:new-solver-safe-transmute, r=oli-obkMichael Goulet-121/+1117
Support safe transmute in new solver Basically copies the same implementation as the old solver, but instead of looking for param types, we look for type or const placeholders.
2023-04-11Rollup merge of #110000 - reez12g:issue-109878, r=jackh726Michael Goulet-0/+0
Rename tests/ui/unique to tests/ui/box/unit fixes https://github.com/rust-lang/rust/issues/109878 Since tests/ui/box already exists, I have temporarily named it boxed-box, but if another name sounds better, please let me know.
2023-04-11Rollup merge of #96971 - zhaixiaojuan:master, r=wesleywiserMichael Goulet-1/+1
Initial support for loongarch64-unknown-linux-gnu Hi, We hope to add a new port in rust for LoongArch. LoongArch intro LoongArch is a RISC style ISA which is independently designed by Loongson Technology in China. It is divided into two versions, the 32-bit version (LA32) and the 64-bit version (LA64). LA64 applications have application-level backward binary compatibility with LA32 applications. LoongArch is composed of a basic part (Loongson Base) and an expanded part. The expansion part includes Loongson Binary Translation (LBT), Loongson VirtualiZation (LVZ), Loongson SIMD EXtension (LSX) and Loongson Advanced SIMD EXtension(LASX). Currently the LA464 processor core supports LoongArch ISA and the Loongson 3A5000 processor integrates 4 64-bit LA464 cores. LA464 is a four-issue 64-bit high-performance processor core. It can be used as a single core for high-end embedded and desktop applications, or as a basic processor core to form an on-chip multi-core system for server and high-performance machine applications. Documentations: ISA: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html ABI: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html More docs can be found at: https://loongson.github.io/LoongArch-Documentation/README-EN.html Since last year, we have locally adapted two versions of rust, rust1.41 and rust1.57, and completed the test locally. I'm not sure if I'm submitting all the patches at once, so I split up the patches and here's one of the commits
2023-04-12Auto merge of #109895 - nikic:llvm-16-tests, r=cuviperbors-0/+118
Add codegen tests for issues fixed by LLVM 16 Fixes #75978. Fixes #99960. Fixes #101048. Fixes #101082. Fixes #101814. Fixes #103132. Fixes #103327.
2023-04-11Auto merge of #110194 - GuillaumeGomez:update-browser-ui-test, r=notriddlebors-308/+308
Update browser-ui-test version This update add the support for expressions, so we can now do this: ``` assert: 1 > 2 && ["a"] != ["b", "c"] ``` It also improved commands naming and updated puppeteer version. r? `@notriddle`
2023-04-12Add regression test for #59003Yuki Okushi-0/+18
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-04-11Allow the elaborator to only filter to real supertraitsMichael Goulet-0/+34
2023-04-11Broken testsMichael Goulet-0/+72
2023-04-11Split implied and super predicate queriesMichael Goulet-56/+11
2023-04-11Update rustdoc GUI tests to new browser-ui-test versionGuillaume Gomez-308/+308
2023-04-11Make test compatible with 32-bitNikita Popov-1/+1
2023-04-11Auto merge of #110092 - clubby789:builtin-macros-translatable, r=compiler-errorsbors-16/+28
Migrate most of `rustc_builtin_macros` to diagnostic impls cc #100717 This is a couple of days work, but I decided to stop for now before the PR becomes too big. There's around 50 unresolved failures when `rustc::untranslatable_diagnostic` is denied, which I'll finish addressing once this PR goes thtough A couple of outputs have changed, but in all instances I think the changes are an improvement/are more consistent with other diagnostics (although I'm happy to revert any which seem worse)
2023-04-11Add Offset binary op to custom mirAndy Wang-0/+21
2023-04-11Auto merge of #109765 - petrochenkov:encodeless, r=cjgillotbors-7/+16
rustc_metadata: Filter encoded data more aggressively using `DefKind` I focused on data that contains spans, because spans are expensive to encode/decode/hash, but also touched `should_encode_visibility` too. One incorrect use of impl visibility in diagnostics is also replaced with trait visibility.
2023-04-11Add ignore-debug to two testsNikita Popov-0/+2
These don't optimize with debug assertions. For one of them, this is due to the new alignment checks, for the other I'm not sure what specifically blocks it.
2023-04-11rename tests/ui/unique to tests/ui/box/unitreez12g-0/+0
2023-04-11Auto merge of #110170 - JohnTitor:rollup-hdramer, r=JohnTitorbors-106/+245
Rollup of 8 pull requests Successful merges: - #109527 (Set up standard library path substitution in rust-gdb and gdbgui) - #109752 (Stall auto trait assembly in new solver for int/float vars) - #109860 (Add support for RISC-V relax target feature) - #109923 (Update `error [E0449]: unnecessary visibility qualifier` to be more clear) - #110070 (The `wrapping_neg` example for unsigned types shouldn't use `i8`) - #110146 (fix(doc): do not parse inline when output is json for external crate) - #110147 (Add regression test for #104916) - #110149 (Update books) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-11Rollup merge of #110147 - JohnTitor:issue-104916, r=compiler-errorsYuki Okushi-0/+22
Add regression test for #104916 Closes #104916 I haven't tested if it still passes with debug assertions enabled so it'd be better to wait for CI to be green. r? compiler-errors
2023-04-11Rollup merge of #110146 - bvanjoi:relative-110138, r=notriddleYuki Okushi-0/+11
fix(doc): do not parse inline when output is json for external crate relative #110138
2023-04-11Rollup merge of #109923 - ElectrifyPro:visibility, r=wesleywiserYuki Okushi-106/+162
Update `error [E0449]: unnecessary visibility qualifier` to be more clear This updates the error message `error[E0449]: unnecessary visibility qualifier` by clearly indicating that visibility qualifiers already inherit their visibility from a parent item. The error message previously implied that the qualifiers were permitted, which is not the case anymore. Resolves #109822.
2023-04-11Rollup merge of #109752 - ↵Yuki Okushi-0/+50
compiler-errors:new-solver-stall-auto-trait-for-num-var, r=lcnr Stall auto trait assembly in new solver for int/float vars Make sure that we don't match int/float vars against *all* manual auto trait impls due to this check: https://github.com/rust-lang/rust/blob/2fb0e8d162a021f8a795fb603f5d8c0017855160/compiler/rustc_trait_selection/src/solve/trait_goals.rs#L151-L169 Since `find_map_relevant_impl` treats all impls as candidates for int/float vars, due to the way that `fast_reject::simplify_type` works. This fixes compiler-errors/next-solver-hir-issues#11. r? ``@lcnr``
2023-04-11Auto merge of #109850 - MU001999:master, r=estebankbors-0/+60
Emits non-overlapping suggestions for arguments with wrong types Fixes #109831
2023-04-10Remove `..` from return type notationMichael Goulet-46/+69