Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7df33a0
Account for RPITITs in opt_suggest_box_span
compiler-errors Dec 17, 2022
a313ef0
rename get_parent_node to parent_id
compiler-errors Jan 3, 2023
6af339d
rename find_parent_node to opt_parent_id
compiler-errors Jan 3, 2023
b1b19bd
get_parent and find_parent
compiler-errors Jan 3, 2023
a4974fa
Split `-Zchalk` flag into `-Ztrait-solver=(stock|chalk|next)` flag
compiler-errors Jan 2, 2023
1e81f9a
Update tests, etc
compiler-errors Jan 2, 2023
8b0f43b
Rename stock solver to classic
compiler-errors Jan 4, 2023
01196c5
rustdoc: remove unnecessary wrapper around sidebar and mobile logos
notriddle Jan 4, 2023
a86d33b
Point at expressions where inference refines an unexpected type
estebank Jan 3, 2023
a66bd95
Skip macros to avoid talking about bindings the user can't see
estebank Jan 3, 2023
acff39f
More eagerly resolve expr `ty`s before writing them
estebank Jan 3, 2023
c5d21c2
review comments: do not always point at init expr
estebank Jan 3, 2023
af68e2f
Tweak output
estebank Jan 4, 2023
4a0c5ec
Formatting
estebank Jan 4, 2023
e065d1d
Use `BottomUpFolder`
estebank Jan 4, 2023
7da7342
Account for type error on method arg caused by earlier inference
estebank Jan 5, 2023
b3488b2
Suggest changing argument on type error
estebank Jan 5, 2023
fee334c
review comment: potentially produce more suggestions for arg type mis…
estebank Jan 5, 2023
25cf71e
review comments: reword
estebank Jan 5, 2023
5393c6b
Tweak wording of fn call with wrong number of args
estebank Jan 5, 2023
c686f43
Rollup merge of #105846 - compiler-errors:issue-105838, r=jackh726
compiler-errors Jan 5, 2023
214b33b
Rollup merge of #106385 - compiler-errors:new-solver-flag, r=jackh726
compiler-errors Jan 5, 2023
b6efe90
Rollup merge of #106400 - estebank:type-errs, r=compiler-errors
compiler-errors Jan 5, 2023
edbab30
Rollup merge of #106403 - compiler-errors:rename-hir-methods, r=cjgillot
compiler-errors Jan 5, 2023
fea926c
Rollup merge of #106462 - notriddle:notriddle/logo-container-sidebar,…
compiler-errors Jan 5, 2023
7bbed3e
Rollup merge of #106478 - estebank:tweak-fn-mismatch, r=compiler-errors
compiler-errors Jan 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Suggest changing argument on type error
  • Loading branch information
estebank committed Jan 5, 2023
commit b3488b247fe92d7520053d0ba39686b2cad735d3
12 changes: 12 additions & 0 deletions src/test/ui/type/type-check/point-at-inference-3.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// run-rustfix
fn main() {
let mut v = Vec::new();
v.push(0i32);
//~^ NOTE this is of type `i32`, which makes `v` to be inferred as `Vec<i32>`
v.push(0);
v.push(1i32); //~ ERROR mismatched types
//~^ NOTE expected `i32`, found `u32`
//~| NOTE arguments to this function are incorrect
//~| NOTE associated function defined here
//~| HELP change the type of the numeric literal from `u32` to `i32`
}
12 changes: 7 additions & 5 deletions src/test/ui/type/type-check/point-at-inference-3.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// run-rustfix
fn main() {
let v = Vec::new();
let mut v = Vec::new();
v.push(0i32);
//~^ NOTE this is of type `i32`, which makes `v` to be inferred as `Vec<i32>`
v.push(0);
//~^ NOTE this is of type `{integer}`, which makes `v` to be inferred as `Vec<{integer}>`
v.push(0);
v.push(""); //~ ERROR mismatched types
//~^ NOTE expected integer, found `&str`
v.push(1u32); //~ ERROR mismatched types
//~^ NOTE expected `i32`, found `u32`
//~| NOTE arguments to this function are incorrect
//~| NOTE associated function defined here
//~| HELP change the type of the numeric literal from `u32` to `i32`
}
14 changes: 9 additions & 5 deletions src/test/ui/type/type-check/point-at-inference-3.stderr
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
error[E0308]: mismatched types
--> $DIR/point-at-inference-3.rs:6:12
--> $DIR/point-at-inference-3.rs:7:12
|
LL | v.push(0);
| - this is of type `{integer}`, which makes `v` to be inferred as `Vec<{integer}>`
LL | v.push(0i32);
| ---- this is of type `i32`, which makes `v` to be inferred as `Vec<i32>`
...
LL | v.push("");
| ---- ^^ expected integer, found `&str`
LL | v.push(1u32);
| ---- ^^^^ expected `i32`, found `u32`
| |
| arguments to this function are incorrect
|
note: associated function defined here
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
help: change the type of the numeric literal from `u32` to `i32`
|
LL | v.push(1i32);
| ~~~

error: aborting due to previous error

Expand Down