| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Address #44173 for trait errors.
|
|
Address #44173 for type check errors.
|
|
Fix #58497.
|
|
|
|
|
|
|
|
|
|
|
|
```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
```
|
|
- 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.
|
|
|
|
This allows the expressions to have more accurate types
when showing inference steps.
|
|
|
|
Address #106355.
|
|
Fix --kbd-color variable name in rustdoc.css
Interestingly enough, it only impacted the dark theme.
Before:

After:

r? `@notriddle`
|
|
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
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.
|
|
|
|
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
|
|
Tweak wording of fn call with wrong number of args
|
|
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
|
|
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
|
|
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
|
|
|
|
|
|
Move tests
r? `@petrochenkov`
|
|
rustdoc: fix buggy JS check for absolute URL
The old code did the wrong thing when faced with a crate named "http".
|
|
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`
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
Note maximum integer literal for `IntLiteralTooLarge`
Closes #105908
`@rustbot` label +A-diagnostics
|
|
Add codegen test for `Box::new(uninit)` of big arrays
Closes #58201
r? `@RalfJung`
|
|
Add JSON output to -Zdump-mono-stats
Follow-up to https://github.com/rust-lang/rust/pull/105481
r? `@lqd` cc `@wesleywiser`
|
|
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`
|
|
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.
|
|
|
|
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
|
|
The old code did the wrong thing when faced with a crate named "http".
|
|
Reduce spans for `unsafe impl` errors
Because huge spans aren't great for IDEs.
Prior art: https://github.com/rust-lang/rust/pull/103749
|
|
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.
|
|
|
|
|
|
|
|
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
|
|
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.
|