-
Notifications
You must be signed in to change notification settings - Fork 121
Upgrade Rust to 1.81 #1846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade Rust to 1.81 #1846
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,8 @@ | ||
| // this is required to please clippy which finds dome dead code in the | ||
|
||
| // generated parser | ||
| // this might be fixed by upgrading lalrpop | ||
| #![allow(dead_code)] | ||
|
|
||
| use std::collections::{BTreeMap, BTreeSet, HashSet}; | ||
|
|
||
| use itertools::Itertools; | ||
|
|
@@ -50,19 +55,19 @@ impl RiscVProgram for AsmProgram { | |
|
|
||
| fn take_executable_statements( | ||
| &mut self, | ||
| ) -> impl Iterator<Item = code_gen::Statement<&str, &[Argument]>> { | ||
| ) -> impl Iterator<Item = code_gen::Statement<'_, impl AsRef<str>, impl InstructionArgs>> { | ||
| self.statements.iter().filter_map(process_statement) | ||
| } | ||
|
|
||
| fn start_function(&self) -> &str { | ||
| fn start_function(&self) -> impl AsRef<str> { | ||
| START_FUNCTION | ||
| } | ||
| } | ||
|
|
||
| impl InstructionArgs for &[Argument] { | ||
| type Error = &'static str; | ||
|
|
||
| fn l(&self) -> Result<&str, &'static str> { | ||
| fn l(&self) -> Result<impl AsRef<str>, <Self as InstructionArgs>::Error> { | ||
| const ERR: &str = "Expected: label"; | ||
| match self { | ||
| [l] => Ok(argument_to_symbol(l).ok_or(ERR)?), | ||
|
|
@@ -116,7 +121,12 @@ impl InstructionArgs for &[Argument] { | |
| } | ||
| } | ||
|
|
||
| fn rrl(&self) -> Result<(Register, Register, &str), &'static str> { | ||
| fn rrl( | ||
| &self, | ||
| ) -> Result< | ||
| (code_gen::Register, code_gen::Register, impl AsRef<str>), | ||
| <Self as InstructionArgs>::Error, | ||
| > { | ||
| const ERR: &str = "Expected: register, register, label"; | ||
| match self { | ||
| [Argument::Register(r1), Argument::Register(r2), l] => { | ||
|
|
@@ -126,7 +136,9 @@ impl InstructionArgs for &[Argument] { | |
| } | ||
| } | ||
|
|
||
| fn rl(&self) -> Result<(Register, &str), &'static str> { | ||
| fn rl( | ||
| &self, | ||
| ) -> Result<(code_gen::Register, impl AsRef<str>), <Self as InstructionArgs>::Error> { | ||
| const ERR: &str = "Expected: register, label"; | ||
| match self { | ||
| [Argument::Register(r1), l] => Ok((*r1, argument_to_symbol(l).ok_or(ERR)?)), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| [toolchain] | ||
| channel = "1.77" | ||
| channel = "1.81" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait this evil macro was merged after all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new clippy rule on transmute to make things more explicit. I just used the suggestion for now, it can probably be made less verbose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first
unsafesolution got nuked by rust. The evil macro was the only PR in town.rust-lang/rust#120248 (comment)