about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2021-06-29Auto merge of #86594 - dns2utf8:move_label_to_symbol, r=GuillaumeGomezbors-10/+55
rustdoc: Move label to symbol Implements #86578 depends on #85651 r? `@GuillaumeGomez` # Screenshot of mobile ![grafik](https://user-images.githubusercontent.com/739070/123267064-1be07f80-d4ec-11eb-8bdb-0b18a41908dc.png) # Screenshot on desktop ![grafik](https://user-images.githubusercontent.com/739070/123267204-46323d00-d4ec-11eb-97ca-2750421352f4.png)
2021-06-29Auto merge of #86704 - JohnTitor:rollup-lnrxo4i, r=JohnTitorbors-1395/+720
Rollup of 7 pull requests Successful merges: - #86059 (Add new tool to check HTML) - #86529 (Add support for OpenSSL 3.0.0) - #86657 (Fix `future_prelude_collision` false positive) - #86661 (Editon 2021 enables precise capture) - #86671 (Turn non_fmt_panic into a future_incompatible edition lint.) - #86673 (Make disjoint_capture_migration an edition lint.) - #86678 (Fix garbled suggestion for missing lifetime specifier) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-06-29Rollup merge of #86678 - FabianWolff:issue-86667, r=jackh726Yuki Okushi-0/+43
Fix garbled suggestion for missing lifetime specifier This PR fixes #86667. The suggestion code currently checks whether there is a generic parameter that is not a synthetic `impl Trait` parameter and, if so, suggests to insert a new lifetime `'a` before that generic parameter. However, it does not make sense to insert `'a` in front of an elided lifetime parameter, since these are synthetic as well, which leads to the garbled suggestion in #86667.
2021-06-29Rollup merge of #86673 - m-ou-se:disjoint-capture-edition-lint, r=nikomatsakisYuki Okushi-104/+186
Make disjoint_capture_migration an edition lint. This turns the disjoint capture lint into an edition lint, and changes all the wording to refer to the edition. This includes the same first commit as https://github.com/rust-lang/rust/pull/86671. See https://github.com/rust-lang/rust/pull/86671. Fixes most of https://github.com/rust-lang/project-rfc-2229/issues/43#issuecomment-869188197
2021-06-29Rollup merge of #86671 - m-ou-se:non-fmt-panic-future-incompatible, ↵Yuki Okushi-12/+24
r=nikomatsakis Turn non_fmt_panic into a future_incompatible edition lint. This turns the `non_fmt_panic` lint into a future_incompatible edition lint, so it becomes part of the `rust_2021_compatibility` group. See https://github.com/rust-lang/rust/issues/85894. This lint produces both warnings about semantical changes (e.g. `panic!("{{")`) and things that will become hard errors (e.g. `panic!("{")`). So I added a `explain_reason: false` that supresses the default "this will become a hard error" or "the semantics will change" message, and instead added a note depending on the situation. (cc `@rylev)` r? `@nikomatsakis`
2021-06-29Rollup merge of #86661 - sexxi-goose:edition_fix, r=nikomatsakisYuki Okushi-1279/+451
Editon 2021 enables precise capture r? `@nikomatsakis`
2021-06-29Rollup merge of #86657 - jam1garner:future_prelude_false_positive, ↵Yuki Okushi-0/+16
r=nikomatsakis Fix `future_prelude_collision` false positive Fixes #86633 The lint for checking if method resolution of methods named `try_into` will fail in 2021 edition previously would fire on all inherent methods, however for inherent methods that consume `self`, this takes priority over `TryInto::try_into` due to being inherent, while trait method and methods that take `&self` or `&mut self` don't take priority, and thus aren't affected by this false positive. This fix is rather simple: simply checking if the inherent method doesn't auto-deref or auto-ref (and thus takes `self`) and if so, prevents the lint from firing.
2021-06-28Auto merge of #86669 - Smittyvb:satisfy-windows-defender, r=Mark-Simulacrumbors-1/+1
Don't run a publically reachable server in tests This causes Windows Defender's firewall to pop up during tests to ask if I want to allow the test program to access the public Internet, since it was listening on `0.0.0.0` (the test passes regardless of how you respond to the modal, since the firewall only affects traffic outside of the computer, none of which actually happens in the test). The test server doesn't actually need to be publicly reachable, so this makes it so it is only reachable locally, which makes Windows Defender happy.
2021-06-28Add test for item-table with resize to mobileStefan Schindler-10/+55
2021-06-29Rollup merge of #86688 - JohnTitor:test-65384, r=jackh726Yuki Okushi-0/+30
Add a regression test for issue-65384 Closes #65384 r? `@jackh726`
2021-06-29Rollup merge of #86358 - klensy:pp-loop, r=Mark-SimulacrumYuki Okushi-3/+20
fix pretty print for `loop`
2021-06-29Rollup merge of #86206 - FabianWolff:issue-86188, r=Mark-SimulacrumYuki Okushi-29/+167
Fix type checking of return expressions outside of function bodies This pull request fixes #86188. The problem is that the current code for type-checking `return` expressions stops if the `return` occurs outside of a function body, while the correct behavior is to continue type-checking the return value expression (otherwise an ICE happens later on because variables declared in the return value expression don't have a type). Also, I have noticed that it is sometimes not obvious why a `return` is outside of a function body; for instance, in the example from #86188 (which currently causes an ICE): ```rust fn main() { [(); return || { let tx; }] } ``` I have changed the error message to also explain why the `return` is considered outside of the function body: ``` error[E0572]: return statement outside of function body --> ice0.rs:2:10 | 1 | / fn main() { 2 | | [(); return || { | |__________^ 3 | || let tx; 4 | || }] | ||_____^ the return is part of this body... 5 | | } | |_- ...not the enclosing function body ```
2021-06-28Add a regression test for issue-65384Yuki Okushi-0/+30
2021-06-27Editon 2021 enables precise captureAman Arora-1279/+451
2021-06-28Fix garbled suggestion for missing lifetime specifierFabian Wolff-0/+43
2021-06-27Auto merge of #85359 - lrh2000:reserved-prefixes, r=nikomatsakisbors-0/+406
Reserve prefixed identifiers and literals (RFC 3101) This PR denies any identifiers immediately followed by one of three tokens `"`, `'` or `#`, which is stricter than the requirements of RFC 3101 but may be necessary according to the discussion at [Zulip]. [Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/268952-edition-2021/topic/reserved.20prefixes/near/238470099 The tracking issue #84599 says we'll add a feature gate named `reserved_prefixes`, but I don't think I can do this because it is impossible for the lexer to know whether a feature is enabled or not. I guess determining the behavior by the edition information should be enough. Fixes #84599
2021-06-27Auto merge of #86445 - sexxi-goose:box_fix, r=nikomatsakisbors-8/+130
2229: Capture box completely in move closures Even if the content from box is used in a sharef-ref context, we capture the box entirerly. This is motivated by: 1) We only capture data that is on the stack. 2) Capturing data from within the box might end up moving more data than the user anticipated. Closes https://github.com/rust-lang/project-rfc-2229/issues/50 r? `@nikomatsakis`
2021-06-27Make disjoint_capture_migration an edition lint.Mara Bos-104/+186
2021-06-27Turn non_fmt_panic into a future_incompatible edition lint.Mara Bos-12/+24
2021-06-27Don't run a publically reachable server in testsSmitty-1/+1
This causes Windows Defender's firewall to pop up during tests to ask if I want to allow the test program to access the public Internet, since it was listening on `0.0.0.0`. The test server doesn't actually need to be publically reachable, so this makes it so it is only reachable locally, which makes Windows Defender happy.
2021-06-27Update and bless tests for const read out of boundsAlbin Hedman-28/+36
2021-06-27Update and bless tests for copy intrinsicAlbin Hedman-67/+20
2021-06-27Fix the test copy-intrinsicAlbin Hedman-50/+31
2021-06-27Bring back tests removed in 'Revert PRs 81238 and 82967 (which made copy and ↵Albin Hedman-0/+144
copy_nonoverlapping' 5f6016f1259142de7ab1f186f412fa3ca26607a8
2021-06-27Bless out_of_bounds_read testAlbin Hedman-26/+29
2021-06-27Revert "With the revert of PR 83091, `swap` is not a `const fn` anymore."Albin Hedman-9/+2
This reverts commit 34deda3cc250c2607a68cda75fe256f43b110fdc.
2021-06-27Revert "Remove tests that were also added in PR 79684."Albin Hedman-0/+75
This reverts commit e118a2cbf1e590cb5a7586ad01c6c3431c2b4f48.
2021-06-27Auto merge of #85448 - nanguye2496:nanguye2496/debuginfo_tests, ↵bors-5/+337
r=Mark-Simulacrum Add debug info tests for range, fix-sized array, and cell types This PR add several debug info tests to guarantee that the displays of fixed sized arrays, range types, cell types, threads, locks, and mutexes in CDB are correct. It also updates CDB tests for slices in pretty-std.rs after string visualization in WinDbg is fixed by this PR: #81898.
2021-06-27Fix `future_prelude_collision` false positivejam1garner-0/+16
2021-06-27Auto merge of #86645 - FabianWolff:issue-82328, r=LeSeulArtichautbors-0/+30
Fix ICE with `-Zunpretty=hir,typed` This PR fixes #82328. The `-Zunpretty=hir,typed` pretty-printer maintains an `Option` with type-checking results and sets the `Option` to `Some` when entering a body. However, this leads to an ICE if an expression occurs in a function signature (i.e. outside of a body), such as `128` in ```rust fn foo(-128..=127: i8) {} ``` This PR fixes the ICE by checking (if necessary) whether the expression's owner has a body, and retrieving type-checking results for that on the fly.
2021-06-26Update reserved prefixes test for new edition lint wording.Mara Bos-15/+15
2021-06-26Reorder some lines in `unpretty-expr-fn-arg.rs`Fabian Wolff-10/+10
2021-06-26Auto merge of #86449 - Stupremee:render-self-cast-in-type-bound, ↵bors-1/+30
r=GuillaumeGomez rustdoc: Render `<Self as X>::Y` type casts properly across crate bounds My last PR that introduced the type casting did not work for cross-crate re-exported traits, which is fixed in this PR. Fully resolves #85454
2021-06-26Add reserved_prefixe tests for macros from different editions.Mara Bos-0/+112
2021-06-26Add quote!() example to reserved_prefix lint test.Mara Bos-1/+34
2021-06-26Add test for the reserved_prefix migration lint.Mara Bos-0/+115
2021-06-26Update reserved-prefixes test output.Mara Bos-36/+54
2021-06-26Reserve prefixed identifiers and string literals (RFC 3101)lrh2000-0/+128
This commit denies any identifiers immediately followed by one of three tokens `"`, `'` or `#`, which is stricter than the requirements of RFC 3101 but may be necessary according to the discussion at [Zulip]. [Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/268952-edition-2021/topic/reserved.20prefixes/near/238470099
2021-06-26Fix ICE with `-Zunpretty=hir,typed` when an expression occurs in a function ↵Fabian Wolff-0/+30
signature
2021-06-26Auto merge of #85682 - m-ou-se:array-into-iter-2, r=nikomatsakisbors-77/+202
Update array_into_iter lint for 1.53 and edition changes. This updates the array_into_iter lint for Rust 1.53 and the edition changes. See https://github.com/rust-lang/rust/issues/84513 r? `@estebank`
2021-06-26Fix array-into-iter tests.Mara Bos-13/+18
2021-06-26Remove issue-78660-cap-lints-future-compat test.Mara Bos-10/+0
2021-06-26Add test for suggestion of array_into_iter in for loop.Mara Bos-1/+19
2021-06-26Update tests for updated array_into_iter lint.Mara Bos-54/+166
2021-06-26Auto merge of #84814 - Stupremee:properly-render-hrtbs, r=GuillaumeGomezbors-12/+61
Properly render HRTBs ```rust pub fn test<T>() where for<'a> &'a T: Iterator, {} ``` This will now render properly including the `for<'a>` ![image](https://user-images.githubusercontent.com/39732259/116808426-fe6ce600-ab38-11eb-9452-f33f554fbb8e.png) I do not know if this covers all cases, it only covers everything that I could think of that includes `for` and lifetimes in where bounds. Also someone need to mentor me on how to add a proper rustdoc test for this. Resolves #78482
2021-06-26Auto merge of #86586 - Smittyvb:https-everywhere, r=petrochenkovbors-10/+10
Use HTTPS links where possible While looking at #86583, I wondered how many other (insecure) HTTP links were in `rustc`. This changes most other `http` links to `https`. While most of the links are in comments or documentation, there are a few other HTTP links that are used by CI that are changed to HTTPS. Notes: - I didn't change any to or in licences - Some links don't support HTTPS :( - Some `http` links were dead, in those cases I upgraded them to their new places (all of which used HTTPS)
2021-06-26Auto merge of #86622 - FabianWolff:issue-83475, r=jonas-schievinkbors-0/+20
Check that `#[cmse_nonsecure_entry]` is applied to a function definition This PR fixes #83475. The compiler currently neglects to check whether `#[cmse_nonsecure_entry]` is applied to a function (and not, say, a struct) definition, leading to an ICE later on when the type checker attempts to retrieve the function signature. I have fixed this problem by adding an appropriate check to the `check_attr` pass, so that an error is reported instead of an ICE.
2021-06-25Add debug info tests for range, fix-sized array, and cell types.Nam Nguyen-5/+337
2021-06-25Auto merge of #86599 - Amanieu:asm_raw, r=nagisabors-22/+29
Add a "raw" option for asm! which ignores format string specifiers This is useful when including raw assembly snippets using `include_str!`.
2021-06-25Auto merge of #86627 - JohnTitor:rollup-ey29pc1, r=JohnTitorbors-577/+485
Rollup of 5 pull requests Successful merges: - #86330 (Change how edition based future compatibility warnings are handled) - #86513 (Rustdoc: Do not list impl when trait has doc(hidden)) - #86592 (Use `#[non_exhaustive]` where appropriate) - #86608 (chore(rustdoc): remove unused members of RenderType) - #86624 (Update compiler-builtins) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup