Skip to content

Commit f62301b

Browse files
authored
Merge pull request #337 from stevefan1999-personal/patch-std-to-core
change some std types to core equivalent
2 parents e4440bc + 96ad5e5 commit f62301b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

peg-macros/grammar.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ pub mod peg {
66
type PositionRepr = <Input as ::peg::Parse>::PositionRepr;
77
#[allow(unused_parens)]
88
struct ParseState<'input> {
9-
_phantom: ::std::marker::PhantomData<(&'input ())>,
9+
_phantom: ::core::marker::PhantomData<(&'input ())>,
1010
primary_cache: ::std::collections::HashMap<usize, ::peg::RuleResult<SpannedExpr>>,
1111
}
1212
impl<'input> ParseState<'input> {
1313
fn new() -> ParseState<'input> {
1414
ParseState {
15-
_phantom: ::std::marker::PhantomData,
15+
_phantom: ::core::marker::PhantomData,
1616
primary_cache: ::std::collections::HashMap::new(),
1717
}
1818
}
@@ -23,7 +23,7 @@ pub mod peg {
2323
use proc_macro2::{Delimiter, Group, Ident, Literal, Span, TokenStream};
2424
pub fn peg_grammar<'input>(
2525
__input: &'input Input,
26-
) -> ::std::result::Result<Grammar, ::peg::error::ParseError<PositionRepr>> {
26+
) -> ::core::result::Result<Grammar, ::peg::error::ParseError<PositionRepr>> {
2727
#![allow(non_snake_case, unused)]
2828
let mut __err_state = ::peg::error::ErrorState::new(::peg::Parse::start(__input));
2929
let mut __state = ParseState::new();

peg-macros/translate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,14 @@ fn make_parse_state(grammar: &Grammar) -> TokenStream {
171171
quote_spanned! { span =>
172172
#[allow(unused_parens)]
173173
struct ParseState<'input #(, #grammar_lifetime_params)*> {
174-
_phantom: ::std::marker::PhantomData<(&'input () #(, &#grammar_lifetime_params ())*)>,
174+
_phantom: ::core::marker::PhantomData<(&'input () #(, &#grammar_lifetime_params ())*)>,
175175
#(#cache_fields_def),*
176176
}
177177

178178
impl<'input #(, #grammar_lifetime_params)*> ParseState<'input #(, #grammar_lifetime_params)*> {
179179
fn new() -> ParseState<'input #(, #grammar_lifetime_params)*> {
180180
ParseState {
181-
_phantom: ::std::marker::PhantomData,
181+
_phantom: ::core::marker::PhantomData,
182182
#(#cache_fields: ::std::collections::HashMap::new()),*
183183
}
184184
}
@@ -369,7 +369,7 @@ fn compile_rule_export(context: &Context, rule: &Rule) -> TokenStream {
369369

370370
quote_spanned! { span =>
371371
#doc
372-
#visibility fn #name<'input #(, #grammar_lifetime_params)* #(, #ty_params)*>(__input: #input_ty #extra_args_def #(, #rule_params)*) -> ::std::result::Result<#ret_ty, ::peg::error::ParseError<PositionRepr<#(#grammar_lifetime_params),*>>> {
372+
#visibility fn #name<'input #(, #grammar_lifetime_params)* #(, #ty_params)*>(__input: #input_ty #extra_args_def #(, #rule_params)*) -> ::core::result::Result<#ret_ty, ::peg::error::ParseError<PositionRepr<#(#grammar_lifetime_params),*>>> {
373373
#![allow(non_snake_case, unused)]
374374

375375
let mut __err_state = ::peg::error::ErrorState::new(::peg::Parse::start(__input));

0 commit comments

Comments
 (0)