rust-lang/rust — pull request #17435 by kaseyc (2014-09-22 06:08:53+00:00)
Title: Add to_c_str_opt/with_c_str_opt functions and fix an ICE

Add to_c_str_opt and with_c_str_opt functions to the ToCStr trait. These functions return an Option if the string they are passed contains a null byte, rather than failing the task like to_c_str/with_c_str.

Updated get_item_val in middle/trans/base to use these functions to fix the ICE in issue #16478.

Fixes #16478