about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-07-02rustdoc: add test case for source sidebar spacingMichael Howell-0/+3
2022-07-02rustdoc: add test case for background color of the sidebar toggle buttonMichael Howell-0/+27
2022-07-02Auto merge of #97235 - nbdd0121:unwind, r=Amanieubors-14/+124
Fix FFI-unwind unsoundness with mixed panic mode UB maybe introduced when an FFI exception happens in a `C-unwind` foreign function and it propagates through a crate compiled with `-C panic=unwind` into a crate compiled with `-C panic=abort` (#96926). To prevent this unsoundness from happening, we will disallow a crate compiled with `-C panic=unwind` to be linked into `panic-abort` *if* it contains a call to `C-unwind` foreign function or function pointer. If no such call exists, then we continue to allow such mixed panic mode linking because it's sound (and stable). In fact we still need the ability to do mixed panic mode linking for std, because we only compile std once with `-C panic=unwind` and link it regardless panic strategy. For libraries that wish to remain compile-once-and-linkable-to-both-panic-runtimes, a `ffi_unwind_calls` lint is added (gated under `c_unwind` feature gate) to flag any FFI unwind calls that will cause the linkable panic runtime be restricted. In summary: ```rust #![warn(ffi_unwind_calls)] mod foo { #[no_mangle] pub extern "C-unwind" fn foo() {} } extern "C-unwind" { fn foo(); } fn main() { // Call to Rust function is fine regardless ABI. foo::foo(); // Call to foreign function, will cause the crate to be unlinkable to panic-abort if compiled with `-Cpanic=unwind`. unsafe { foo(); } //~^ WARNING call to foreign function with FFI-unwind ABI let ptr: extern "C-unwind" fn() = foo::foo; // Call to function pointer, will cause the crate to be unlinkable to panic-abort if compiled with `-Cpanic=unwind`. ptr(); //~^ WARNING call to function pointer with FFI-unwind ABI } ``` Fix #96926 `@rustbot` label: T-compiler F-c_unwind
2022-07-02Auto merge of #91743 - cjgillot:enable_mir_inlining_inline_all, r=oli-obkbors-112/+145
Enable MIR inlining Continuation of https://github.com/rust-lang/rust/pull/82280 by `@wesleywiser.` #82280 has shown nice compile time wins could be obtained by enabling MIR inlining. Most of the issues in https://github.com/rust-lang/rust/issues/81567 are now fixed, except the interaction with polymorphization which is worked around specifically. I believe we can proceed with enabling MIR inlining in the near future (preferably just after beta branching, in case we discover new issues). Steps before merging: - [x] figure out the interaction with polymorphization; - [x] figure out how miri should deal with extern types; - [x] silence the extra arithmetic overflow warnings; - [x] remove the codegen fulfilment ICE; - [x] remove the type normalization ICEs while compiling nalgebra; - [ ] tweak the inlining threshold.
2022-07-02Handle fresh lifetimes on bare trait objects.Camille GILLOT-71/+2
2022-07-02Add known bug test.Camille GILLOT-0/+118
2022-07-02Fix bug in `rustdoc -Whelp`Joshua Nelson-392/+26
Previously, this printed the debugging options, not the lint options, and only handled `-Whelp`, not `-A/-D/-F`. This also fixes a few other misc issues: - Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests - Add lint headers for tool lints, not just builtin lints - Remove duplicate run-make test
2022-07-02Rollup merge of #98653 - TaKO8Ki:add-regression-test-for-79494, ↵Dylan DPC-0/+17
r=Mark-Simulacrum Add regression test for #79494 closes #79494
2022-07-01Improve spans for specialization errorMichael Goulet-11/+11
2022-07-01rustdoc: add test cases for :focus on sidebar details elementsMichael Howell-0/+42
2022-07-01Auto merge of #98781 - GuillaumeGomez:rollup-798kb8u, r=GuillaumeGomezbors-89/+154
Rollup of 5 pull requests Successful merges: - #97249 (`<details>`/`<summary>` UI fixes) - #98418 (Allow macOS to build LLVM as shared library) - #98460 (Use CSS variables to handle theming) - #98497 (Improve some inference diagnostics) - #98708 (rustdoc: fix 98690 Panic if invalid path for -Z persist-doctests) Failed merges: - #98761 (more `need_type_info` improvements) r? `@ghost` `@rustbot` modify labels: rollup
2022-07-01Rollup merge of #98708 - pinkforest:rustdoc-fix-98690, r=GuillaumeGomezGuillaume Gomez-0/+11
rustdoc: fix 98690 Panic if invalid path for -Z persist-doctests Closes #98690 for rustdoc panic I changed this to do eprintln and orderly panic instead of unwrap doing unhandled panic ~/gg/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc --test -Z unstable-options --persist-doctests /tmp/foobar main.rs Couldn't create directory for doctest executables: Permission denied (os error 13)
2022-07-01Rollup merge of #98497 - compiler-errors:span-inference-note, r=lcnrGuillaume Gomez-89/+108
Improve some inference diagnostics - Properly point out point location where "type must be known at this point", or else omit the note if it's not associated with a useful span. - Fix up some type ambiguity diagnostics, errors shouldn't say "cannot infer type for reference `&'a ()`" when the given type has no inference variables.
2022-07-01Rollup merge of #97249 - GuillaumeGomez:details-summary-fixes, r=notriddleGuillaume Gomez-0/+35
`<details>`/`<summary>` UI fixes With images it's easier to understand: ![Screenshot from 2022-05-21 14-10-42](https://user-images.githubusercontent.com/3050060/169653038-9c58de67-589a-4986-a8ff-dbdddaf136a4.png) ![Screenshot from 2022-05-21 14-08-49](https://user-images.githubusercontent.com/3050060/169653042-56e87258-13fe-4f80-9858-4e15c318c3fb.png) The headings in `<summary>` should not have bottom border so I removed it as well alongside the other fixes. r? `@jsha`
2022-07-01Improve click behavior of the source code mobile full-screen "sidebar"Michael Howell-0/+22
On desktop, if you open the source code sidebar, it stays open even when you move from page to page. It used to do the same thing on mobile, but I think that's stupid. Since the file list fills the entire screen on mobile, and you can't really do anything with the currently selected file other than dismiss the "sidebar" to look at it, it's safe to assume that anybody who clicks a file in that list probably wants the list to go away so they can see it.
2022-07-01Auto merge of #93967 - cjgillot:short-struct-span, r=petrochenkovbors-3432/+2063
Shorten def_span for more items. The `def_span` query only returns the signature span for functions. Struct/enum/union definitions can also have a very long body. This PR shortens the associated span.
2022-07-01rustdoc: use <details> tag for the source code sidebarMichael Howell-34/+28
This fixes the extremely poor accessibility of the old system, making it possible to navigate the sidebar by keyboard, and also implicitly gives the sidebar items the correct ARIA roles.
2022-07-01Move Sized check before first error is createdMichael Goulet-10/+7
2022-07-01Don't point at Self type if we can't find an infer variable in ambiguous ↵Michael Goulet-30/+50
trait predicate
2022-07-01Show source of ambiguity in a few more placesMichael Goulet-17/+32
2022-07-01Only label place where type is needed if span is meaningfulMichael Goulet-32/+19
2022-07-01Auto merge of #98767 - Dylan-DPC:rollup-j1gq5sr, r=Dylan-DPCbors-1/+316
Rollup of 6 pull requests Successful merges: - #97488 (Suggest blanket impl to the local traits) - #98585 (Make `ThinBox<T>` covariant in `T`) - #98644 (fix ICE with -Wrust-2021-incompatible-closure-captures) - #98739 (fix grammar in useless doc comment lint) - #98741 (Many small deriving cleanups) - #98756 (Use const instead of function and make it private) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-01Amend codegen test.Camille GILLOT-22/+24
2022-07-01Bless recursion test.Camille GILLOT-2/+3
2022-07-01Ignore test with panic=abort.Camille GILLOT-12/+14
2022-07-01Shorten def_span for more items.Camille GILLOT-3432/+2063
2022-07-01Rollup merge of #98739 - euclio:useless-comment-plural, r=Dylan-DPCDylan DPC-1/+1
fix grammar in useless doc comment lint
2022-07-01Rollup merge of #98644 - matthiaskrgr:drp_loc_span_err__2021_inc_clos_cap, ↵Dylan DPC-0/+150
r=lcnr fix ICE with -Wrust-2021-incompatible-closure-captures Fixes #93117 Fixes #96258
2022-07-01Rollup merge of #97488 - vincenzopalazzo:macros/blanket_sugg, r=compiler-errorsDylan DPC-0/+165
Suggest blanket impl to the local traits This PR will add additional suggestion regarding the blanket implementation when it is possible, by generation a new help message + suggestion. Closes https://github.com/rust-lang/rust/issues/96076 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-07-01Auto merge of #98402 - cjgillot:undead, r=michaelwoeristerbors-96/+115
Rewrite dead-code pass to avoid fetching HIR. This allows to get a more uniform handling of spans, and to simplify the grouping of diagnostics for variants and fields.
2022-07-01Remove type flag based opaque type workaroundOli Scherer-173/+30
2022-07-01Auto merge of #98730 - matthiaskrgr:rollup-2c4d4x5, r=matthiaskrgrbors-8/+100
Rollup of 10 pull requests Successful merges: - #97629 ([core] add `Exclusive` to sync) - #98503 (fix data race in thread::scope) - #98670 (llvm-wrapper: adapt for LLVMConstExtractValue removal) - #98671 (Fix source sidebar bugs) - #98677 (For diagnostic information of Boolean, remind it as use the type: 'bool') - #98684 (add test for 72793) - #98688 (interpret: add From<&MplaceTy> for PlaceTy) - #98695 (use "or pattern") - #98709 (Remove unneeded methods declaration for old web browsers) - #98717 (get rid of tidy 'unnecessarily ignored' warnings) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-01Rollup merge of #98727 - notriddle:notriddle/issue-98697, r=GuillaumeGomezMatthias Krüger-0/+22
rustdoc: filter '_ lifetimes from ty::PolyTraitRef Fixes #98697
2022-07-01Rollup merge of #98686 - matthiaskrgr:test-46511, r=compiler-errorsMatthias Krüger-0/+29
add ice test for 46511 Fixes #46511 r? ``@compiler-errors``
2022-07-01Rollup merge of #98610 - lcnr:emit_inference_failure_err-ice, r=estebankMatthias Krüger-0/+100
fix `emit_inference_failure_err` ICE fixes #98598 this fix doesn't make me too happy, but :shrug:
2022-06-30fix grammar in useless doc comment lintAndy Russell-1/+1
2022-06-30Specialize a few tests depending on opt-level.Camille GILLOT-40/+56
2022-06-30Allow inlining `#[inline]` functions.Camille GILLOT-44/+33
2022-06-30Test enabling MIR inlinerWesley Wiser-1/+1
2022-06-30Skip inlining if there are normalization issues.Camille GILLOT-61/+57
2022-06-30Check history earlier.Camille GILLOT-11/+38
2022-07-01rustdoc: fix 98690pinkforest-0/+11
2022-06-30ui: improve suggestion test by addig the help messageVincenzo Palazzo-15/+37
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-06-30Rollup merge of #98684 - matthiaskrgr:ice-test-72793, r=oli-obkMatthias Krüger-0/+25
add test for 72793 Fixes #72793 r? ````@oli-obk````
2022-06-30Rollup merge of #98677 - lyming2007:issue-98492-fix, r=lcnrMatthias Krüger-6/+37
For diagnostic information of Boolean, remind it as use the type: 'bool' Fixes #98492. It helps programmers coming from other languages modified: compiler/rustc_resolve/src/late/diagnostics.rs
2022-06-30Rollup merge of #98671 - GuillaumeGomez:source-sidebar-fixes, r=notriddleMatthias Krüger-2/+38
Fix source sidebar bugs This PR fixes the following two bugs: ![Screenshot from 2022-06-29 14-39-58](https://user-images.githubusercontent.com/3050060/176449070-3e3762da-2bfe-4acf-8eb0-34f6eb4c94ed.png) ![Screenshot from 2022-06-29 15-05-09](https://user-images.githubusercontent.com/3050060/176449073-b164820b-bd71-4b1a-990c-bba4e5fce196.png) I added regression tests to prevent them to happen again. I think we should backport it to beta as well. You can test it [here](https://rustdoc.crud.net/imperio/source-sidebar-fixes/src/std/lib.rs.html). cc ```@jsha``` r? ```@notriddle```
2022-06-30rustdoc: filter '_ lifetimes from ty::PolyTraitRefMichael Howell-0/+22
Fixes #98697
2022-06-30For diagnostic information of Boolean, remind it as use the type: 'bool'Yiming Lei-6/+37
It helps programmers coming from other languages modified: compiler/rustc_resolve/src/late/diagnostics.rs modified: src/test/ui/lint/recommend-literal.rs modified: src/test/ui/lint/recommend-literal.stderr modified: compiler/rustc_resolve/src/late/diagnostics.rs modified: src/test/ui/lint/recommend-literal.rs modified: src/test/ui/lint/recommend-literal.stderr modified: compiler/rustc_resolve/src/late/diagnostics.rs modified: src/test/ui/lint/recommend-literal.rs modified: src/test/ui/lint/recommend-literal.stderr
2022-06-30Stabilize `into_future`Yoshua Wuyts-2/+0
2022-06-30promote placeholder bounds to 'static obligationsNiko Matsakis-1/+52
In NLL, when we are promoting a bound out from a closure, if we have a requirement that `T: 'a` where `'a` is in a higher universe, we were previously ignoring that, which is totally wrong. We should be promoting those constraints to `'static`, since universes are not expressible across closure boundaries.