Skip to content

Commit

Permalink
upgrade rust to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed Jun 17, 2024
1 parent fcc1698 commit 7112b9c
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 51 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-lemons-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/slang": patch
---

upgrade to rust `1.79.0`.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"rust-analyzer.imports.granularity.group": "module",
"rust-analyzer.imports.prefix": "crate",
"rust-analyzer.rustfmt.extraArgs": [
"+nightly-2024-02-21" // __RUST_NIGHTLY_VERSION_MARKER__ (keep in sync)
"+nightly-2024-06-17" // __RUST_NIGHTLY_VERSION_MARKER__ (keep in sync)
],
"rust-analyzer.server.path": "${workspaceFolder}/scripts/bin/rust-analyzer",
"search.exclude": {
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace.package]
version = "0.15.1"
rust-version = "1.76.0" # __RUST_STABLE_VERSION_MARKER__ (keep in sync)
rust-version = "1.79.0" # __RUST_STABLE_VERSION_MARKER__ (keep in sync)
edition = "2021"
publish = false

Expand Down
4 changes: 2 additions & 2 deletions bin/hermit.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ env = {

// Rust:
"RUST_BACKTRACE": "full",
"RUST_STABLE_VERSION": "1.76.0", // __RUST_STABLE_VERSION_MARKER__ (keep in sync)
"RUST_NIGHTLY_VERSION": "nightly-2024-02-21", // __RUST_NIGHTLY_VERSION_MARKER__ (keep in sync)
"RUST_STABLE_VERSION": "1.79.0", // __RUST_STABLE_VERSION_MARKER__ (keep in sync)
"RUST_NIGHTLY_VERSION": "nightly-2024-06-17", // __RUST_NIGHTLY_VERSION_MARKER__ (keep in sync)
"RUSTC_WRAPPER": "${HERMIT_ENV}/bin/sccache",
"SCCACHE_DIR": "${HERMIT_ENV}/.hermit/sccache",

Expand Down
11 changes: 0 additions & 11 deletions crates/codegen/runtime/cargo/src/runtime/language/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,6 @@ pub(crate) trait Lexer {
/// Returns valid grouping delimiters in the given lexical context.
fn delimiters<LexCtx: IsLexicalContext>() -> &'static [(TerminalKind, TerminalKind)];

/// Peeks the next terminal, including trivia. Does not advance the input.
fn peek_terminal<LexCtx: IsLexicalContext>(
&self,
input: &mut ParserContext<'_>,
) -> Option<ScannedTerminal> {
let start = input.position();
let terminal = self.next_terminal::<LexCtx>(input);
input.set_position(start);
terminal
}

/// Peeks the next significant (i.e. non-trivia) terminal. Does not advance the input.
fn peek_terminal_with_trivia<LexCtx: IsLexicalContext>(
&self,
Expand Down
7 changes: 1 addition & 6 deletions crates/codegen/runtime/generator/src/parser/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
// We should remove it and replace the grammar construction in the super `parser`
// module with the one from the new DSLv2 in the `constructor` module.

use std::collections::{BTreeSet, HashMap};
use std::collections::HashMap;

use codegen_language_definition::model::Identifier;
use semver::Version;

pub mod constructor;
pub mod parser_definition;
Expand All @@ -21,10 +20,6 @@ pub use scanner_definition::*;
pub use visitor::*;

pub struct Grammar {
pub name: String,
pub versions: BTreeSet<Version>,
pub leading_trivia_parser: TriviaParserDefinitionRef,
pub trailing_trivia_parser: TriviaParserDefinitionRef,
pub elements: HashMap<Identifier, GrammarElement>,
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Defines a translation of DSL v2 model into [`Grammar`], which is used for generating the parser and the CST.

use std::cell::OnceCell;
use std::collections::{BTreeMap, BTreeSet, HashMap};
use std::collections::{BTreeMap, HashMap};
use std::ops::Deref;
use std::rc::Rc;

Expand Down Expand Up @@ -101,10 +101,6 @@ impl Grammar {
.map(|(name, elem)| (name.clone(), elem.clone()));

Grammar {
name: lang.name.to_string(),
versions: BTreeSet::from_iter(lang.versions.clone()),
leading_trivia_parser: Rc::clone(&leading_trivia),
trailing_trivia_parser: Rc::clone(&trailing_trivia),
elements: resolved_items
.chain(
[leading_trivia, trailing_trivia]
Expand Down
2 changes: 1 addition & 1 deletion crates/infra/cli/src/commands/run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct RunController {

#[derive(Clone, Debug, PartialEq, ValueEnum)]
enum BinaryName {
/// Runs the public 'slang_solidity' crate shipped to Cargo users.
/// Runs the public `slang_solidity` crate shipped to Cargo users.
#[clap(name = "slang_solidity")]
SlangSolidity,
/// Runs the Solidity parser against source files from the Sanctuary repositories.
Expand Down
4 changes: 2 additions & 2 deletions crates/metaslang/cst/src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<T: KindTypes> Cursor<T> {
}

fn set_from_ancestor_node(&mut self, ancestor: &Rc<PathAncestor<T>>) {
self.parent = ancestor.parent.clone();
self.parent.clone_from(&ancestor.parent);
self.node = Node::<T>::Nonterminal(ancestor.nonterminal_node.clone());
self.child_number = ancestor.child_number;
self.text_offset = ancestor.text_offset;
Expand Down Expand Up @@ -169,7 +169,7 @@ impl<T: KindTypes> Cursor<T> {

fn next(&mut self) -> Option<Self::Item> {
if let Some(a) = self.a.take() {
self.a = a.parent.clone();
self.a.clone_from(&a.parent);
Some(a.nonterminal_node.clone())
} else {
None
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7112b9c

Please sign in to comment.