Skip to content

Commit f7f5602

Browse files
author
Jonathan Turner
authored
Rollup merge of rust-lang#35824 - GuillaumeGomez:err_codes, r=jonathandturner
Err codes r? @jonathandturner
2 parents e6ab353 + cdb4af8 commit f7f5602

File tree

16 files changed

+286
-5
lines changed

16 files changed

+286
-5
lines changed

src/librustc_metadata/diagnostics.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ register_long_diagnostics! {
1414
E0454: r##"
1515
A link name was given with an empty name. Erroneous code example:
1616
17-
```
17+
```compile_fail,E0454
1818
#[link(name = "")] extern {} // error: #[link(name = "")] given with empty name
1919
```
2020
@@ -32,7 +32,7 @@ as frameworks are specific to that operating system.
3232
3333
Erroneous code example:
3434
35-
```compile_fail"
35+
```compile_fail,E0455
3636
#[link(name = "FooCoreServices", kind = "framework")] extern {}
3737
// OS used to compile is Linux for example
3838
```
@@ -50,7 +50,7 @@ See more: https://doc.rust-lang.org/book/conditional-compilation.html
5050
E0458: r##"
5151
An unknown "kind" was specified for a link attribute. Erroneous code example:
5252
53-
```
53+
```compile_fail,E0458
5454
#[link(kind = "wonderful_unicorn")] extern {}
5555
// error: unknown kind: `wonderful_unicorn`
5656
```
@@ -64,7 +64,7 @@ Please specify a valid "kind" value, from one of the following:
6464
E0459: r##"
6565
A link was used without a name parameter. Erroneous code example:
6666
67-
```
67+
```compile_fail,E0459
6868
#[link(kind = "dylib")] extern {}
6969
// error: #[link(...)] specified without `name = "foo"`
7070
```
@@ -80,7 +80,7 @@ you want. Example:
8080
E0463: r##"
8181
A plugin/crate was declared but cannot be found. Erroneous code example:
8282
83-
```
83+
```compile_fail,E0463
8484
#![feature(plugin)]
8585
#![plugin(cookie_monster)] // error: can't find crate for `cookie_monster`
8686
extern crate cake_is_a_lie; // error: can't find crate for `cake_is_a_lie`

src/test/compile-fail/E0441.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(repr_simd)]
12+
#![feature(platform_intrinsics)]
13+
14+
#[repr(simd)]
15+
struct i16x8(i16, i16, i16, i16, i16, i16, i16, i16);
16+
17+
extern "platform-intrinsic" {
18+
fn x86_mm_adds_ep16(x: i16x8, y: i16x8) -> i16x8; //~ ERROR E0441
19+
}
20+
21+
fn main() {}

src/test/compile-fail/E0442.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(repr_simd)]
12+
#![feature(platform_intrinsics)]
13+
14+
#[repr(simd)]
15+
struct i8x16(i8, i8, i8, i8, i8, i8, i8, i8,
16+
i8, i8, i8, i8, i8, i8, i8, i8);
17+
#[repr(simd)]
18+
struct i32x4(i32, i32, i32, i32);
19+
#[repr(simd)]
20+
struct i64x2(i64, i64);
21+
22+
extern "platform-intrinsic" {
23+
fn x86_mm_adds_epi16(x: i8x16, y: i32x4) -> i64x2;
24+
//~^ ERROR E0442
25+
//~| ERROR E0442
26+
//~| ERROR E0442
27+
}
28+
29+
fn main() {}

src/test/compile-fail/E0443.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(repr_simd)]
12+
#![feature(platform_intrinsics)]
13+
14+
#[repr(simd)]
15+
struct i16x8(i16, i16, i16, i16, i16, i16, i16, i16);
16+
#[repr(simd)]
17+
struct i64x8(i64, i64, i64, i64, i64, i64, i64, i64);
18+
19+
extern "platform-intrinsic" {
20+
fn x86_mm_adds_epi16(x: i16x8, y: i16x8) -> i64x8; //~ ERROR E0443
21+
}
22+
23+
fn main() {}

src/test/compile-fail/E0444.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(repr_simd)]
12+
#![feature(platform_intrinsics)]
13+
14+
#[repr(simd)]
15+
struct f64x2(f64, f64);
16+
17+
extern "platform-intrinsic" {
18+
fn x86_mm_movemask_pd(x: f64x2, y: f64x2, z: f64x2) -> i32; //~ ERROR E0444
19+
}
20+
21+
fn main() {}

src/test/compile-fail/E0445.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
trait Foo {
12+
fn dummy(&self) { }
13+
}
14+
15+
pub trait Bar : Foo {} //~ ERROR E0445
16+
pub struct Bar2<T: Foo>(pub T); //~ ERROR E0445
17+
pub fn foo<T: Foo> (t: T) {} //~ ERROR E0445
18+
19+
fn main() {}

src/test/compile-fail/E0446.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
mod Foo {
12+
struct Bar(u32);
13+
14+
pub fn bar() -> Bar { //~ ERROR E0446
15+
Bar(0)
16+
}
17+
}
18+
19+
fn main() {}

src/test/compile-fail/E0449.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
struct Bar;
12+
13+
trait Foo {
14+
fn foo();
15+
}
16+
17+
pub impl Bar {} //~ ERROR E0449
18+
19+
pub impl Foo for Bar { //~ ERROR E0449
20+
pub fn foo() {} //~ ERROR E0449
21+
}
22+
23+
fn main() {
24+
}

src/test/compile-fail/E0450.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
mod Bar {
12+
pub struct Foo(isize);
13+
}
14+
15+
fn main() {
16+
let f = Bar::Foo(0); //~ ERROR E0450
17+
}

src/test/compile-fail/E0451.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
mod Bar {
12+
pub struct Foo {
13+
pub a: isize,
14+
b: isize,
15+
}
16+
}
17+
18+
fn main() {
19+
let f = Bar::Foo{ a: 0, b: 0 }; //~ ERROR E0451
20+
}

src/test/compile-fail/E0452.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![allow(foo = "")] //~ ERROR E0452
12+
13+
fn main() {
14+
}

src/test/compile-fail/E0453.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![forbid(non_snake_case)]
12+
13+
#[allow(non_snake_case)] //~ ERROR E0453
14+
fn main() {
15+
}

src/test/compile-fail/E0454.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[link(name = "")] extern {} //~ ERROR E0454
12+
13+
fn main() {
14+
}

src/test/compile-fail/E0458.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[link(kind = "wonderful_unicorn")] extern {} //~ ERROR E0458
12+
//~^ ERROR E0459
13+
14+
fn main() {
15+
}

src/test/compile-fail/E0459.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[link(kind = "dylib")] extern {} //~ ERROR E0459
12+
13+
fn main() {
14+
}

src/test/compile-fail/E0463.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(plugin)]
12+
#![plugin(cookie_monster)] //~ ERROR E0463
13+
extern crate cake_is_a_lie;
14+
15+
fn main() {
16+
}

0 commit comments

Comments
 (0)