X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_expand%2Fsrc%2Ftests.rs;h=8b7153776e4dc6580aef89db7bc4afa6973aada3;hb=e1d2e65463e9bc5b75f92209a9e22a6ba7b7aa24;hp=693159f9aec4a3e8855d807edf5a22e68bd74d39;hpb=e209e85e39b4851c3ec122a45ddeabe318b2d522;p=rust.git diff --git a/compiler/rustc_expand/src/tests.rs b/compiler/rustc_expand/src/tests.rs index 693159f9aec..8b7153776e4 100644 --- a/compiler/rustc_expand/src/tests.rs +++ b/compiler/rustc_expand/src/tests.rs @@ -22,7 +22,7 @@ fn string_to_parser(ps: &ParseSess, source_str: String) -> Parser<'_> { new_parser_from_source_str(ps, PathBuf::from("bogofile").into(), source_str) } -crate fn with_error_checking_parse<'a, T, F>(s: String, ps: &'a ParseSess, f: F) -> T +pub(crate) fn with_error_checking_parse<'a, T, F>(s: String, ps: &'a ParseSess, f: F) -> T where F: FnOnce(&mut Parser<'a>) -> PResult<'a, T>, { @@ -33,7 +33,7 @@ fn string_to_parser(ps: &ParseSess, source_str: String) -> Parser<'_> { } /// Maps a string to tts, using a made-up filename. -crate fn string_to_stream(source_str: String) -> TokenStream { +pub(crate) fn string_to_stream(source_str: String) -> TokenStream { let ps = ParseSess::new(FilePathMapping::empty()); source_file_to_stream( &ps, @@ -44,7 +44,7 @@ fn string_to_parser(ps: &ParseSess, source_str: String) -> Parser<'_> { } /// Parses a string, returns a crate. -crate fn string_to_crate(source_str: String) -> ast::Crate { +pub(crate) fn string_to_crate(source_str: String) -> ast::Crate { let ps = ParseSess::new(FilePathMapping::empty()); with_error_checking_parse(source_str, &ps, |p| p.parse_crate_mod()) } @@ -53,7 +53,7 @@ fn string_to_parser(ps: &ParseSess, source_str: String) -> Parser<'_> { /// may be deleted or replaced with other whitespace to match the pattern. /// This function is relatively Unicode-ignorant; fortunately, the careful design /// of UTF-8 mitigates this ignorance. It doesn't do NKF-normalization(?). -crate fn matches_codepattern(a: &str, b: &str) -> bool { +pub(crate) fn matches_codepattern(a: &str, b: &str) -> bool { let mut a_iter = a.chars().peekable(); let mut b_iter = b.chars().peekable(); @@ -109,7 +109,7 @@ struct SpanLabel { label: &'static str, } -crate struct Shared { +pub(crate) struct Shared { pub data: Arc>, }