1
Fork 0

Add tests for items deprecated in the future

This commit is contained in:
varkor 2018-03-19 17:02:04 +00:00
parent ecaf1f57ea
commit 101e17df96
2 changed files with 24 additions and 0 deletions

View file

@ -180,6 +180,11 @@ mod this_crate {
#[deprecated(since = "1.0.0", note = "text")]
pub fn deprecated_text() {}
#[deprecated(since = "99.99.99", note = "text")]
pub fn deprecated_future() {}
#[deprecated(since = "99.99.99", note = "text")]
pub fn deprecated_future_text() {}
pub struct MethodTester;
impl MethodTester {
@ -266,6 +271,9 @@ mod this_crate {
<Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text
<Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text
deprecated_future(); // Fine; no error.
deprecated_future_text(); // Fine; no error.
let _ = DeprecatedStruct {
//~^ ERROR use of deprecated item 'this_crate::DeprecatedStruct': text
i: 0 //~ ERROR use of deprecated item 'this_crate::DeprecatedStruct::i': text

View file

@ -0,0 +1,16 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(deprecated)]
// @has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \
// 'This will be deprecated in 99.99.99: effectively never'
#[deprecated(since = "99.99.99", note = "effectively never")]
pub struct S;