-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #94596 - compiler-errors:delay-adjustment-duplicate, …
…r=estebank Delay bug in expr adjustment when check_expr is called multiple times Instead of including slightly more complicated logic in `check_argument_types` to fix the bug (#94516) I introduced in #94438, and inevitably have this bug appear once again when some other diagnostic is written that causes `check_expr` to be called an expression during a (bad) code path, just delay the bug in adjustment logic. I am open to other implementations that don't delay the bug here. Fixes #94516
- Loading branch information
Showing
6 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
struct Process; | ||
|
||
pub type Group = (Vec<String>, Vec<Process>); | ||
|
||
fn test(process: &Process, groups: Vec<Group>) -> Vec<Group> { | ||
let new_group = vec![String::new()]; | ||
|
||
if groups.capacity() == 0 { | ||
groups.push(new_group, vec![process]); | ||
//~^ ERROR this function takes 1 argument but 2 arguments were supplied | ||
return groups; | ||
} | ||
|
||
todo!() | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error[E0061]: this function takes 1 argument but 2 arguments were supplied | ||
--> $DIR/wrong_argument_ice-3.rs:9:16 | ||
| | ||
LL | groups.push(new_group, vec![process]); | ||
| ^^^^ --------- ------------- supplied 2 arguments | ||
| | | ||
| expected 1 argument | ||
| | ||
note: associated function defined here | ||
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL | ||
| | ||
LL | pub fn push(&mut self, value: T) { | ||
| ^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0061`. |