Skip to content

Commit 036ce5c

Browse files
committed
Fix compiletest trim deprecation warnings
1 parent 748d354 commit 036ce5c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/tools/compiletest/src/header.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl EarlyProps {
205205
fn ignore_lldb(config: &Config, line: &str) -> bool {
206206
if let Some(ref actual_version) = config.lldb_version {
207207
if line.starts_with("min-lldb-version") {
208-
let min_version = line.trim_right()
208+
let min_version = line.trim_end()
209209
.rsplit(' ')
210210
.next()
211211
.expect("Malformed lldb version directive");
@@ -228,15 +228,15 @@ impl EarlyProps {
228228
}
229229
if let Some(ref actual_version) = config.llvm_version {
230230
if line.starts_with("min-llvm-version") {
231-
let min_version = line.trim_right()
231+
let min_version = line.trim_end()
232232
.rsplit(' ')
233233
.next()
234234
.expect("Malformed llvm version directive");
235235
// Ignore if actual version is smaller the minimum required
236236
// version
237237
&actual_version[..] < min_version
238238
} else if line.starts_with("min-system-llvm-version") {
239-
let min_version = line.trim_right()
239+
let min_version = line.trim_end()
240240
.rsplit(' ')
241241
.next()
242242
.expect("Malformed llvm version directive");
@@ -573,14 +573,14 @@ fn iter_header(testfile: &Path, cfg: Option<&str>, it: &mut dyn FnMut(&str)) {
573573
None => false,
574574
};
575575
if matches {
576-
it(ln[(close_brace + 1)..].trim_left());
576+
it(ln[(close_brace + 1)..].trim_start());
577577
}
578578
} else {
579579
panic!("malformed condition directive: expected `{}foo]`, found `{}`",
580580
comment_with_brace, ln)
581581
}
582582
} else if ln.starts_with(comment) {
583-
it(ln[comment.len() ..].trim_left());
583+
it(ln[comment.len() ..].trim_start());
584584
}
585585
}
586586
return;

src/tools/compiletest/src/runtest.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ impl<'test> TestCx<'test> {
10791079
match line {
10801080
Ok(line) => {
10811081
let line = if line.starts_with("//") {
1082-
line[2..].trim_left()
1082+
line[2..].trim_start()
10831083
} else {
10841084
line.as_str()
10851085
};
@@ -2143,8 +2143,8 @@ impl<'test> TestCx<'test> {
21432143
.lines()
21442144
.enumerate()
21452145
.filter_map(|(line_nb, line)| {
2146-
if (line.trim_left().starts_with("pub mod ")
2147-
|| line.trim_left().starts_with("mod "))
2146+
if (line.trim_start().starts_with("pub mod ")
2147+
|| line.trim_start().starts_with("mod "))
21482148
&& line.ends_with(';')
21492149
{
21502150
if let Some(ref mut other_files) = other_files {
@@ -2153,7 +2153,7 @@ impl<'test> TestCx<'test> {
21532153
None
21542154
} else {
21552155
let sline = line.split("///").last().unwrap_or("");
2156-
let line = sline.trim_left();
2156+
let line = sline.trim_start();
21572157
if line.starts_with("```") {
21582158
if ignore {
21592159
ignore = false;
@@ -3284,7 +3284,7 @@ fn normalize_mir_line(line: &str) -> String {
32843284
fn nocomment_mir_line(line: &str) -> &str {
32853285
if let Some(idx) = line.find("//") {
32863286
let (l, _) = line.split_at(idx);
3287-
l.trim_right()
3287+
l.trim_end()
32883288
} else {
32893289
line
32903290
}

0 commit comments

Comments
 (0)