about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-03-21Rollup merge of #95175 - lcnr:adt_const_params-tracking-issue, r=Dylan-DPCMatthias Krüger-41/+3
move `adt_const_params` to its own tracking issue the new tracking issue is #95174 r? ``@rust-lang/project-const-generics``
2022-03-21Rollup merge of #95129 - GuillaumeGomez:rm-source-sidebar-animation, r=jshaMatthias Krüger-1/+0
Remove animation on source sidebar Fixes https://github.com/rust-lang/rust/issues/95043. Didn't upload a demo considering how simple it is to test in a browser. :) r? ``@jsha``
2022-03-21Rollup merge of #95116 - bjorn3:cg_clif_test_fixes, r=Dylan-DPCMatthias Krüger-88/+107
Add needs-* directives to many tests These are necessary to ignore tests that need features unsupported by cg_clif.
2022-03-21Rollup merge of #95085 - ouz-a:master5, r=jackh726Matthias Krüger-0/+49
Return err instead of ICE Having `escaping_bound_vars` results in ICE when trying to create `ty::Binder::dummy`, to avoid it we return err like the line above. I think this requires a more sophisticated fix, I would love to investigate if mentorship is available 🤓 Fixes #95023 and #85350
2022-03-21Add needs-asm-support directive to tests where necessarybjorn3-68/+80
2022-03-21Return err instead of ICEouz-a-0/+49
2022-03-21move `adt_const_params` to its own tracking issuelcnr-41/+3
2022-03-21Auto merge of #95169 - Smittyvb:union-test-ub, r=bjorn3bors-54/+107
Don't run UB in test suite This splits `ui/unsafe/union.rs` to make it so only the non-UB parts are run. It also means we can do more testing of the location of error messages (which are a bit different with the THIR unsafety checker). `union-modification.rs` has no UB (according to Miri), and `union.rs` has errors (but would have UB if not for those errors). Closes #95075. r? `@bjorn3`
2022-03-21Don't run UB in test suiteSmitty-54/+107
This splits ui/unsafe/union.rs to make it so only the non-UB parts are run. It also means we can do more testing of the location of error messages.
2022-03-21Auto merge of #95104 - compiler-errors:remove-ascription, r=davidtwcobors-0/+80
suggest removing type ascription in bad parsing position Not sure how to test this with the non-nightly suggestion. Didn't add a new UI test because it already manifests in an existing UI test. Fixes #95014
2022-03-20Rollup merge of #95135 - ↵Matthias Krüger-0/+17
TaKO8Ki:fix-not-emitted-unmatched-angle-bracket-error, r=Dylan-DPC Fix a not emitted unmatched angle bracket error closes #95128
2022-03-20fix a not emitted unmatched angle bracket errorTakayuki Maeda-0/+17
2022-03-20Rollup merge of #94948 - jhpratt:rustc_deprecated, r=Dylan-DPCMatthias Krüger-1/+1
Fix diagnostics for `#![feature(deprecated_suggestion)]` Follow up from #94635, where I missed a couple things.
2022-03-20Auto merge of #95063 - tromey:fix-94458-gdb-char, r=Mark-Simulacrumbors-8/+25
Fix debuginfo tests with GDB 11.2 GDB 11.2 added support for DW_ATE_UTF, which caused some test failures. This fixes these tests by changing the format that is used, and adds a new test to verify that characters are emitted as something that GDB can print in a char-like way. Fixes #94458
2022-03-19Remove animation on source sidebarGuillaume Gomez-1/+0
2022-03-19Add needs-unwind directive to tests where necessarybjorn3-20/+27
2022-03-19Extend --check-cfg tests to all predicate inside all/anyLoïc BRANSTETT-1/+117
2022-03-18suggest removing type ascription in bad positionMichael Goulet-0/+80
2022-03-18Rollup merge of #94295 - Urgau:cfg-always-eval-all-predicate, r=petrochenkovMatthias Krüger-0/+45
Always evaluate all cfg predicate in all() and any() This pull-request adjust the handling of the `all()` and `any()` to always evaluate every cfg predicate because not doing so result in accepting incorrect `cfg`: ```rust #[cfg(any(unix, foo::bar))] // Should error on foo::bar, but does not on unix platform (but does on non unix platform) fn foo1() {} #[cfg(all(foo, foo::bar))] // Should error on foo::bar, but does not fn foo2() {} #[cfg(all(foo::bar, foo))] // Correctly error on foo::bar fn foo3() {} #[cfg(any(foo::bar, foo))] // Correctly error on foo::bar fn foo4() {} ``` This pull-request take the side to directly turn it into a hard error instead of having a future incompatibility lint because the combination to get this incorrect behavior is unusual and highly probable that some code have this without noticing. A [search](https://cs.github.com/?scopeName=All+repos&scope=&q=lang%3Arust+%2Fany%5C%28%5Ba-zA-Z%5D%2C+%5Ba-zA-Z%5D%2B%3A%3A%5Ba-zA-Z%5D%2B%2F) on Github reveal no such instance nevertheless a Crater run should probably be done before merging this. This was discover in https://github.com/rust-lang/rust/pull/94175 when trying to lint on the second predicate. Also note that this seems to have being introduce with Rust 1.27.0: https://rust.godbolt.org/z/KnfqKv15f. r? `@petrochenkov`
2022-03-18Auto merge of #95065 - matthiaskrgr:rollup-75i6oz5, r=matthiaskrgrbors-13/+32
Rollup of 4 pull requests Successful merges: - #95013 (Update browser-ui-test version to 0.8.2) - #95039 (Make negative coherence work when there's impl negative on super predicates) - #95047 (Refactor: remove an unnecessary pattern for ignoring all parts) - #95048 (update Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-18Rollup merge of #95039 - spastorino:overlap-super-predicates, r=nikomatsakisMatthias Krüger-13/+32
Make negative coherence work when there's impl negative on super predicates r? `@nikomatsakis`
2022-03-18Auto merge of #88098 - Amanieu:oom_panic, r=nagisabors-0/+23
Implement -Z oom=panic This PR removes the `#[rustc_allocator_nounwind]` attribute on `alloc_error_handler` which allows it to unwind with a panic instead of always aborting. This is then used to implement `-Z oom=panic` as per RFC 2116 (tracking issue #43596). Perf and binary size tests show negligible impact.
2022-03-17Fix debuginfo tests with GDB 11.2Tom Tromey-8/+25
GDB 11.2 added support for DW_ATE_UTF, which caused some test failures. This fixes these tests by changing the format that is used, and adds a new test to verify that characters are emitted as something that GDB can print in a char-like way. Fixes #94458
2022-03-18Auto merge of #95056 - Dylan-DPC:rollup-swtuw2n, r=Dylan-DPCbors-13/+187
Rollup of 10 pull requests Successful merges: - #91133 (Improve `unsafe` diagnostic) - #93222 (Make ErrorReported impossible to construct outside `rustc_errors`) - #93745 (Stabilize ADX target feature) - #94309 ([generator_interior] Be more precise with scopes of borrowed places) - #94698 (Remove redundant code from copy-suggestions) - #94731 (Suggest adding `{ .. }` around a const function call with arguments) - #94960 (Fix many spelling mistakes) - #94982 (Add deprecated_safe feature gate and attribute, cc #94978) - #94997 (debuginfo: Fix ICE when generating name for type that produces a layout error.) - #95000 (Fixed wrong type name in comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-17Rollup merge of #94997 - michaelwoerister:fix-enum-type-name-layout-error, ↵Dylan DPC-0/+44
r=wesleywiser debuginfo: Fix ICE when generating name for type that produces a layout error. Fixes https://github.com/rust-lang/rust/issues/94961.
2022-03-17Rollup merge of #94982 - skippy10110:deprecated_safe, r=Dylan-DPCDylan DPC-0/+28
Add deprecated_safe feature gate and attribute, cc #94978
2022-03-17Rollup merge of #94960 - codehorseman:master, r=oli-obkDylan DPC-4/+4
Fix many spelling mistakes Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-17Rollup merge of #94731 - TaKO8Ki:const-generic-expr-recovery, ↵Dylan DPC-0/+75
r=davidtwco,oli-obk Suggest adding `{ .. }` around a const function call with arguments closes #91020
2022-03-17Rollup merge of #94309 - eholk:issue-57017, r=tmandryDylan DPC-0/+22
[generator_interior] Be more precise with scopes of borrowed places Previously the generator interior type checking analysis would use the nearest temporary scope as the scope of a borrowed value. This ends up being overly broad for cases such as: ```rust fn status(_client_status: &Client) -> i16 { 200 } fn main() { let client = Client; let g = move || match status(&client) { _status => yield, }; assert_send(g); } ``` In this case, the borrow `&client` could be considered in scope for the entirety of the `match` expression, meaning it would be viewed as live across the `yield`, therefore making the generator not `Send`. In most cases, we want to use the enclosing expression as the scope for a borrowed value which will be less than or equal to the nearest temporary scope. This PR changes the analysis to use the enclosing expression as the scope for most borrows, with the exception of borrowed RValues which are true temporary values that should have the temporary scope. There's one further exception where borrows of a copy such as happens in autoref cases also should be ignored despite being RValues. Joint work with `@nikomatsakis` Fixes #57017 r? `@tmandry`
2022-03-17Rollup merge of #93222 - mark-i-m:errorreported, r=oli-obkDylan DPC-8/+8
Make ErrorReported impossible to construct outside `rustc_errors` There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name. cc #69426 `@varkor` `@eddyb` `@estebank` I actually didn't see that I was assigned to this issue until now...
2022-03-17Rollup merge of #91133 - terrarier2111:unsafe-diagnostic, r=jackh726Dylan DPC-1/+6
Improve `unsafe` diagnostic This fixes: https://github.com/rust-lang/rust/issues/90880 I didn't use the exact proposed messages though.
2022-03-17This test now worksSantiago Pastorino-13/+2
2022-03-17Make negative coherence work when there's impl negative on super predicatesSantiago Pastorino-0/+18
2022-03-16erase late-bound regions in dyn projection types for debuginfoMichael Goulet-0/+7
2022-03-16Add double negative trait test caseSantiago Pastorino-0/+12
2022-03-16rustc_error: make ErrorReported impossible to constructmark-8/+8
There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name.
2022-03-16debuginfo: Fix ICE when generating name for type that produces a layout error.Michael Woerister-0/+44
2022-03-16resolve the conflict in compiler/rustc_session/src/parse.rscodehorseman-4/+4
Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-16Auto merge of #94987 - Dylan-DPC:rollup-5tssuhi, r=Dylan-DPCbors-18/+340
Rollup of 5 pull requests Successful merges: - #94868 (Format core and std macro rules, removing needless surrounding blocks) - #94951 (Extend the irrefutable_let_patterns lint to let chains) - #94955 (Refactor: Use `format_args_capture` in some parts of `rustc_parse`) - #94957 (Improve the explanation about the behaviour of read_line) - #94974 (Ensure that `let_else` does not interact with `let_chains`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-16Rollup merge of #94974 - c410-f3r:let-chain-dashufwrqwemkf-let-else, ↵Dylan DPC-0/+173
r=joshtriplett Ensure that `let_else` does not interact with `let_chains` As requested on https://github.com/rust-lang/rust/pull/94927. cc `@joshtriplett` `@estebank`
2022-03-16Rollup merge of #94951 - est31:irrefutable_let_chain_patterns, r=estebankDylan DPC-10/+159
Extend the irrefutable_let_patterns lint to let chains Implements the suggestion from https://github.com/rust-lang/rust/pull/94927#issuecomment-1067078300 We only look for complete suffixes or prefixes of irrefutable let patterns, so that an irrefutable let pattern in a chain surrounded by refutable ones is not linted, as it is an useful pattern that has no low-cost replacement (unlike suffixes or prefixes which can just be copied outside of the `if`: either into the `if`'s block, or the block surrounding the `if`). If all patterns in a let chain are irrefutable, we lint as well. Depends on #94958 ~~so I included it into the PR for now~~ *which has been merged since*. r? `@estebank` cc `@joshtriplett` `@c410-f3r`
2022-03-16Rollup merge of #94868 - dtolnay:noblock, r=Dylan-DPCDylan DPC-8/+8
Format core and std macro rules, removing needless surrounding blocks Many of the asserting and printing macros in `core` and `std` are written with prehistoric-looking formatting, like this: https://github.com/rust-lang/rust/blob/335ffbfa547df94ac236f5c56130cecf99c8d82b/library/std/src/macros.rs#L96-L101 In modern Rust style this would conventionally be written as follows instead, always using braces and a trailing semicolon on the macro arms: https://github.com/rust-lang/rust/blob/af53809c874e0afb7be966df4d3cfcaa05277c53/library/std/src/macros.rs#L98-L105 Getting rid of the unneeded braces inside the expansion reduces extraneous indentation in macro-expanded code. For example: ```rust println!("repro {}", true); ``` ```rust // before: { ::std::io::_print( ::core::fmt::Arguments::new_v1( &["repro ", "\n"], &[::core::fmt::ArgumentV1::new_display(&true)], ), ); }; ``` ```rust // after: ::std::io::_print( ::core::fmt::Arguments::new_v1( &["repro ", "\n"], &[::core::fmt::ArgumentV1::new_display(&true)], ), ); ```
2022-03-16Auto merge of #94861 - aDotInTheVoid:rdj-trait-tests, r=CraftSpiderbors-0/+150
rustdoc-json: More tests, and better jsondocck errors Helps with #81359 r? `@CraftSpider` `@rustbot` modify labels: +A-rustdoc-json +T-rustdoc +A-testsuite
2022-03-15Bless coverage-reports after core macro blocks changeDavid Tolnay-4/+4
2022-03-15Include tracking issue in diagnosticJacob Pratt-1/+1
2022-03-16Extend the irrefutable_let_patterns lint to let chainsest31-10/+159
Only look for complete suffixes or prefixes of irrefutable let patterns, so that an irrefutable let pattern in a chain surrounded by refutable ones is not linted, as it is an useful pattern.
2022-03-15Auto merge of #94925 - lcnr:relax-sus-auto-impls, r=estebankbors-1/+22
relax `suspicious_auto_trait_impls` lint wrt lifetimes fixes the warning for https://github.com/rust-lang/rust/issues/93367#issuecomment-1063993489.
2022-03-15Add deprecated_safe feature gate and attribute, cc #94978skippy10110-0/+28
2022-03-15Auto merge of #94973 - GuillaumeGomez:more-gui-tests, r=notriddlebors-19/+26
Add GUI test to check URLs The first commit merges both file doing kinda the same thing. Didn't make much sense to keep them separated. The second commit add checks to ensure the URL has the expected value depending if the search is displayed or not. r? `@notriddle`
2022-03-15Ensure that `let_else` does not interact with `let_chains`Caio-0/+173