mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Add a workaround for a rustc ICE
This commit is contained in:
parent
2304f02123
commit
47364f64ef
1 changed files with 4 additions and 3 deletions
|
@ -79,9 +79,10 @@ struct Bytes<'a>(&'a str);
|
|||
|
||||
impl<'a> fmt::Debug for Bytes<'a> {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
formatter.write_str("b\"")?;
|
||||
formatter.write_str(self.0)?;
|
||||
formatter.write_str("\" as &'static [u8]")
|
||||
// https://github.com/rust-lang/rust/issues/55223
|
||||
// should technically be just `write!(formatter, "b\"{}\"", self.0)
|
||||
// but the referenced issue breaks promotion in the surrounding code
|
||||
write!(formatter, "{{ const FOO: &[u8] = b\"{}\"; FOO }}", self.0)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue