about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-12-10Rollup merge of #104019 - compiler-errors:print-generator-sizes, r=wesleywiserMatthias Krüger-0/+83
Compute generator sizes with `-Zprint_type_sizes` Fixes #103887 r? `@pnkfelix`
2022-12-10fix #105366, suggest impl in the scenario of typo with fnyukang-0/+37
2022-12-09Fix process-panic-after-fork.rs to pass on newer versions of Android.Peter Collingbourne-36/+41
The test process-panic-after-fork.rs was checking that abort() resulted in SIGSEGV on Android. This non-standard behavior was fixed back in 2013, so let's fix the test to also accept the standard behavior on Android.
2022-12-09Account for macros in const genericsEsteban Küber-0/+6
2022-12-09Introduce `Span::is_visible`Esteban Küber-4/+0
2022-12-09Rollup merge of #105506 - estebank:rustc_must_implement_one_of, ↵Matthias Krüger-28/+28
r=compiler-errors Tweak `rustc_must_implement_one_of` diagnostic output
2022-12-09Rollup merge of #105504 - notriddle:notriddle/stab-css, r=GuillaumeGomezMatthias Krüger-0/+41
rustdoc: make stability badge CSS more consistent # Before ![image](https://user-images.githubusercontent.com/1593513/206763667-8e0deb74-be63-4906-8229-9a7eb51725c2.png) ![image](https://user-images.githubusercontent.com/1593513/206764007-6301c0e8-4594-4a41-ba93-105824dffee6.png) # After ![image](https://user-images.githubusercontent.com/1593513/206763698-e187cee2-3a50-4e48-b7b5-c3cfa41a797d.png) ![image](https://user-images.githubusercontent.com/1593513/206764058-3999ee67-1439-4c98-8216-b90575342aa8.png) # Description * They all get rounded corners now. A test case has been added for this, too. * There are now broadly two kinds of stability badge, where there used to be three: item-info "fat badge", and the "thin badge" in both item tables and in docblocks (which got merged). The fat badges can have icons, while the thin badges can't. * The old Ayu design doesn't make sense to me. Does anyone know why it was done that way?
2022-12-09Rollup merge of #105385 - uweigand:s390x-test-lld, r=Mark-SimulacrumMatthias Krüger-0/+1
Skip test on s390x as LLD does not support the platform test/run-make/issue-71519 requires use of lld as linker, but lld does not currently support the s390x architecture.
2022-12-09Rollup merge of #105265 - aDotInTheVoid:sum-product-on-unimplemented, r=estebankMatthias Krüger-0/+48
Add `rustc_on_unimplemented` to `Sum` and `Product` trait. Helps with #105184, but I don't think it fully fixes it.
2022-12-09Rollup merge of #102406 - mejrs:missing_copy, r=wesleywiserMatthias Krüger-0/+35
Make `missing_copy_implementations` more cautious - Fixes https://github.com/rust-lang/rust/issues/98348 - Also makes the lint not fire on large types and types containing raw pointers. Thoughts?
2022-12-09Tweak `rustc_must_implement_one_of` diagnostic outputEsteban Küber-28/+28
2022-12-09Don't warn about unused parens when they are used by yeet exprMaybe Waffle-20/+34
2022-12-09rustdoc: make stability badge CSS more consistentMichael Howell-0/+41
* They all get rounded corners now. A test case has been added for this, too. * There are now broadly two kinds of stability badge, where there used to be three: item-info "fat badge", and the "thin badge" in both item tables and in docblocks (which got merged). The fat badges can have icons, while the thin badges can't.
2022-12-09Remove unneeded field from `SwitchTargets`Jakob Degen-247/+247
2022-12-09Illegal sized bounds: only suggest mutability change if neededRobin Schroer-0/+110
In a scenario like ``` struct Type; pub trait Trait { fn function(&mut self) where Self: Sized; } impl Trait for Type { fn function(&mut self) {} } fn main() { (&mut Type as &mut dyn Trait).function(); } ``` the problem is Sized, not the mutability of self. Thus don't emit the "you need &T instead of &mut T" note, or the other way around, as all it does is just invert the mutability of whatever was supplied. Fixes #103622.
2022-12-09Auto merge of #105486 - matthiaskrgr:rollup-o7c4l1c, r=matthiaskrgrbors-5/+129
Rollup of 10 pull requests Successful merges: - #105216 (Remove unused GUI test) - #105245 (attempt to clarify align_to docs) - #105387 (Improve Rustdoc scrape-examples UI) - #105389 (Enable profiler in dist-powerpc64le-linux) - #105427 (Dont silently ignore rustdoc errors) - #105442 (rustdoc: clean up docblock table CSS) - #105443 (Move some queries and methods) - #105455 (use the correct `Reveal` during validation) - #105470 (Clippy: backport ICE fix before beta branch) - #105474 (lib docs: fix typo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-09Rollup merge of #105455 - lcnr:correct-reveal-in-validate, r=jackh726Matthias Krüger-0/+52
use the correct `Reveal` during validation supersedes #105454. Deals with https://github.com/rust-lang/rust/issues/105009#issuecomment-1342395333, not closing #105009 as the ICE may leak into beta The issue was the following: - we optimize the mir, using `Reveal::All` - some optimization relies on the hidden type of an opaque type - we then validate using `Reveal::UserFacing` again which is not able to observe the hidden type r? `@jackh726`
2022-12-09Rollup merge of #105442 - notriddle:notriddle/docblock-table-css, ↵Matthias Krüger-0/+50
r=GuillaumeGomez rustdoc: clean up docblock table CSS # Preview http://notriddle.com/notriddle-rustdoc-demos/table-2/test_dingus/fn.test.html # Before ![image](https://user-images.githubusercontent.com/1593513/206364287-1b80eaaf-2e0e-4138-8b56-4aa8ff39abac.png) # After ![image](https://user-images.githubusercontent.com/1593513/206364209-d287d165-31be-4de1-9b43-05b35ce2a86b.png) # Details * The rule `display: block` had no noticeable effect. Technically, because markdown tables have a tbody and thead, they get wrapped in an [anonymous table box] in the CSS tree, nested within the `<table>` element's block layout box. This rule was added in #87230 to make the table side-scrolling, but this same issue was doubly fixed in #88742 by wrapping it in an explicit `<div>` tag. Since accessibility advocates recommend the wrapper div over marking the table as `display: block`, we'll stick with that. https://adrianroselli.com/2020/11/under-engineered-responsive-tables.html * The rule `width: calc(100% - 2px)` had no visible effect, because the anonymous table box was not affected. * The style is tweaked to basically be the same style GitHub uses. In particular, it adds zebra stripes, and removes dotted borders. https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Markdown.20table.20styling [anonymous table box]: https://www.w3.org/TR/CSS2/tables.html#anonymous-boxes
2022-12-09Rollup merge of #105427 - ↵Matthias Krüger-1/+11
GuillaumeGomez:dont-silently-ignore-rustdoc-errors, r=notriddle Dont silently ignore rustdoc errors I applied the suggestions from https://github.com/rust-lang/rust/pull/104995 and also checked the rustdoc-ui error but couldn't reproduce it. r? `@notriddle`
2022-12-09Rollup merge of #105387 - willcrichton:scrape-examples-ui-improvements, ↵Matthias Krüger-0/+16
r=notriddle Improve Rustdoc scrape-examples UI This PR combines a few different improvements to the scrape-examples UI. See a live demo here: https://willcrichton.net/misc/scrape-examples/small-first-example/clap/struct.Arg.html ### 1. The first scraped example now takes up significantly less screen height. Inserting the first scraped example takes up a lot of vertical screen space. I don't want this addition to overwhelm users, so I decided to reduce the height of the initial example in two ways: (A) the default un-expanded height is reduced from 240px (10 LOC) to 120px (5 LOC), and (B) the link to the example is now positioned *over* the example instead of *atop* the example (only on desktop though, not mobile). The changes to `scrape-examples.js` and `rustdoc.css` implement this fix. Here is what an example docblock now looks like: ![Screen Shot 2022-12-06 at 10 02 21 AM](https://user-images.githubusercontent.com/663326/205987450-3940063c-5973-4a34-8579-baff6a43aa9b.png) ### 2. Expanding all docblocks will not expand "More examples". The "More examples blocks" are huge, so fully expanding everything on the page would take up too much vertical space. The changes to `main.js` implement this fix. This is tested in `scrape-examples-toggle.goml`. ### 3. Examples from binary crates are sorted higher than examples from library crates. Code that is written as an example of an API is probably better for learning than code that happens to use an API, but isn't intended for pedagogic purposes. Unfortunately Rustc doesn't know whether a particular crate comes from an example target (only Cargo knows this). But we can at least create a proxy that prefers examples from binary crates over library crates, which we know from `--crate-type`. This change is implemented by adding a new field `bin_crate` in `Options` (see `config.rs`). An `is_bin` field has been added to the scraped examples metadata (see `scrape_examples.rs`). Then the example sorting metric uses `is_bin` as the first entry of a lexicographic sort on `(is_bin, example_size, display_name)` (see `render/mod.rs`). Note that in the future we can consider adding another flag like `--scrape-examples-cargo-target` that would pass target information from Cargo into the example metadata. But I'm proposing a less intrusive change for now. ### 4. The scrape-examples help page has been updated to reflect the latest Cargo interface. See `scrape-examples-help.md`. r? `@notriddle` P.S. once this PR and rust-lang/cargo#11450 are merged, then I think the scrape-examples feature is officially ready for deployment on docs.rs!
2022-12-09Rollup merge of #105216 - GuillaumeGomez:rm-unused-gui-test, r=notriddleMatthias Krüger-4/+0
Remove unused GUI test It's not testing anything so better just remove it. r? `@notriddle`
2022-12-09Auto merge of #104449 - oli-obk:unhide_unknown_spans, r=estebank,RalfJungbors-713/+2025
Start emitting labels even if their pointed to file is not available locally r? `@estebank` cc `@RalfJung` fixes #97699
2022-12-09Add testsGary Guo-0/+93
2022-12-09Auto merge of #105456 - matthiaskrgr:rollup-yennygf, r=matthiaskrgrbors-41/+203
Rollup of 10 pull requests Successful merges: - #104922 (Detect long types in E0308 and write them to disk) - #105120 (kmc-solid: `std::sys` code maintenance) - #105255 (Make nested RPIT inherit the parent opaque's generics.) - #105317 (make retagging work even with 'unstable' places) - #105405 (Stop passing -export-dynamic to wasm-ld.) - #105408 (Add help for `#![feature(impl_trait_in_fn_trait_return)]`) - #105423 (Use `Symbol` for the crate name instead of `String`/`str`) - #105433 (CI: add missing line continuation marker) - #105434 (Fix warning when libcore is compiled with no_fp_fmt_parse) - #105441 (Remove `UnsafetyState`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-08Don't generate pointer loads to spills unless necessaryWesley Wiser-2/+22
In order for LLVM to correctly generate debuginfo for msvc, we sometimes need to spill arguments to the stack and perform some direct & indirect offsets into the value. Previously, this code always performed those actions, even when not required as LLVM would clean it up during optimization. However, when MIR inlining is enabled, this can cause problems as the operations occur prior to the spilled value being initialized. To solve this, we first calculate the necessary offsets using just the type which is side-effect free and does not alter the LLVM IR. Then, if we are in a situation which requires us to generate the LLVM IR (and this situation only occurs for arguments, not local variables) then we perform the same calculation again, this time generating the appropriate LLVM IR as we go.
2022-12-08Add test case for ub in generated LLVM IRWesley Wiser-0/+22
2022-12-08Add LLVM KCFI support to the Rust compilerRamon de C Valle-1/+59
This commit adds LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler. It initially provides forward-edge control flow protection for operating systems kernels for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. (See llvm/llvm-project@cff5bef.) Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653). LLVM KCFI can be enabled with -Zsanitizer=kcfi. Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
2022-12-08disable mergefunc instead of making fns uniqueErik Desjardins-8/+4
2022-12-08Point at LHS on binop type err if relevantEsteban Küber-186/+560
2022-12-08Add `rustc_on_unimplemented` to `Sum` and `Product` trait.Nixon Enraght-Moony-0/+48
2022-12-09Ignore errors when including clear_expected_if_blessedTomasz Miąsko-1/+1
Include is there only for the effect executing the rule. The file is not intended to be remade successfully to be actually included.
2022-12-08rustdoc: add GUI test case for docblock table colorsMichael Howell-0/+50
2022-12-08Bless incremental testsGary Guo-10/+10
2022-12-08Support `#[track_caller]` on async closuresGary Guo-1/+65
2022-12-08Update rustdoc test to check its error outputGuillaume Gomez-1/+11
2022-12-08Add regression test for #105404Guillaume Gomez-0/+39
2022-12-08Rollup merge of #105423 - oli-obk:symbols, r=jackh726Matthias Krüger-1/+1
Use `Symbol` for the crate name instead of `String`/`str` It always got converted to a symbol anyway
2022-12-08Rollup merge of #105408 - cuviper:help-rpitirpit, r=compiler-errorsMatthias Krüger-0/+6
Add help for `#![feature(impl_trait_in_fn_trait_return)]` This adds a new variant `ImplTraitContext::FeatureGated`, so we can generalize the help for `return_position_impl_trait_in_trait` to also work for `impl_trait_in_fn_trait_return`. cc #99697
2022-12-08Rollup merge of #105317 - RalfJung:retag-rework, r=oli-obkMatthias Krüger-29/+0
make retagging work even with 'unstable' places This is based on top of https://github.com/rust-lang/rust/pull/105301. Only the last two commits are new. While investigating https://github.com/rust-lang/unsafe-code-guidelines/issues/381 I realized that we would have caught this issue much earlier if the add_retag pass wouldn't bail out on assignments of the form `*ptr = ...`. So this PR changes our retag strategy: - When a new reference is created via `Rvalue::Ref` (or a raw ptr via `Rvalue::AddressOf`), we do the retagging as part of just executing that address-taking operation. - For everything else, we still insert retags -- these retags basically serve to ensure that references stored in local variables (and their fields) are always freshly tagged, so skipping this for assignments like `*ptr = ...` is less egregious. r? ```@oli-obk```
2022-12-08Rollup merge of #105255 - cjgillot:issue-105197, r=compiler-errorsMatthias Krüger-0/+17
Make nested RPIT inherit the parent opaque's generics. Fixes https://github.com/rust-lang/rust/issues/105197 r? ```@compiler-errors```
2022-12-08Rollup merge of #104922 - estebank:fur-elize, r=oli-obkMatthias Krüger-11/+179
Detect long types in E0308 and write them to disk On type error with long types, print an abridged type and write the full type to disk. Print the widest possible short type while still fitting in the terminal.
2022-12-08add regression test for #105009lcnr-0/+52
2022-12-08add a test for #103095Takayuki Maeda-0/+30
2022-12-08Add 0..=isize::MAX range metadata to size loads from vtablesErik Desjardins-0/+55
2022-12-08add a test case for `generic_const_exprs` in trait itemsTakayuki Maeda-1/+8
2022-12-07Use `Symbol` for the crate name instead of `String`/`str`Oli Scherer-1/+1
2022-12-07Update newly failing UI testsGuillaume Gomez-7/+34
2022-12-07Add regression test for impl blocks in const exprGuillaume Gomez-0/+43
2022-12-07Properly print generator interior type sizesMichael Goulet-11/+28
2022-12-07Factor scrape-examples toggle test into a new fileWill Crichton-38/+14