about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-10-26Rollup merge of #102951 - SparrowLii:type_annotation, r=estebankDylan DPC-0/+98
suggest type annotation for local statement initialed by ref expression In a local statement with a type declaration, if a ref expression is used on the right side and not used on the left side, in addition to removing the `&` and `&mut` on the right side, we can add them on the left side alternatively Fixes #102892
2022-10-26Auto merge of #103279 - compiler-errors:normalize-hack-back, r=lcnrbors-0/+31
Add eval hack in `super_relate_consts` back Partially reverts 01adb7e98d5656c06497f33dd2747df144e78356. This extra eval call *still* needs to happen, for example, in `normalize_param_env_or_error` when a param-env predicate has an unnormalized constant, since the param-env candidates never get normalized during candidate assembly (everywhere else we can assume that they are normalized fully). r? `@lcnr,` though I feel like I've assigned quite a few PRs to you in the last few days, so feel free to reassign to someone else familiar with this code if you're busy! cc #103243 (fixes the issue, but don't want to auto-close that until a backport is performed).
2022-10-25Modify ui tests to reflect the changeByron Zhong-10/+11
2022-10-26Auto merge of #103158 - Bryanskiy:resolve_perf, r=petrochenkovbors-6/+6
Perf improvements for effective visibility calculating related to https://github.com/rust-lang/rust/pull/102026 r? `@petrochenkov`
2022-10-25diagnostics: add test case for issue 102354Michael Howell-0/+34
2022-10-26add testcase for suggest selfyukang-1/+28
2022-10-25Add regression test for inlined doc comment on impl blockGuillaume Gomez-0/+13
2022-10-25Pinning tests for some macro_rules things discussed in the lang meetingScott McMurray-0/+28
2022-10-26suggest calling the method of the same name when method not foundyukang-4/+49
2022-10-25Name impl trait in region bound suggestionMichael Goulet-23/+23
2022-10-25Move a wf-check into the site where the value is instantiatedOli Scherer-12/+12
2022-10-25adopt to compiler changesMaybe Waffle-9/+20
2022-10-25add a test for gate `impl_trait_in_fn_trait_return`Maybe Waffle-0/+21
2022-10-25--blessMaybe Waffle-89/+106
2022-10-25Add even more tests for `impl Fn() -> impl Trait`Maybe Waffle-1/+53
2022-10-25Add more tests for `impl Fn() -> impl Trait`Maybe Waffle-0/+106
2022-10-25Allow `impl Fn() -> impl Trait` in return positionMaybe Waffle-66/+61
This allows writing the following function signatures: ```rust fn f0() -> impl Fn() -> impl Trait; fn f3() -> &'static dyn Fn() -> impl Trait; ``` These signatures were already allowed for common traits and associated types, there is no reason why `Fn*` traits should be special in this regard.
2022-10-25Fix #103451, find_width_of_character_at_span return width with 1 when ↵yukang-0/+37
reaching end
2022-10-25Perf improvements for effective visibility calculatingBryanskiy-6/+6
2022-10-25add a test to verify that compile-flags are provided lastPietro Albini-0/+8
2022-10-25Added helper to prevent verbose printing from the `PrettyPrinter` when ↵Sarthak Singh-0/+13
printing constants
2022-10-25Auto merge of #102988 - dpaoliello:inlinerawdylib, r=dpaoliellobors-0/+102
Support raw-dylib functions being used inside inlined functions Fixes #102714 Issue Details: When generating the import library for `raw-dylib` symbols, we currently only use the functions and variables declared within the current crate. This works fine if all crates are static libraries or `rlib`s as the generated import library will be contained in the static library or `rlib` itself, but if a dependency is a dynamic library AND the use of a `raw-dylib` function or variable is inlined or part of a generic instantiation then the current crate won't see its dependency's import library and so linking will fail. Fix Details: Instead, when we generate the import library for a `dylib` or `bin` crate, we will now generate it for the symbols both for the current crate and all upstream crates. We do this in two steps so that the import library for the current crate is passed into the linker first, thus it is preferred if there are any ambiguous symbols.
2022-10-24rustdoc: parse self-closing tags and attributes in `invalid_html_tags`Michael Howell-0/+150
Fixes #103460
2022-10-24Support raw-dylib functions being used inside inlined functionsDaniel Paoliello-0/+102
2022-10-25Rollup merge of #103493 - notriddle:notriddle/source-sidebar-logo, ↵Yuki Okushi-1/+1
r=GuillaumeGomez rustdoc: remove unused `.sidebar-logo` DOM on source pages
2022-10-25Rollup merge of #103486 - ↵Yuki Okushi-52/+89
GuillaumeGomez:cleanup-rustdoc-gui-highlight-colors, r=notriddle Use functions in highlight-colors rustdoc GUI test r? ``@notriddle``
2022-10-25Rollup merge of #103409 - compiler-errors:rpitit-signature-mismatch, r=lcnrYuki Okushi-0/+37
Delay span bug when we can't map lifetimes back in `collect_trait_impl_trait_tys` When a lifetime is late-bound in a trait signature, but early-bound in an impl signature, we already emit an error -- however, we also ICE in `collect_trait_impl_trait_tys`, so just delay a bug here. Fixes #103407
2022-10-25Rollup merge of #103382 - compiler-errors:anon-apit-lt-region-ice, r=cjgillotYuki Okushi-0/+28
Don't ICE when reporting borrowck errors involving regions from `anonymous_lifetime_in_impl_trait` The issue here is that when we have: ``` trait Trait<'a> { .. } fn foo(arg: impl Trait) { .. } ``` The anonymous lifetime `'_` that we generate for `arg: impl Trait` doesn't end up in the argument type (which is a param) but in a where-clause of the function, in a predicate whose self type is that param ty. Fixes #101660 r? ``@cjgillot``
2022-10-25Rollup merge of #103350 - clubby789:refer-to-assoc-method, r=wesleywiserYuki Okushi-9/+44
Change terminology for assoc method suggestions when they are not called Fixes #103325 ```@rustbot``` label +A-diagnostics
2022-10-25Rollup merge of #103333 - chenyukang:yukang/fix-103143, r=wesleywiserYuki Okushi-0/+25
Fix assertion failed for break_last_token and trailing token Fixes #103143
2022-10-24Add more normalization and testsmejrs-8/+95
2022-10-24Address some commentsmejrs-0/+17
2022-10-24Delay span bug when we can't map lifetimes back in collect_trait_impl_trait_tysMichael Goulet-0/+37
2022-10-24Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard errorAaron Hill-100/+36
2022-10-24rustdoc: remove unused `.sidebar-logo` DOM on source pagesMichael Howell-1/+1
2022-10-24Use functions in highlight-colors rustdoc GUI testGuillaume Gomez-52/+89
2022-10-24Auto merge of #94063 - Aaron1011:pretty-print-rental, r=lcnrbors-105/+321
Only apply `ProceduralMasquerade` hack to older versions of `rental` The latest version of `rental` (v0.5.6) contains a fix that allows it to compile without relying on the pretty-print back-compat hack. Hopefully, there are no longer any crates relying on the affected versions of the (much less popular) `procedural-masquerade` crate. This should allow us to target the pretty-print back-compat hack specifically to older versions of `rental`, and specifically mention upgrading to `rental` v0.5.6 in the lint message.
2022-10-24Rollup merge of #99939 - saethlin:pre-sort-tests, r=thomcc,jackh726Yuki Okushi-0/+82
Sort tests at compile time, not at startup Recently, another Miri user was trying to run `cargo miri test` on the crate `iced-x86` with `--features=code_asm,mvex`. This configuration has a startup time of ~18 minutes. That's ~18 minutes before any tests even start to run. The fact that this crate has over 26,000 tests and Miri is slow makes a lot of code which is otherwise a bit sloppy but fine into a huge runtime issue. Sorting the tests when the test harness is created instead of at startup time knocks just under 4 minutes out of those ~18 minutes. I have ways to remove most of the rest of the startup time, but this change requires coordinating changes of both the compiler and libtest, so I'm sending it separately. (except for doctests, because there is no compile-time harness)
2022-10-24fix parentheses surrounding spacing issue in parseryukang-5/+27
2022-10-24suggest type annotation for local statement initialed by ref expressionSparrowLii-0/+98
2022-10-24Port `dead_code` lints to be translatable.Charles Lew-6/+6
2022-10-24fix #103435, unused lint won't produce invalid codeyukang-0/+75
2022-10-23rustdoc: don't mark Box<T> as Iterator, Read, etcJacob Hoffman-Andrews-0/+38
Because Box<T> has pass-through implementations, rustdoc was giving it the "Notable Traits" treatment for Iterator, Read, Write, and Future, even when the type of T was unspecified. Pin had the same problem, but just for Future.
2022-10-24fix #103425, remove extra type error after missing semicolon erroryukang-0/+44
2022-10-23`unchecked_{shl|shr}` should use `u32` as the RHSScott McMurray-0/+65
2022-10-23Cleanup message and bless testsJack Huey-15/+15
2022-10-23Enable varargs support for calling conventions other than C or cdeclSoveu-21/+104
This patch makes it possible to use varargs for calling conventions, which are either based on C (like efiapi) or C is based on them (for example sysv64 and win64).
2022-10-23Rollup merge of #103434 - ↵Michael Howell-38/+17
GuillaumeGomez:gui-test-jump-to-def-background-cleanup, r=notriddle Use functions for jump-to-def-background rustdoc GUI test r? `@notriddle`
2022-10-23Rollup merge of #103414 - compiler-errors:rpit-print-lt, r=cjgillotMichael Howell-21/+21
Pretty print lifetimes captured by RPIT This specifically makes the output in #103409 change from: ```diff error: `impl` item signature doesn't match `trait` item signature --> $DIR/signature-mismatch.rs:15:5 | LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>; | ----------------------------------------------------------------- expected `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` ... LL | fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '2` | = note: expected `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` - found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` + found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '2` = help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait` = help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output error: aborting due to previous error ``` Along with the UI tests in this PR, which I think are all improvements! r? `@oli-obk` though feel free to re-roll
2022-10-23Rollup merge of #103402 - joshtriplett:niche-wrap-fix, r=oli-obkMichael Howell-51/+69
Fix wrapped valid-range handling in ty_find_init_error Rust's niche handling allows for wrapping valid ranges with end < start; for instance, a valid range with start=43 and end=41 means a niche of 42. Most places in the compiler handle this correctly, but `ty_find_init_error` assumed that `lo > 0` means the type cannot contain a zero. Fix it to handle wrapping ranges.