From 49bd3dc3b326f06ccbc0555a5c6ff2aec56efefd Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Wed, 27 Jan 2021 19:12:56 -0600 Subject: [PATCH] fix more no-std items --- lalrpop/src/lr1/codegen/parse_table.rs | 8 ++++---- lalrpop/src/normalize/macro_expand/mod.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lalrpop/src/lr1/codegen/parse_table.rs b/lalrpop/src/lr1/codegen/parse_table.rs index 2345b667b..ef49ec1ac 100644 --- a/lalrpop/src/lr1/codegen/parse_table.rs +++ b/lalrpop/src/lr1/codegen/parse_table.rs @@ -300,7 +300,7 @@ impl<'ascent, 'grammar, W: Write> CodeGenerator<'ascent, 'grammar, W, TableDrive rust!(self.out, ""); rust!( self.out, - "fn expected_tokens(&self, state: {state_type}) -> Vec {{", + "fn expected_tokens(&self, state: {state_type}) -> alloc::vec::Vec {{", state_type = state_type, ); rust!(self.out, "{p}expected_tokens(state)", p = self.prefix); @@ -346,12 +346,12 @@ impl<'ascent, 'grammar, W: Write> CodeGenerator<'ascent, 'grammar, W, TableDrive rust!(self.out, "start_location: Option<&Self::Location>,"); rust!( self.out, - "states: &mut Vec<{state_type}>,", + "states: &mut alloc::vec::Vec<{state_type}>,", state_type = state_type ); rust!( self.out, - "symbols: &mut Vec<{p}state_machine::SymbolTriple>,", + "symbols: &mut alloc::vec::Vec<{p}state_machine::SymbolTriple>,", p = self.prefix, ); rust!( @@ -1553,7 +1553,7 @@ impl<'ascent, 'grammar, W: Write> CodeGenerator<'ascent, 'grammar, W, TableDrive rust!(self.out, "if next_state == 0 {{"); rust!(self.out, "None"); rust!(self.out, "}} else {{"); - rust!(self.out, "Some(terminal.to_string())"); + rust!(self.out, "Some(alloc::string::ToString::to_string(terminal))"); rust!(self.out, "}}"); rust!(self.out, "}}).collect()"); rust!(self.out, "}}"); diff --git a/lalrpop/src/normalize/macro_expand/mod.rs b/lalrpop/src/normalize/macro_expand/mod.rs index eec528093..da22342c1 100644 --- a/lalrpop/src/normalize/macro_expand/mod.rs +++ b/lalrpop/src/normalize/macro_expand/mod.rs @@ -471,7 +471,7 @@ impl MacroExpander { span, expr: ExprSymbol { symbols: vec![] }, condition: None, - action: action("vec![]"), + action: action("alloc::vec![]"), annotations: vec![], }, // X* = @@ -519,7 +519,7 @@ impl MacroExpander { symbols: vec![repeat.symbol.clone()], }, condition: None, - action: action("vec![<>]"), + action: action("alloc::vec![<>]"), annotations: vec![], }, // X+ =