Add alias tests

This commit is contained in:
Guillaume Gomez 2018-04-19 20:14:47 +02:00
parent 31e7cc4ba4
commit d5eade2b94
6 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,17 @@
// 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.
const QUERY = '&';
const EXPECTED = {
'others': [
{ 'path': 'std', 'name': 'reference' },
],
};

View File

@ -0,0 +1,18 @@
// 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.
const QUERY = '+';
const EXPECTED = {
'others': [
{ 'path': 'std::ops::AddAssign', 'name': 'AddAssign' },
{ 'path': 'std::ops::Add', 'name': 'Add' },
],
};

View File

@ -0,0 +1,17 @@
// 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.
const QUERY = '!';
const EXPECTED = {
'others': [
{ 'path': 'std', 'name': 'never' },
],
};

View File

@ -0,0 +1,19 @@
// 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.
const QUERY = '[';
const EXPECTED = {
'others': [
{ 'path': 'std', 'name': 'slice' },
{ 'path': 'std::ops::IndexMut', 'name': 'IndexMut' },
{ 'path': 'std::ops::Index', 'name': 'Index' },
],
};

View File

@ -0,0 +1,14 @@
// 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.
#[doc(alias = "foo")] //~ ERROR: #[doc(alias = "...")] is experimental
pub struct Foo;
fn main() {}

View File

@ -0,0 +1,11 @@
error[E0658]: #[doc(alias = "...")] is experimental
--> $DIR/feature-gate-doc_alias.rs:11:1
|
LL | #[doc(alias = "foo")] //~ ERROR: #[doc(alias = "...")] is experimental
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: add #![feature(doc_alias)] to the crate attributes to enable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.