about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-08-18Reword "Required because of the requirements on the impl of ..."Andy Wang-273/+273
2022-08-18Update rustdoc testGuillaume Gomez-5/+9
2022-08-18Auto merge of #99860 - oli-obk:revert_97346, r=pnkfelixbors-57/+47
Revert "Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, … …r=oli-obk" This reverts commit c703d11dccb4a895c7aead3b2fcd8cea8c483184, reversing changes made to 64eb9ab869bc3f9ef3645302fbf22e706eea16cf. it didn't apply cleanly, so now it works the same for RPIT and for TAIT instead of just working for RPIT, but we should keep those in sync anyway. It also exposed a TAIT bug (see the feature gated test that now ICEs). r? `@pnkfelix` fixes #99536
2022-08-18session: stabilize split debuginfo on linuxDavid Wood-24/+30
Stabilize the `-Csplit-debuginfo` flag... - ...on Linux for all values of the flag. Split DWARF has been implemented for a few months, hasn't had any bug reports and has had some promising benchmarking for incremental debug build performance. - ..on other platforms for the default value. It doesn't make any sense that `-Csplit-debuginfo=packed` is unstable on Windows MSVC when that's the default behaviour, but keep the other values unstable. Signed-off-by: David Wood <david.wood@huawei.com>
2022-08-18Update existing rustdoc-gui tests and add a new oneGuillaume Gomez-6/+248
2022-08-18Auto merge of #98655 - nnethercote:dont-derive-PartialEq-ne, r=dtolnaybors-192/+7
Don't derive `PartialEq::ne`. Currently we skip deriving `PartialEq::ne` for C-like (fieldless) enums and empty structs, thus reyling on the default `ne`. This behaviour is unnecessarily conservative, because the `PartialEq` docs say this: > Implementations must ensure that eq and ne are consistent with each other: > > `a != b` if and only if `!(a == b)` (ensured by the default > implementation). This means that the default implementation (`!(a == b)`) is always good enough. So this commit changes things such that `ne` is never derived. The motivation for this change is that not deriving `ne` reduces compile times and binary sizes. Observable behaviour may change if a user has defined a type `A` with an inconsistent `PartialEq` and then defines a type `B` that contains an `A` and also derives `PartialEq`. Such code is already buggy and preserving bug-for-bug compatibility isn't necessary. Two side-effects of the change: - There is only one error message produced for types where `PartialEq` cannot be derived, instead of two. - For coverage reports, some warnings about generated `ne` methods not being executed have disappeared. Both side-effects seem fine, and possibly preferable.
2022-08-18Update rustdoc-json test filesGuillaume Gomez-567/+552
2022-08-18Rollup merge of #100688 - compiler-errors:issue-100684, r=wesleywiserMatthias Krüger-0/+28
`ty::Error` does not match other types for region constraints Fixes #100684
2022-08-18Rollup merge of #100643 - ↵Matthias Krüger-2/+41
TaKO8Ki:point-at-type-parameter-shadowing-another-type, r=estebank Point at a type parameter shadowing another type This patch fixes a part of #97459.
2022-08-18Rollup merge of #97962 - eholk:drop-tracking-must-not-suspend, r=cjgillotMatthias Krüger-0/+57
Make must_not_suspend lint see through references when drop tracking is enabled See #97333. With drop tracking enabled, sometimes values that were previously linted are now considered dropped and not linted. This change makes must_not_suspend traverse through references to still catch these values. Unfortunately, this leads to duplicate warnings in some cases (e.g. [dedup.rs](https://cs.github.com/rust-lang/rust/blob/9a74608543d499bcc7dd505e195e8bfab9447315/src/test/ui/lint/must_not_suspend/dedup.rs#L4)), so we only use the new behavior when drop tracking is enabled. cc ``@guswynn``
2022-08-18Avoid overflow in is_impossible_methodMichael Goulet-0/+19
2022-08-17Add const-generics test.Camille GILLOT-0/+23
2022-08-17Add LLVM15-specific codegen test for `try`/`?`s that now optimize awayScott McMurray-0/+54
These still generated a bunch of code back in Rust 1.63 (<https://rust.godbolt.org/z/z31P8h6rz>), but with LLVM 15 merged they no longer do :tada:
2022-08-17Make same_type_modulo_infer a proper TypeRelationMichael Goulet-0/+67
2022-08-17Ignore substs when checking inlining history.Camille GILLOT-0/+25
2022-08-17ty::Error does not match other types for region constraintsMichael Goulet-0/+28
2022-08-17New ui tests for new soft feature gatesChristopher Durham-0/+131
2022-08-17Reenable early feature-gates as future-compat warningsChristopher Durham-8/+85
2022-08-17Rollup merge of #100652 - compiler-errors:no-defer-sized-checks, r=TaKO8KiMatthias Krüger-80/+27
Remove deferred sized checks (make them eager) Improves diagnostics spans... this doesn't seem to be the case anymore: ```rust // Some additional `Sized` obligations badly affect type inference. // These obligations are added in a later stage of typeck. pub(super) deferred_sized_obligations: RefCell<Vec<(Ty<'tcx>, Span, traits::ObligationCauseCode<'tcx>)>>, ```
2022-08-17Rollup merge of #100389 - compiler-errors:return-type-suggestion-cycle, ↵Matthias Krüger-0/+52
r=cjgillot Do not report cycle error when inferring return type for suggestion The UI test is a good example of a case where this happens. The cycle is due to needing the value of the return type `-> _` to compute the variances of items in the crate, but then needing the variances of the items in the crate to do typechecking to infer what `-> _`'s real type is. Since we're already gonna emit an error in astconv, just delay the cycle bug as an error.
2022-08-17Rollup merge of #99474 - aDotInTheVoid:rustdoc-json-noinline-test-cleanup, ↵Matthias Krüger-39/+69
r=CraftSpider Rustdoc json tests: New @hasexact test command Alot of the time, we wanted to assert that a module had an exact set of items. Most of the time this was done by asserting that the ```@count``` of the module was `n`, and then doing `n` ```@has``` checks on the module. This was tedious, so often shortcuts were done. This PR adds a new command to jsondocck to allow consistently expressing this behavior, and then uses it to clean up the tests. ``@rustbot`` modify labels: +A-rustdoc-json +A-testsuite
2022-08-17implied_bounds: clarify our assumptionslcnr-44/+95
2022-08-17add new test and combine old onesouz-a-47/+65
2022-08-17pass when where clause foundouz-a-0/+205
2022-08-16Update src/test/assembly/x86_64-floating-point-clamp.rsAlex-1/+1
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
2022-08-16Update src/test/assembly/x86_64-floating-point-clamp.rsAlex-0/+25
Simple Clamp Function I thought this was more robust and easier to read. I also allowed this function to return early in order to skip the extra bound check (I'm sure the difference is negligible). I'm not sure if there was a reason for binding `self` to `x`; if so, please correct me. Simple Clamp Function for f64 I thought this was more robust and easier to read. I also allowed this function to return early in order to skip the extra bound check (I'm sure the difference is negligible). I'm not sure if there was a reason for binding `self` to `x`; if so, please correct me. Floating point clamp test f32 clamp using mut self f64 clamp using mut self Update library/core/src/num/f32.rs Update f64.rs Update x86_64-floating-point-clamp.rs Update src/test/assembly/x86_64-floating-point-clamp.rs Update x86_64-floating-point-clamp.rs Co-Authored-By: scottmcm <scottmcm@users.noreply.github.com>
2022-08-16Remove deferred sized checksMichael Goulet-80/+27
2022-08-17Box the `MacCall` in various types.Nicholas Nethercote-55/+55
2022-08-16Auto merge of #100644 - TaKO8Ki:rollup-n0o6a1t, r=TaKO8Kibors-0/+11
Rollup of 4 pull requests Successful merges: - #100243 (Remove opt_remap_env_constness from rustc_query_impl) - #100625 (Add `IpDisplayBuffer` helper struct.) - #100629 (Use `merged_ty` method instead of rewriting it every time) - #100630 (rustdoc JSON: Fix ICE with `pub extern crate self as <self_crate_name>`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-17Rollup merge of #100630 - Enselic:export_extern_crate_as_self, r=GuillaumeGomezTakayuki Maeda-0/+11
rustdoc JSON: Fix ICE with `pub extern crate self as <self_crate_name>` Closes #100531 r? `@GuillaumeGomez` `@rustbot` labels +A-rustdoc-json +T-rustdoc
2022-08-17point at a type parameter shadowing another typeTakayuki Maeda-2/+41
2022-08-16Auto merge of #100626 - Dylan-DPC:rollup-mwbm7kj, r=Dylan-DPCbors-18/+91
Rollup of 6 pull requests Successful merges: - #99942 (Fix nonsense non-tupled `Fn` trait error) - #100609 (Extend invalid floating point literal suffix suggestion) - #100610 (Ast and parser tweaks) - #100613 (compiletest: fix typo in runtest.rs) - #100616 (:arrow_up: rust-analyzer) - #100622 (Support 128-bit atomics on all aarch64 targets) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-16rustdoc JSON: Fix ICE with `pub extern crate self as <self_crate_name>`Martin Nordholts-0/+11
2022-08-16Rollup merge of #100609 - chenyukang:fix-100527, r=davidtwcoDylan DPC-8/+56
Extend invalid floating point literal suffix suggestion Fixes #100527
2022-08-16Rollup merge of #99942 - compiler-errors:nonsense-un-tupled-fn-trait-error, ↵Dylan DPC-10/+35
r=cjgillot Fix nonsense non-tupled `Fn` trait error Given this code: ```rust #![feature(unboxed_closures)] fn a<F: Fn<usize>>(f: F) {} fn main() { a(|_: usize| {}); } ``` We currently emit this error: ``` error[E0631]: type mismatch in closure arguments --> src/main.rs:6:5 | 6 | a(|_: usize| {}); | ^ ---------- found signature of `fn(usize) -> _` | | | expected signature of `fn(usize) -> _` | note: required by a bound in `a` --> src/main.rs:3:9 | 3 | fn a<F: Fn<usize>>(f: F) {} | ^^^^^^^^^ required by this bound in `a` For more information about this error, try `rustc --explain E0631`. error: could not compile `playground` due to previous error ``` Notably, it says the same thing for "expected" and "found"! Fix the output so that we instead emit: ``` error[E0308]: mismatched types --> /home/gh-compiler-errors/test.rs:6:5 | 6 | a(|_: usize| {}); | ^ types differ | = note: expected trait `Fn<usize>` found trait `Fn<(usize,)>` note: required by a bound in `a` --> /home/gh-compiler-errors/test.rs:3:9 | 3 | fn a<F: Fn<usize>>(f: F) {} | ^^^^^^^^^ required by this bound in `a` error: aborting due to previous error ``` The error could still use some work, namely the "mismatched types" part, but I'm leaving it a bit rough since the only way you'd ever get this error is when you're messing with `#![feature(unboxed_closures)]`. Simply making sure we actually print out the difference in trait-refs is good enough for me. I could probably factor in some additional improvements if those are desired.
2022-08-16use proper words in help message for floating pointyukang-13/+13
2022-08-16Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errorsbors-0/+67
Fix #95079 unhelpful error when missing move in nested closure Fix #95079 by adding help for missing move in nested closure
2022-08-16Auto merge of #100441 - nnethercote:shrink-ast-Attribute, r=petrochenkovbors-100/+100
Shrink `ast::Attribute`. r? `@ghost`
2022-08-16Rollup merge of #100590 - TaKO8Ki:suggest-adding-array-length, r=compiler-errorsMatthias Krüger-21/+97
Suggest adding an array length if possible fixes #100448
2022-08-16Rollup merge of #100460 - cuviper:drop-llvm-12, r=nagisaMatthias Krüger-101/+1
Update the minimum external LLVM to 13 With this change, we'll have stable support for LLVM 13 through 15 (pending release). For reference, the previous increase to LLVM 12 was #90175. r? `@nagisa`
2022-08-16Rollup merge of #100384 - ridwanabdillahi:instr_profile_output, r=wesleywiserMatthias Krüger-0/+17
Add support for generating unique profraw files by default when using `-C instrument-coverage` Currently, enabling the rustc flag `-C instrument-coverage` instruments the given crate and by default uses the naming scheme `default.profraw` for any instrumented profile files generated during the execution of a binary linked against this crate. This leads to multiple binaries being executed overwriting one another and causing only the last executable run to contain actual coverage results. This can be overridden by manually setting the environment variable `LLVM_PROFILE_FILE` to use a unique naming scheme. This PR adds a change to add support for a reasonable default for rustc to use when enabling coverage instrumentation similar to how the Rust compiler treats generating these same `profraw` files when PGO is enabled. The new naming scheme is set to `default_%m_%p.profraw` to ensure the uniqueness of each file being generated using [LLVMs special pattern strings](https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#running-the-instrumented-program). Today the compiler sets the default for PGO `profraw` files to `default_%m.profraw` to ensure a unique file for each run. The same can be done for the instrumented profile files generated via the `-C instrument-coverage` flag as well which LLVM has API support for. Linked Issue: https://github.com/rust-lang/rust/issues/100381 r? `@wesleywiser`
2022-08-16Rollup merge of #100338 - lyming2007:issue-100285-fix, r=petrochenkovMatthias Krüger-0/+56
when there are 3 or more return statements in the loop emit the first 3 errors and duplicated diagnostic information modified: compiler/rustc_typeck/src/check/coercion.rs new file: src/test/ui/typeck/issue-100285.rs new file: src/test/ui/typeck/issue-100285.stderr
2022-08-16Make as_ref suggestion a noteMichael Goulet-76/+9
2022-08-16Do not report cycle error when inferring return type for suggestionMichael Goulet-0/+52
2022-08-16Extend invalid floating point literal suffix suggestionyukang-1/+49
2022-08-16Correct meaning of two UI testsMichael Goulet-34/+45
2022-08-16Fix error message with non-tupled bare fn traitMichael Goulet-35/+49
2022-08-16Shrink `ast::Attribute`.Nicholas Nethercote-100/+100
2022-08-16Do not allow Drop impl on foreign fundamental typesMichael Goulet-13/+44
2022-08-15when there are 3 or more return statements in the loopYiming Lei-0/+56
emit the first 3 errors and duplicated diagnostic information using take of iterator for the first third return modified: compiler/rustc_typeck/src/check/coercion.rs new file: src/test/ui/typeck/issue-100285.rs new file: src/test/ui/typeck/issue-100285.stderr