gccrs: Implemented UTF-8 checking for include_str!()
authorOwen Avery <powerboat9.gamer@gmail.com>
Sun, 8 Jan 2023 22:19:12 +0000 (17:19 -0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 6 Apr 2023 08:47:23 +0000 (10:47 +0200)
commitfd406fc7046f427385b644759265ae06ed741d6b
treef33b42bc2dfb10af4854c6fc95dbadfcc83ff488
parent20529dff93f10f782b9dbee51fa58928945d0be3
gccrs: Implemented UTF-8 checking for include_str!()

gcc/rust/ChangeLog:

* expand/rust-macro-builtins.cc
(MacroBuiltin::include_str_handler): Add check for valid UTF-8.

gcc/testsuite/ChangeLog:

* rust/compile/builtin_macro_include_str.rs:
Include test of invalid UTF-8.
* rust/compile/invalid_utf8: File with invalid UTF-8.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/expand/rust-macro-builtins.cc
gcc/testsuite/rust/compile/builtin_macro_include_str.rs
gcc/testsuite/rust/compile/invalid_utf8 [new file with mode: 0644]