Skip to content

Commit

Permalink
Merge #7051
Browse files Browse the repository at this point in the history
7051: MACRO: Fix non-ASCII literals in proc macros r=vlad20012 a=vlad20012



Co-authored-by: vlad20012 <beskvlad@gmail.com>
  • Loading branch information
bors[bot] and vlad20012 committed Apr 4, 2021
2 parents 2e94622 + 483bf12 commit 0165f8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -165,8 +165,8 @@ private class ProcMacroServerProcess private constructor(
private val process: Process,
private val timeout: Long = Registry.get("org.rust.macros.proc.timeout").asInteger().toLong(),
) : Runnable, Disposable {
private val stdout: BufferedReader = BufferedReader(InputStreamReader(process.inputStream))
private val stdin: Writer = OutputStreamWriter(process.outputStream)
private val stdout: BufferedReader = BufferedReader(InputStreamReader(process.inputStream, Charsets.UTF_8))
private val stdin: Writer = OutputStreamWriter(process.outputStream, Charsets.UTF_8)

private val lock = ReentrantLock()
private val requestQueue = SynchronousQueue<Pair<Request, CompletableFuture<Response>>>()
Expand Down
Expand Up @@ -122,6 +122,7 @@ class RsProcMacroExpansionTest : RsWithToolchainTestBase() {
checkExpansion(lib, "as_is", ".", ".")
checkExpansion(lib, "as_is", "..", "..")
checkExpansion(lib, "as_is", "fn foo() {}", "fn foo() {}")
checkExpansion(lib, "as_is", "\"Привет\"", "\"Привет\"") // "Hello" in russian, a test for non-ASCII chars
checkExpansion(lib, "read_env_var", "", "\"foo value\"", env = mapOf("FOO_ENV_VAR" to "foo value"))
checkExpansion(lib, "do_println", "", "")
checkExpansion(lib, "do_eprintln", "", "")
Expand Down

0 comments on commit 0165f8f

Please sign in to comment.