auto merge of #19761 : nick29581/rust/coerce-double, r=nikomatsakis
Part of #18469 [breaking-change] A receiver will only ever get a single auto-reference. Previously arrays and strings would get two, e.g., [T] would be auto-ref'ed to &&[T]. This is usually apparent when a trait is implemented for `&[T]` and has a method takes self by reference. The usual solution is to implement the trait for `[T]` (the DST form). r? @nikomatsakis (or anyone else, really)
This commit is contained in:
commit
4265e86844
6 changed files with 22 additions and 76 deletions
|
@ -440,7 +440,7 @@ impl<'a> LabelText<'a> {
|
|||
/// Renders text as string suitable for a label in a .dot file.
|
||||
pub fn escape(&self) -> String {
|
||||
match self {
|
||||
&LabelStr(ref s) => s.escape_default(),
|
||||
&LabelStr(ref s) => (&**s).escape_default(),
|
||||
&EscStr(ref s) => LabelText::escape_str(s.as_slice()),
|
||||
}
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ impl<'a> LabelText<'a> {
|
|||
match self {
|
||||
EscStr(s) => s,
|
||||
LabelStr(s) => if s.contains_char('\\') {
|
||||
s.escape_default().into_cow()
|
||||
(&*s).escape_default().into_cow()
|
||||
} else {
|
||||
s
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue