about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2023-01-06Report WF error for new solver tooMichael Goulet-4/+4
2023-01-06Detect bindings assigned blocks without tail expressions in trait errorsEsteban Küber-9/+65
Address #44173 for trait errors.
2023-01-06Detect bindings assigned blocks without tail expressionsEsteban Küber-0/+95
Address #44173 for type check errors.
2023-01-05Detect closures assigned to binding in blockEsteban Küber-24/+32
Fix #58497.
2023-01-05Correct detection of elided lifetimes in impl-trait.Camille GILLOT-0/+5
2023-01-05fix rebaseEsteban Küber-3/+3
2023-01-05Explain error with `&mut self` for unsized trait implsclubby789-0/+27
2023-01-05review comments: rewordEsteban Küber-4/+4
2023-01-05Suggest changing argument on type errorEsteban Küber-10/+28
2023-01-05Account for type error on method arg caused by earlier inferenceEsteban Küber-0/+27
```rust fn main() { let v = Vec::new(); v.push(0); v.push(0); v.push(""); } ``` now produces ``` error[E0308]: mismatched types --> $DIR/point-at-inference-3.rs:6:12 | LL | v.push(0); | - this is of type `{integer}`, which makes `v` to be inferred as `Vec<{integer}>` ... LL | v.push(""); | ---- ^^ expected integer, found `&str` | | | arguments to this function are incorrect | note: associated function defined here --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL ```
2023-01-05Tweak outputEsteban Küber-12/+124
- Only point at a the single expression where the found type was first inferred. - Find method call argument that might have caused the found type to be inferred. - Provide structured suggestion. - Apply some review comments. - Tweak wording.
2023-01-05review comments: do not always point at init exprEsteban Küber-98/+11
2023-01-05More eagerly resolve expr `ty`s before writing themEsteban Küber-23/+11
This allows the expressions to have more accurate types when showing inference steps.
2023-01-05Skip macros to avoid talking about bindings the user can't seeEsteban Küber-12/+3
2023-01-05Point at expressions where inference refines an unexpected typeEsteban Küber-14/+140
Address #106355.
2023-01-05Auto merge of #106487 - GuillaumeGomez:fix-kbd-var, r=notriddlebors-1/+1
Fix --kbd-color variable name in rustdoc.css Interestingly enough, it only impacted the dark theme. Before: ![Screenshot from 2023-01-05 11-03-17](https://user-images.githubusercontent.com/3050060/210754145-c3bb0f50-d35f-4543-bf73-010a4524a803.png) After: ![Screenshot from 2023-01-05 11-03-05](https://user-images.githubusercontent.com/3050060/210754190-85c2f146-a774-4463-9cd3-9495b7c91bd7.png) r? `@notriddle`
2023-01-06Add regression test for #58355Yuki Okushi-0/+20
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-01-05Add vendor to Fuchsia's target tripleDavid Koloski-2/+2
Historically, Rust's Fuchsia targets have been labeled x86_64-fuchsia and aarch64-fuchsia. However, they should technically contain vendor information. This CL changes Fuchsia's target triples to include the "unknown" vendor since Clang now does normalization and handles all triple spellings. This was previously attempted in #90510, which was closed due to inactivity.
2023-01-05Update kbd GUI testGuillaume Gomez-1/+1
2023-01-05Auto merge of #106482 - compiler-errors:rollup-g7n1p39, r=compiler-errorsbors-164/+224
Rollup of 6 pull requests Successful merges: - #105846 (Account for return-position `impl Trait` in trait in `opt_suggest_box_span`) - #106385 (Split `-Zchalk` flag into `-Ztrait-solver=(classic|chalk|next)` flag) - #106403 (Rename `hir::Map::{get_,find_}parent_node` to `hir::Map::{,opt_}parent_id`, and add `hir::Map::{get,find}_parent`) - #106462 (rustdoc: remove unnecessary wrapper around sidebar and mobile logos) - #106464 (Update Fuchsia walkthrough with new configs) - #106478 (Tweak wording of fn call with wrong number of args) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-04Rollup merge of #106478 - estebank:tweak-fn-mismatch, r=compiler-errorsMichael Goulet-133/+133
Tweak wording of fn call with wrong number of args
2023-01-04Rollup merge of #106385 - compiler-errors:new-solver-flag, r=jackh726Michael Goulet-31/+31
Split `-Zchalk` flag into `-Ztrait-solver=(classic|chalk|next)` flag We'll eventually need a way to select more than chalk + not-chalk. Does this need an MCP since it's touching a `-Z` flag? Or perhaps I should preserve `-Zchalk` for the time being... maybe I could make it a warning to use that flag? cc ``@rust-lang/types`` r? types
2023-01-04Rollup merge of #105846 - compiler-errors:issue-105838, r=jackh726Michael Goulet-0/+60
Account for return-position `impl Trait` in trait in `opt_suggest_box_span` RPITITs are the only types where their opaque bounds might normalize to some other self type than the opaque type itself. To avoid needing to do normalization, let's just match on either alias kind. Ideally, we'd just get rid of `opt_suggest_box_span`. It's kind of a wart on type-checking `if`/`match`. I've recently refactored this expression for being confusing/wrong, but moving it into the error path is pretty hard. Fixes #105838
2023-01-05Auto merge of #105409 - compiler-errors:closure-infer-cycle, r=jackh726bors-2/+111
Don't deduce a signature that makes a closure cyclic Sometimes when elaborating supertrait bounds for closure signature inference, we end up deducing a closure signature that is cyclical because either a parameter or the return type references a projection mentioning `Self` that also has escaping bound vars, which means that it's not eagerly replaced with an inference variable. Interestingly, this is not *just* related to my PR that elaborates supertrait bounds for closure signature deduction. The committed test `supertrait-hint-cycle-3.rs` shows **stable** code that is fixed by this PR: ```rust trait Foo<'a> { type Input; } impl<F: Fn(u32)> Foo<'_> for F { type Input = u32; } fn needs_super<F: for<'a> Fn(<F as Foo<'a>>::Input) + for<'a> Foo<'a>>(_: F) {} fn main() { needs_super(|_: u32| {}); } ``` Fixes #105401 Fixes #105396 r? types
2023-01-05Tweak wording of fn call with wrong number of argsEsteban Küber-133/+133
2023-01-04cleanup: handle -Zmutable-noalias like -Zbox-noaliasErik Desjardins-0/+23
2023-01-04Rollup merge of #106460 - c410-f3r:moar-errors, r=compiler-errorsMatthias Krüger-0/+0
Move tests r? `@petrochenkov`
2023-01-04Rollup merge of #106437 - notriddle:notriddle/http-url, r=GuillaumeGomezMatthias Krüger-2/+32
rustdoc: fix buggy JS check for absolute URL The old code did the wrong thing when faced with a crate named "http".
2023-01-04Rollup merge of #106412 - ↵Matthias Krüger-0/+21
GuillaumeGomez:fix-links-to-primitive-rustdoc-json, r=aDotInTheVoid Fix link generation for local primitive types in rustdoc JSON output Fixes https://github.com/rust-lang/rust/issues/104064. As mentioned in the issue, I'm not super happy about this fix which is more a hack rather than a sound-proof solution. However I couldn't find a better way to fix it. r? `@aDotInTheVoid`
2023-01-04Rollup merge of #106391 - ardislu:fix-popover-child-link, r=GuillaumeGomezMatthias Krüger-0/+9
rustdoc: allow popover child links to work No need to prevent default click behavior on a `<div>`, it will also disable all child click behavior. Closes #106390
2023-01-04Move testsCaio-0/+0
2023-01-04Rename stock solver to classicMichael Goulet-1/+1
2023-01-04Update tests, etcMichael Goulet-31/+31
2023-01-04Auto merge of #106442 - matthiaskrgr:rollup-wivf7gh, r=matthiaskrgrbors-36/+221
Rollup of 7 pull requests Successful merges: - #106200 (Suggest `impl Fn*` and `impl Future` in `-> _` return suggestions) - #106274 (Add JSON output to -Zdump-mono-stats) - #106292 (Add codegen test for `Box::new(uninit)` of big arrays) - #106327 (Add tidy check for dbg) - #106361 (Note maximum integer literal for `IntLiteralTooLarge`) - #106396 (Allow passing a specific date to `bump-stage0`) - #106436 (Enable doctests for rustc_query_impl) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-03Add hardcoded wait time for external navigation to loadArdis Lu-0/+1
2023-01-04Rollup merge of #106361 - clubby789:int-literal-too-large, r=estebankMatthias Krüger-24/+70
Note maximum integer literal for `IntLiteralTooLarge` Closes #105908 `@rustbot` label +A-diagnostics
2023-01-04Rollup merge of #106292 - Nilstrieb:box-uninit-test, r=RalfJungMatthias Krüger-6/+22
Add codegen test for `Box::new(uninit)` of big arrays Closes #58201 r? `@RalfJung`
2023-01-04Rollup merge of #106274 - jyn514:dump-mono-stats, r=lqdMatthias Krüger-1/+8
Add JSON output to -Zdump-mono-stats Follow-up to https://github.com/rust-lang/rust/pull/105481 r? `@lqd` cc `@wesleywiser`
2023-01-04Rollup merge of #106200 - compiler-errors:suggest-impl-trait, r=estebankMatthias Krüger-5/+121
Suggest `impl Fn*` and `impl Future` in `-> _` return suggestions Follow-up to #106172, only the last commit is relevant. Can rebase once that PR is landed for easier review. Suggests `impl Future` and `impl Fn{,Mut,Once}` in `-> _` return suggestions. r? `@estebank`
2023-01-04Auto merge of #104376 - compiler-errors:thin-metadata-implies-thin-ptr, ↵bors-0/+11
r=wesleywiser layout_of: `T: Thin` implies `sizeof(&T) == sizeof(usize)` Use the `<T as Pointee>::Metadata` associated type to calculate the layout of a pointee's metadata, instead of hard-coding rules about certain types. Maybe this approach is overkill -- we could instead hard-code this approach as a fallback, with the matching on `Slice`/`Dynamic`/etc. happening first Fixes this issue here https://github.com/rust-lang/rust/pull/104338#issuecomment-1312595844 .. But is also useful with transmutes, for example, given the UI test I added below.
2023-01-03Add test case to click popover child linkArdis Lu-0/+8
2023-01-04Auto merge of #106432 - compiler-errors:rollup-lzj0lnp, r=compiler-errorsbors-26/+33
Rollup of 8 pull requests Successful merges: - #104748 (Ensure `lld` is supported with `download-ci-llvm`) - #105541 (Simplify some iterator combinators) - #106045 (default OOM handler: use non-unwinding panic, to match std handler) - #106157 (Don't trim path for `unsafe_op_in_unsafe_fn` lints) - #106353 (Reduce spans for `unsafe impl` errors) - #106381 (Jsondoclint: Add `--verbose` and `--json-output` options) - #106411 (rustdoc: remove legacy font-feature-settings CSS) - #106414 (Add cuviper to the review rotation for libs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-03rustdoc: fix buggy JS check for absolute URLMichael Howell-2/+32
The old code did the wrong thing when faced with a crate named "http".
2023-01-03Rollup merge of #106353 - lukas-code:reduce-red-lines-in-my-ide, r=wesleywiserMichael Goulet-26/+12
Reduce spans for `unsafe impl` errors Because huge spans aren't great for IDEs. Prior art: https://github.com/rust-lang/rust/pull/103749
2023-01-03Rollup merge of #106157 - ↵Michael Goulet-0/+21
LeSeulArtichaut:106126-thir-unsafeck-good-path-bug-2, r=compiler-errors Don't trim path for `unsafe_op_in_unsafe_fn` lints Fixes #106126, alternative to #106127. r? `@ghost` for now.
2023-01-04layout_of: `T: Thin` implies `sizeof(&T) == sizeof(usize)`Michael Goulet-0/+11
2023-01-04Restore Fn trait noteMichael Goulet-2/+14
2023-01-03Suggest more impl Trait on `-> _`Michael Goulet-7/+111
2023-01-03Auto merge of #105712 - amg98:feat/vita-support, r=wesleywiserbors-1/+1
PlayStation Vita support Just the compiler definitions for no-std projects and std support using newlib Earlier PR: https://github.com/rust-lang/rust/pull/105606
2023-01-03Add note about wrapping in braceskadmin-0/+51
Previously it was not clear why this errored or if it was even supported, as there was no diagnostic that suggested wrapping it in braces. Thus, add a simple diagnostic that suggests wrapping enum variants in braces.