Skip to content

Commit 4598f7f

Browse files
committed
remove leftover obsolete string literals
1 parent 4baff4e commit 4598f7f

File tree

13 files changed

+29
-29
lines changed

13 files changed

+29
-29
lines changed

src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fn parse_compile_flags(line: &str) -> Option<~str> {
170170
}
171171

172172
fn parse_run_flags(line: &str) -> Option<~str> {
173-
parse_name_value_directive(line, ~"run-flags")
173+
parse_name_value_directive(line, "run-flags".to_owned())
174174
}
175175

176176
fn parse_debugger_cmd(line: &str) -> Option<~str> {

src/libstd/hash/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ mod tests {
343343

344344
assert_eq!(hasher.hash(&'a'), 97);
345345

346-
assert_eq!(hasher.hash(& &"a"), 97 + 0xFF);
346+
assert_eq!(hasher.hash(&("a")), 97 + 0xFF);
347347
assert_eq!(hasher.hash(& &[1u8, 2u8, 3u8]), 9);
348348

349349
unsafe {

src/libstd/path/posix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ mod tests {
560560
($path:expr, $disp:ident, $exp:expr) => (
561561
{
562562
let path = Path::new($path);
563-
assert!(path.$disp().to_str() == ~$exp);
563+
assert!(path.$disp().to_str().as_slice() == $exp);
564564
}
565565
)
566566
)

src/libstd/repr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ fn test_repr() {
637637
exact_test(&true, "true");
638638
exact_test(&false, "false");
639639
exact_test(&1.234, "1.234f64");
640-
exact_test(&(&"hello"), "\"hello\"");
640+
exact_test(&("hello"), "\"hello\"");
641641
// FIXME What do I do about this one?
642642
exact_test(&("he\u10f3llo".to_owned()), "~\"he\\u10f3llo\"");
643643

src/libstd/str.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3606,11 +3606,11 @@ mod tests {
36063606

36073607
#[test]
36083608
fn test_total_ord() {
3609-
"1234".cmp(& &"123") == Greater;
3610-
"123".cmp(& &"1234") == Less;
3611-
"1234".cmp(& &"1234") == Equal;
3612-
"12345555".cmp(& &"123456") == Less;
3613-
"22".cmp(& &"1234") == Greater;
3609+
"1234".cmp(&("123")) == Greater;
3610+
"123".cmp(&("1234")) == Less;
3611+
"1234".cmp(&("1234")) == Equal;
3612+
"12345555".cmp(&("123456")) == Less;
3613+
"22".cmp(&("1234")) == Greater;
36143614
}
36153615

36163616
#[test]
@@ -4007,7 +4007,7 @@ mod tests {
40074007

40084008
#[test]
40094009
fn test_from_str() {
4010-
let owned: Option<~str> = from_str(&"string");
4010+
let owned: Option<~str> = from_str("string");
40114011
assert_eq!(owned, Some("string".to_owned()));
40124012
}
40134013

src/test/compile-fail/borrowck-move-error-with-note.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl Drop for S {
3030
}
3131

3232
fn move_in_match() {
33-
match S {f:~"foo", g:~"bar"} {
33+
match S {f: "foo".to_owned(), g: "bar".to_owned()} {
3434
S { //~ ERROR cannot move out of type `S`, which defines the `Drop` trait
3535
f: _s, //~ NOTE attempting to move value to here
3636
g: _t //~ NOTE and here

src/test/compile-fail/const-cast-different-types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
static a: &'static str = &"foo";
11+
static a: &'static str = "foo";
1212
static b: *u8 = a as *u8; //~ ERROR non-scalar cast
1313
static c: *u8 = &a as *u8; //~ ERROR mismatched types
1414

src/test/run-pass/auto-ref-slice-plus-ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn main() {
3333
(&[1]).test_imm();
3434
("test").test_imm();
3535
("test".to_owned()).test_imm();
36-
(&"test").test_imm();
36+
("test").test_imm();
3737

3838
// FIXME: Other types of mutable vecs don't currently exist
3939

src/test/run-pass/estr-slice.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@
1010

1111

1212
pub fn main() {
13-
let x = &"hello";
14-
let v = &"hello";
15-
let y : &str = &"there";
13+
let x = "hello";
14+
let v = "hello";
15+
let y : &str = "there";
1616

1717
println!("{}", x);
1818
println!("{}", y);
1919

2020
assert_eq!(x[0], 'h' as u8);
2121
assert_eq!(x[4], 'o' as u8);
2222

23-
let z : &str = &"thing";
23+
let z : &str = "thing";
2424
assert_eq!(v, x);
2525
assert!(x != z);
2626

27-
let a = &"aaaa";
28-
let b = &"bbbb";
27+
let a = "aaaa";
28+
let b = "bbbb";
2929

30-
let c = &"cccc";
31-
let cc = &"ccccc";
30+
let c = "cccc";
31+
let cc = "ccccc";
3232

3333
println!("{}", a);
3434

src/test/run-pass/issue-2734.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn perform_hax<T: 'static>(x: ~T) -> ~hax: {
1616
}
1717

1818
fn deadcode() {
19-
perform_hax(~~"deadcode");
19+
perform_hax(~"deadcode".to_owned());
2020
}
2121

2222
pub fn main() {

src/test/run-pass/issue-2735.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn perform_hax<T: 'static>(x: ~T) -> ~hax: {
1616
}
1717

1818
fn deadcode() {
19-
perform_hax(~~"deadcode");
19+
perform_hax(~"deadcode".to_owned());
2020
}
2121

2222
pub fn main() {

src/test/run-pass/match-borrowed_str.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ fn g2(ref_1: &str, ref_2: &str) -> ~str {
4444

4545
pub fn main() {
4646
assert_eq!(f1("b".to_owned()), "found b".to_owned());
47-
assert_eq!(f1(&"c"), "not found".to_owned());
47+
assert_eq!(f1("c"), "not found".to_owned());
4848
assert_eq!(f1("d"), "not found".to_owned());
4949
assert_eq!(f2("b".to_owned()), "found b".to_owned());
50-
assert_eq!(f2(&"c"), "not found (c)".to_owned());
50+
assert_eq!(f2("c"), "not found (c)".to_owned());
5151
assert_eq!(f2("d"), "not found (d)".to_owned());
5252
assert_eq!(g1("b".to_owned(), "c".to_owned()), "found b,c".to_owned());
53-
assert_eq!(g1(&"c", &"d"), "not found".to_owned());
53+
assert_eq!(g1("c", "d"), "not found".to_owned());
5454
assert_eq!(g1("d", "e"), "not found".to_owned());
5555
assert_eq!(g2("b".to_owned(), "c".to_owned()), "found b,c".to_owned());
56-
assert_eq!(g2(&"c", &"d"), "not found (c, d)".to_owned());
56+
assert_eq!(g2("c", "d"), "not found (c, d)".to_owned());
5757
assert_eq!(g2("d", "e"), "not found (d, e)".to_owned());
5858
}

src/test/run-pass/small-enums-with-fields.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ macro_rules! check {
2222
static S: $t = $e;
2323
let v: $t = $e;
2424
assert_eq!(S, v);
25-
assert_eq!(format!("{:?}", v), ~$s);
26-
assert_eq!(format!("{:?}", S), ~$s);
25+
assert_eq!(format!("{:?}", v).as_slice(), $s);
26+
assert_eq!(format!("{:?}", S).as_slice(), $s);
2727
});*
2828
}}
2929
}

0 commit comments

Comments
 (0)