Skip to content

Commit 6842316

Browse files
committed
Allow deprecated try macro in test crates
1 parent 90fa790 commit 6842316

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

src/test/ui/associated-types/cache/chrono-scan.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// check-pass
22

3+
#![allow(deprecated)]
4+
35
pub type ParseResult<T> = Result<T, ()>;
46

57
pub enum Item<'a> {
@@ -18,7 +20,7 @@ pub fn timezone_offset_zulu<F>(s: &str, colon: F) -> ParseResult<(&str, i32)>
1820
pub fn parse<'a, I>(mut s: &str, items: I) -> ParseResult<()>
1921
where I: Iterator<Item=Item<'a>> {
2022
macro_rules! try_consume {
21-
($e:expr) => ({ let (s_, v) = $e?; s = s_; v })
23+
($e:expr) => ({ let (s_, v) = try!($e); s = s_; v })
2224
}
2325
let offset = try_consume!(timezone_offset_zulu(s.trim_start(), colon_or_space));
2426
let offset = try_consume!(timezone_offset_zulu(s.trim_start(), colon_or_space));

src/test/ui/derived-errors/issue-31997.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Test that the resolve failure does not lead to downstream type errors.
22
// See issue #31997.
3+
#![allow(deprecated)]
34

45
trait TheTrait { }
56

@@ -10,7 +11,7 @@ fn closure<F, T>(x: F) -> Result<T, ()>
1011
}
1112

1213
fn foo() -> Result<(), ()> {
13-
closure(|| bar(core::ptr::null_mut()))?; //~ ERROR cannot find function `bar` in this scope
14+
try!(closure(|| bar(core::ptr::null_mut()))); //~ ERROR cannot find function `bar` in this scope
1415
Ok(())
1516
}
1617

src/test/ui/derived-errors/issue-31997.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0425]: cannot find function `bar` in this scope
2-
--> $DIR/issue-31997.rs:13:16
2+
--> $DIR/issue-31997.rs:14:21
33
|
4-
LL | closure(|| bar(core::ptr::null_mut()))?;
5-
| ^^^ not found in this scope
4+
LL | try!(closure(|| bar(core::ptr::null_mut())));
5+
| ^^^ not found in this scope
66

77
error: aborting due to previous error
88

src/test/ui/lint/lint-qualification.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![deny(unused_qualifications)]
2+
#[allow(deprecated)]
23

34
mod foo {
45
pub fn bar() {}
@@ -9,7 +10,7 @@ fn main() {
910
foo::bar(); //~ ERROR: unnecessary qualification
1011
bar();
1112

12-
let _ = || -> Result<(), ()> { Ok(())?; Ok(()) }; // issue #37345
13+
let _ = || -> Result<(), ()> { try!(Ok(())); Ok(()) }; // issue #37345
1314

1415
macro_rules! m { () => {
1516
$crate::foo::bar(); // issue #37357

src/test/ui/lint/lint-qualification.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: unnecessary qualification
2-
--> $DIR/lint-qualification.rs:9:5
2+
--> $DIR/lint-qualification.rs:10:5
33
|
44
LL | foo::bar();
55
| ^^^^^^^^

src/test/ui/macros/macro-comma-support-rpass.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#![cfg_attr(core, no_std)]
1717

18+
#![allow(deprecated)] // for deprecated `try!()` macro
1819
#![feature(concat_idents)]
1920

2021
#[cfg(std)] use std::fmt;
@@ -261,9 +262,7 @@ fn thread_local() {
261262
#[test]
262263
fn try() {
263264
fn inner() -> Result<(), ()> {
264-
#[allow(deprecated)]
265265
try!(Ok(()));
266-
#[allow(deprecated)]
267266
try!(Ok(()),);
268267
Ok(())
269268
}

src/test/ui/macros/try-macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-pass
2-
#[allow(deprecated)]
2+
#![allow(deprecated)] // for deprecated `try!()` macro
33
use std::num::{ParseFloatError, ParseIntError};
44

55
fn main() {

0 commit comments

Comments
 (0)