fn main() {
let x = Some(1);
let Some(y) = x; //~ ERROR E0005
- //~| NOTE pattern `None` not covered
}
match x {
op_string @ Some(s) => {},
//~^ ERROR E0007
- //~| NOTE binds an already bound by-move value by moving it
//~| ERROR E0303
- //~| NOTE not allowed after `@`
None => {},
}
}
match Some("hi".to_string()) {
Some(s) if s.len() == 0 => {},
//~^ ERROR E0008
- //~| NOTE moves value into pattern guard
_ => {},
}
}
match x {
Some((y, ref z)) => {},
//~^ ERROR E0009
- //~| NOTE by-move pattern here
- //~| NOTE both by-ref and by-move used
None => panic!()
}
}
#![allow(warnings)]
const CON : Box<i32> = box 0; //~ ERROR E0010
- //~| NOTE allocation not allowed in
fn main() {}
const C: i32 = 2;
const CR: &'static mut i32 = &mut C; //~ ERROR E0017
- //~| NOTE constants require immutable values
static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
- //~| NOTE statics require immutable values
//~| ERROR cannot borrow
static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017
- //~| NOTE statics require immutable values
fn main() {}
let x = Fruit::Apple(String::new(), String::new());
match x {
Fruit::Apple(a) => {}, //~ ERROR E0023
- //~| NOTE expected 2 fields, found 1
Fruit::Apple(a, b, c) => {}, //~ ERROR E0023
- //~| NOTE expected 2 fields, found 3
Fruit::Pear(1, 2) => {}, //~ ERROR E0023
- //~| NOTE expected 1 field, found 2
}
}
let x = Foo { a:1, b:2 };
let Foo { a: x, a: y, b: 0 } = x;
//~^ ERROR field `a` bound multiple times in the pattern
- //~| NOTE multiple uses of `a` in pattern
- //~| NOTE first use of `a`
}
match thing {
Thing { x, y, z } => {}
//~^ ERROR struct `Thing` does not have a field named `z` [E0026]
- //~| NOTE struct `Thing` does not have field `z`
}
}
match d {
Dog { age: x } => {}
//~^ ERROR pattern does not mention field `name`
- //~| NOTE missing field `name`
}
}
match s {
"hello" ... "world" => {}
//~^ ERROR only char and numeric types are allowed in range patterns
- //~| NOTE ranges require char or numeric types
- //~| NOTE start type: &'static str
- //~| NOTE end type: &'static str
//~| ERROR non-reference pattern used to match a reference
_ => {}
}
match 5u32 {
1000 ... 5 => {}
//~^ ERROR lower range bound must be less than or equal to upper
- //~| NOTE lower bound larger than upper bound
}
}
fn main() {
let trait_obj: &SomeTrait = SomeTrait;
//~^ ERROR expected value, found trait `SomeTrait`
- //~| NOTE not a value
//~| ERROR E0038
//~| method `foo` has no receiver
- //~| NOTE the trait `SomeTrait` cannot be made into an object
let &invalid = trait_obj;
//~^ ERROR E0033
- //~| NOTE type `&SomeTrait` cannot be dereferenced
}
impl Trait1 for Test {
fn foo() {}
- //~^ NOTE candidate #1 is defined in an impl of the trait `Trait1` for the type `Test`
}
impl Trait2 for Test {
fn foo() {}
- //~^ NOTE candidate #2 is defined in an impl of the trait `Trait2` for the type `Test`
}
fn main() {
Test::foo() //~ ERROR multiple applicable items in scope
- //~| NOTE multiple `foo` found
}
fn call_foo(x: Box<Trait>) {
//~^ ERROR E0038
- //~| NOTE the trait `Trait` cannot be made into an object
- //~| NOTE method `foo` references the `Self` type in its arguments or return type
let y = x.foo();
}
let mut x = Foo { x: -7 };
x.drop();
//~^ ERROR E0040
- //~| NOTE explicit destructor calls not allowed
}
// except according to those terms.
extern "Rust" { fn foo(x: u8, ...); } //~ ERROR E0045
- //~| NOTE variadics require C or cdecl calling convention
fn main() {
}
// except according to those terms.
trait Foo {
- fn foo<T: Default>(x: T) -> Self; //~ NOTE expected 1 type parameter
+ fn foo<T: Default>(x: T) -> Self;
}
struct Bar;
impl Foo for Bar {
fn foo(x: bool) -> Self { Bar } //~ ERROR E0049
- //~| NOTE found 0 type parameters
}
fn main() {
// except according to those terms.
trait Foo {
- fn foo(&self, x: u8) -> bool; //~ NOTE trait requires 2 parameters
- fn bar(&self, x: u8, y: u8, z: u8); //~ NOTE trait requires 4 parameters
- fn less(&self); //~ NOTE trait requires 1 parameter
+ fn foo(&self, x: u8) -> bool;
+ fn bar(&self, x: u8, y: u8, z: u8);
+ fn less(&self);
}
struct Bar;
impl Foo for Bar {
fn foo(&self) -> bool { true } //~ ERROR E0050
- //~| NOTE expected 2 parameters, found 1
fn bar(&self) { } //~ ERROR E0050
- //~| NOTE expected 4 parameters, found 1
fn less(&self, x: u8, y: u8, z: u8) { } //~ ERROR E0050
- //~| NOTE expected 1 parameter, found 4
}
fn main() {
let ref_foo = &&Foo;
ref_foo.foo();
//~^ ERROR E0055
- //~| NOTE deref recursion limit reached
}
extern "C" {
fn printf(_: *const u8, ...) -> u32;
- //~^ NOTE defined here
}
fn main() {
// except according to those terms.
fn f(a: u16, b: &str) {}
-//~^ NOTE defined here
fn f2(a: u16) {}
-//~^ NOTE defined here
fn main() {
f(0);
fn main() {
let x = Foo {
- x: 0, //~ NOTE first use of `x`
+ x: 0,
x: 0,
//~^ ERROR E0062
- //~| NOTE used more than once
};
}
fn main() {
let w = SingleFoo { };
//~^ ERROR missing field `x` in initializer of `SingleFoo`
- //~| NOTE missing `x`
let x = PluralFoo {x: 1};
//~^ ERROR missing fields `y`, `z` in initializer of `PluralFoo`
- //~| NOTE missing `y`, `z`
let y = TruncatedFoo{x:1};
//~^ missing fields `a`, `b`, `y` and 1 other field in initializer of `TruncatedFoo`
- //~| NOTE `a`, `b`, `y` and 1 other field
let z = TruncatedPluralFoo{x:1};
//~^ ERROR missing fields `a`, `b`, `c` and 2 other fields in initializer of `TruncatedPluralFoo`
- //~| NOTE missing `a`, `b`, `c` and 2 other fields
}
fn main() {
LinkedList::new() += 1; //~ ERROR E0368
//~^ ERROR E0067
- //~^^ NOTE invalid expression for left-hand side
- //~| NOTE cannot use `+=` on type `std::collections::LinkedList<_>`
}
fn foo() -> u8 {
return;
//~^ ERROR `return;` in a function whose return type is not `()`
- //~| NOTE return type is not ()
}
fn main() {
fn main() {
let u = FooAlias { value: 0 };
//~^ ERROR expected struct, variant or union type, found enum `Foo` [E0071]
- //~| NOTE not a struct
}
#[repr(simd)]
struct Bad(u16, u32, u32);
//~^ ERROR E0076
-//~| NOTE SIMD elements must have the same type
fn main() {
}
// except according to those terms.
enum Enum {
- P = 3, //~ NOTE first use of `3isize`
+ P = 3,
X = 3,
//~^ ERROR discriminant value `3isize` already exists
- //~| NOTE enum already has `3isize`
Y = 5
}
// except according to those terms.
#[repr(i32)] //~ ERROR: E0084
-enum Foo {} //~ NOTE: zero-variant enum
+enum Foo {}
fn main() {
}
fn main() {
foo::<f64>(); //~ ERROR expected at most 0 type parameters, found 1 type parameter [E0087]
- //~^ NOTE expected 0 type parameters
bar::<f64, u64>(); //~ ERROR expected at most 1 type parameter, found 2 type parameters [E0087]
- //~^ NOTE expected 1 type parameter
}
fn main() {
foo::<f64>(); //~ ERROR expected 2 type parameters, found 1 type parameter [E0089]
- //~| NOTE expected 2 type parameters
}
fn main() {
foo::<'static>(); //~ ERROR expected 2 lifetime parameters, found 1 lifetime parameter [E0090]
- //~^ NOTE expected 2 lifetime parameters
}
// except according to those terms.
type Foo<T> = u32; //~ ERROR E0091
- //~| NOTE unused type parameter
type Foo2<A, B> = Box<A>; //~ ERROR E0091
- //~| NOTE unused type parameter
fn main() {
}
#![feature(intrinsics)]
extern "rust-intrinsic" {
fn atomic_foo(); //~ ERROR E0092
-} //~| NOTE unrecognized atomic operation
+}
fn main() {
}
extern "rust-intrinsic" {
fn foo();
//~^ ERROR E0093
- //~| NOTE unrecognized intrinsic
}
fn main() {
#![feature(intrinsics)]
extern "rust-intrinsic" {
fn size_of<T, U>() -> usize; //~ ERROR E0094
- //~| NOTE expected 1 type parameter
}
fn main() {
struct Foo {
x: &bool,
//~^ ERROR E0106
- //~| NOTE expected lifetime parameter
}
enum Bar {
A(u8),
B(&bool),
//~^ ERROR E0106
- //~| NOTE expected lifetime parameter
}
type MyStr = &str;
//~^ ERROR E0106
- //~| NOTE expected lifetime parameter
struct Baz<'a>(&'a str);
struct Buzz<'a, 'b>(&'a str, &'b str);
// except according to those terms.
type X = u32<i32>; //~ ERROR E0109
- //~| NOTE type parameter not allowed
fn main() {
}
// except according to those terms.
type X = u32<'static>; //~ ERROR E0110
- //~| NOTE lifetime parameter not allowed on this type
fn main() {
}
impl Vec<u8> {}
//~^ ERROR E0116
-//~| NOTE impl for type defined outside of crate.
-//~| NOTE define and implement a trait or new type instead
fn main() {
}
// except according to those terms.
impl Drop for u32 {} //~ ERROR E0117
-//~^ NOTE impl doesn't use types inside crate
-//~| NOTE the impl does not reference any types defined in this crate
-//~| NOTE define and implement a trait or new type instead
//~| ERROR the Drop trait may only be implemented on structures
//~| implementing Drop requires a struct
// except according to those terms.
impl (u8, u8) { //~ ERROR E0118
-//~^ NOTE impl requires a base type
-//~| NOTE either implement a trait on it or create a newtype to wrap it instead
fn get_state(&self) -> String {
String::new()
}
fn get(&self) -> usize;
}
-impl<T> MyTrait for T { //~ NOTE first implementation here
+impl<T> MyTrait for T {
fn get(&self) -> usize { 0 }
}
}
impl MyTrait for Foo { //~ ERROR E0119
- //~| NOTE conflicting implementation for `Foo`
fn get(&self) -> usize { self.value }
}
impl Drop for MyTrait {
//~^ ERROR E0120
- //~| NOTE implementing Drop requires a struct
fn drop(&mut self) {}
}
// except according to those terms.
struct Foo {
- field1: i32, //~ NOTE `field1` first declared here
+ field1: i32,
field1: i32,
//~^ ERROR field `field1` is already declared [E0124]
- //~| NOTE field already declared
}
fn main() {
// except according to those terms.
struct Foo<T=U, U=()> { //~ ERROR E0128
- //~| NOTE defaulted type parameters cannot be forward declared
field1: T,
field2: U,
}
extern {
fn foo((a, b): (u32, u32));
//~^ ERROR E0130
- //~| NOTE pattern not allowed in foreign function
}
fn main() {
fn main<T>() {
//~^ ERROR E0131
- //~| NOTE main cannot have type parameters
}
#[start]
fn f< T >() {} //~ ERROR E0132
- //~| NOTE start function cannot have type parameters
fn main() {
}
fn main() {
f();
//~^ ERROR E0133
- //~| NOTE call to unsafe function
}
#![feature(main)]
#[main]
-fn foo() {} //~ NOTE first #[main] function
+fn foo() {}
#[main]
fn f() {}
//~^ ERROR E0137
-//~| NOTE additional #[main] function
#[start]
fn foo(argc: isize, argv: *const *const u8) -> isize { 0 }
-//~^ NOTE previous `start` function here
#[start]
fn f(argc: isize, argv: *const *const u8) -> isize { 0 }
//~^ ERROR E0138
-//~| NOTE multiple `start` functions
fn main() {
let irr = Irrefutable(0);
if let Irrefutable(x) = irr { //~ ERROR E0162
- //~| NOTE irrefutable pattern
println!("{}", x);
}
}
fn bar(foo: Foo) -> u32 {
match foo {
Foo::B(i) => i, //~ ERROR E0164
- //~| NOTE not a tuple variant or struct
}
}
// except according to those terms.
#[derive(Copy)] //~ ERROR E0184
- //~| NOTE Copy not allowed on types with destructors
- //~| NOTE in this expansion of #[derive(Copy)]
struct Foo;
impl Drop for Foo {
}
type Foo = Trait; //~ ERROR E0191
- //~| NOTE missing associated type `Bar` value
fn main() {
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-trait Foo<T> { //~ NOTE first `T` declared here
+trait Foo<T> {
fn do_something(&self) -> T;
fn do_something_else<T: Clone>(&self, bar: T);
//~^ ERROR E0194
- //~| NOTE shadows another type parameter
}
fn main() {
impl Copy for Foo { }
//~^ ERROR the trait `Copy` may not be implemented for this type
-//~| NOTE type is not a structure or enumeration
//~| ERROR only traits defined in the current crate can be implemented for arbitrary types
-//~| NOTE impl doesn't use types inside crate
-//~| NOTE the impl does not reference any types defined in this crate
-//~| NOTE define and implement a trait or new type instead
#[derive(Copy, Clone)]
struct Bar;
impl Copy for &'static Bar { }
//~^ ERROR the trait `Copy` may not be implemented for this type
-//~| NOTE type is not a structure or enumeration
fn main() {
}
struct Foo;
impl<T: Default> Foo { //~ ERROR E0207
- //~| NOTE unconstrained type parameter
fn get(&self) -> T {
<T as Default>::default()
}
fn main() {
let v: Vec(&str) = vec!["foo"];
//~^ ERROR E0214
- //~| NOTE only traits may use parentheses
}
}
type Foo = Trait<F=i32>; //~ ERROR E0220
- //~| NOTE associated type `F` not found
//~| ERROR E0191
- //~| NOTE missing associated type `Bar` value
fn main() {
}
trait T2 {}
trait Foo {
- type A: T1; //~ NOTE: ambiguous `A` from `Foo`
+ type A: T1;
}
trait Bar : Foo {
- type A: T2; //~ NOTE: ambiguous `A` from `Bar`
+ type A: T2;
fn do_something() {
let _: Self::A;
//~^ ERROR E0221
- //~| NOTE ambiguous associated type `A`
}
}
trait T3 {}
trait My : std::str::FromStr {
- type Err: T3; //~ NOTE: ambiguous `Err` from `My`
+ type Err: T3;
fn test() {
let _: Self::Err;
//~^ ERROR E0221
- //~| NOTE ambiguous associated type `Err`
- //~| NOTE associated type `Self` could derive from `std::str::FromStr`
}
}
fn main() {
let foo: MyTrait::X;
//~^ ERROR ambiguous associated type
- //~| NOTE ambiguous associated type
- //~| NOTE specify the type using the syntax `<Type as MyTrait>::X`
}
fn main() {
let _: Box<std::io::Read + std::io::Write>;
//~^ ERROR only auto traits can be used as additional traits in a trait object [E0225]
- //~| NOTE non-auto additional trait
}
fn baz<I>(x: &<I as Foo<A=Bar>>::A) {}
//~^ ERROR associated type bindings are not allowed here [E0229]
-//~| NOTE associated type not allowed here
fn main() {
}
#[rustc_on_unimplemented]
//~^ ERROR E0232
-//~| NOTE value required here
-//~| NOTE eg `#[rustc_on_unimplemented = "foo"]`
trait Bar {}
fn main() {
struct Foo<T> { x: T }
struct Bar { x: Foo }
//~^ ERROR wrong number of type arguments: expected 1, found 0 [E0243]
- //~| NOTE expected 1 type argument
fn main() {
}
struct Foo { x: bool }
struct Bar<S, T> { x: Foo<S, T> }
//~^ ERROR wrong number of type arguments: expected 0, found 2 [E0244]
- //~| NOTE expected no type arguments
fn main() {
use foo::MyTrait::do_something;
//~^ ERROR E0253
- //~|NOTE cannot be imported directly
fn main() {}
#![allow(unused_extern_crates)]
extern crate alloc;
-//~^ NOTE previous import of the extern crate `alloc` here
mod foo {
pub trait alloc {
use foo::alloc;
//~^ ERROR E0254
-//~| NOTE `alloc` reimported here
-//~| NOTE `alloc` must be defined only once in the type namespace of this module
fn main() {}
#![allow(unused_extern_crates)]
extern crate alloc;
-//~^ NOTE previous import of the extern crate `alloc` here
extern crate libc as alloc;
//~^ ERROR E0259
-//~| NOTE `alloc` reimported here
-//~| NOTE `alloc` must be defined only once in the type namespace of this module
-//~| NOTE You can use `as` to change the binding name of the import
fn main() {}
#![allow(unused_extern_crates)]
extern crate alloc;
-//~^ NOTE previous import of the extern crate `alloc` here
mod alloc {
//~^ ERROR the name `alloc` is defined multiple times [E0260]
-//~| NOTE `alloc` redefined here
-//~| NOTE `alloc` must be defined only once in the type namespace of this module
pub trait MyTrait {
fn do_something();
}
fn foo<'a, 'b, 'a>(x: &'a str, y: &'b str) {
//~^ ERROR E0263
- //~| NOTE declared twice
- //~| NOTE previous declaration here
}
fn main() {}
fn main() {
let w = || { break; }; //~ ERROR E0267
- //~| NOTE cannot break inside of a closure
}
fn main() {
break; //~ ERROR E0268
- //~| NOTE cannot break outside of a loop
}
fn main() {
is_send::<Foo>();
//~^ ERROR the trait bound `*const u8: std::marker::Send` is not satisfied in `Foo`
- //~| NOTE: `*const u8` cannot be sent between threads safely
- //~| NOTE: required because it appears within the type `Baz`
- //~| NOTE: required because it appears within the type `Bar`
- //~| NOTE: required because it appears within the type `Foo`
- //~| NOTE: required by `is_send`
}
fn f(p: Path) { }
//~^ ERROR the trait bound `[u8]: std::marker::Sized` is not satisfied in `std::path::Path`
-//~| NOTE `[u8]` does not have a constant size known at compile-time
-//~| NOTE required because it appears within the type `std::path::Path`
-//~| NOTE all local variables must have a statically known size
fn main() {
some_func(5i32);
//~^ ERROR the trait bound `i32: Foo` is not satisfied
- //~| NOTE the trait `Foo` is not implemented for `i32`
- //~| NOTE required by `some_func`
}
for Some(x) in xs {}
//~^ ERROR E0005
- //~| NOTE pattern `None` not covered
}
match Some(()) {
None => { },
option if option.take().is_none() => {}, //~ ERROR E0301
- //~| NOTE borrowed mutably in pattern guard
Some(_) => { }
}
}
match Some(()) {
None => { },
option if { option = None; false } => { }, //~ ERROR E0302
- //~| NOTE assignment in pattern guard
Some(_) => { }
}
}
match Some("hi".to_string()) {
ref op_string_ref @ Some(s) => {},
//~^ ERROR pattern bindings are not allowed after an `@` [E0303]
- //~| NOTE not allowed after `@`
//~| ERROR E0009
- //~| NOTE by-move pattern here
- //~| NOTE both by-ref and by-move used
None => {},
}
}
pub use foo as foo2;
//~^ ERROR `foo` is private, and cannot be reexported [E0365]
-//~| NOTE reexport of private `foo`
-//~| NOTE consider declaring type or module `foo` with `pub`
fn main() {}
impl<T, U> CoerceUnsized<Foo<U, T>> for Foo<T, U> {}
//~^ ERROR E0375
-//~| NOTE requires multiple coercions
-//~| NOTE `CoerceUnsized` may only be implemented for a coercion between structures with one field being coerced
-//~| NOTE currently, 2 fields need coercions: b (T to U), c (U to T)
fn main() {}
let mut fancy = FancyNum{ num: 5 };
let fancy_ref = &(&mut fancy);
fancy_ref.num = 6; //~ ERROR E0389
- //~^ NOTE assignment into an immutable reference
println!("{}", fancy_ref.num);
}
// except according to those terms.
enum Foo<T> { Bar } //~ ERROR E0392
- //~| NOTE unused type parameter
fn main() {
}
fn together_we_will_rule_the_galaxy(son: &A) {}
//~^ ERROR E0393
-//~| NOTE missing reference to `T`
-//~| NOTE because of the default `Self` reference, type parameters must be specified on object types
fn main() {
}
static A: u32 = 0;
static B: u32 = A;
//~^ ERROR E0394
-//~| NOTE referring to another static by value
-//~| NOTE use the address-of operator or a constant instead
fn main() {
}
static BAR: i32 = 42;
static BAZ: bool = { (&FOO as *const i32) == (&BAR as *const i32) }; //~ ERROR E0395
- //~| NOTE comparing raw pointers in static
fn main() {
}
const REG_ADDR: *const u8 = 0x5f3759df as *const u8;
const VALUE: u8 = unsafe { *REG_ADDR }; //~ ERROR E0396
- //~| NOTE dereference of raw pointer in constant
fn main() {
}
// except according to those terms.
fn foo<T, T>(s: T, u: T) {} //~ ERROR E0403
- //~| NOTE already used
- //~| NOTE first use of `T`
fn main() {
}
fn a() {}
fn b() {}
//~^ ERROR E0407
- //~| NOTE not a member of trait `Foo`
}
fn main() {
match x {
Some(y) | None => {} //~ ERROR variable `y` is not bound in all patterns
- _ => () //~| NOTE pattern doesn't bind `y`
- //~| NOTE variable not in all patterns
+ _ => ()
}
}
loop {
break 'a;
//~^ ERROR E0426
- //~| NOTE undeclared label `'a`
}
}
struct Bar; //~ previous definition of the type `Bar` here
struct Bar; //~ ERROR E0428
- //~| NOTE `Bar` redefined here
- //~| NOTE `Bar` must be defined only once in the type namespace of this module
fn main () {
}
fn main () {
let foo = 42u32;
let _: [u8; foo]; //~ ERROR E0435
- //~| NOTE non-constant value
}
impl Foo for i32 {
type Bar = bool; //~ ERROR E0437
- //~| NOTE not a member of trait `Foo`
}
fn main () {
impl Bar for i32 {
const BAR: bool = true; //~ ERROR E0438
- //~| NOTE not a member of trait `Bar`
}
fn main () {
pub trait Bar : Foo {}
//~^ ERROR private trait `Foo` in public interface [E0445]
-//~| NOTE private trait can't be public
pub struct Bar2<T: Foo>(pub T);
//~^ ERROR private trait `Foo` in public interface [E0445]
-//~| NOTE private trait can't be public
pub fn foo<T: Foo> (t: T) {}
//~^ ERROR private trait `Foo` in public interface [E0445]
-//~| NOTE private trait can't be public
fn main() {}
struct Bar(u32);
pub fn bar() -> Bar { //~ ERROR E0446
- //~| NOTE can't leak private type
Bar(0)
}
}
}
pub impl Bar {} //~ ERROR E0449
- //~| NOTE `pub` not needed here
- //~| NOTE place qualifiers on individual impl items instead
pub impl Foo for Bar { //~ ERROR E0449
- //~| NOTE `pub` not needed here
pub fn foo() {} //~ ERROR E0449
- //~| NOTE `pub` not needed here
}
fn main() {
fn pat_match(foo: Bar::Foo) {
let Bar::Foo{a:a, b:b} = foo; //~ ERROR E0451
- //~^ NOTE field `b` is private
}
fn main() {
let f = Bar::Foo{ a: 0, b: 0 }; //~ ERROR E0451
- //~^ NOTE field `b` is private
}
// except according to those terms.
#![forbid(non_snake_case)]
-//~^ NOTE `forbid` level set here
#[allow(non_snake_case)]
//~^ ERROR allow(non_snake_case) overruled by outer forbid(non_snake_case)
-//~| NOTE overruled by previous forbid
fn main() {
}
#[link(name = "")] extern {}
//~^ ERROR E0454
-//~| NOTE empty name given
fn main() {
}
// except according to those terms.
#[link(kind = "wonderful_unicorn")] extern {} //~ ERROR E0458
- //~| NOTE unknown kind
//~| ERROR E0459
- //~| NOTE missing `name` argument
fn main() {
}
// except according to those terms.
#[link(kind = "dylib")] extern {} //~ ERROR E0459
- //~| NOTE missing `name` argument
fn main() {
}
#![feature(plugin)]
#![plugin(cookie_monster)]
//~^ ERROR E0463
-//~| NOTE can't find crate
extern crate cake_is_a_lie;
fn main() {
}
impl<'a> Foo<'a> {
- //~^ NOTE first declared here
fn f<'a>(x: &'a i32) { //~ ERROR E0496
- //~^ NOTE lifetime 'a already in scope
}
}
// except according to those terms.
#[repr(C)] //~ ERROR: E0517
-type Foo = u8; //~ NOTE: not a struct, enum or union
+type Foo = u8;
#[repr(packed)] //~ ERROR: E0517
-enum Foo2 {Bar, Baz} //~ NOTE: not a struct
+enum Foo2 {Bar, Baz}
#[repr(u8)] //~ ERROR: E0517
-struct Foo3 {bar: bool, baz: bool} //~ NOTE: not an enum
+struct Foo3 {bar: bool, baz: bool}
#[repr(C)] //~ ERROR: E0517
-impl Foo3 { //~ NOTE: not a struct, enum or union
+impl Foo3 {
}
fn main() {
// except according to those terms.
#[inline(always)] //~ ERROR: E0518
-struct Foo; //~ NOTE: not a function
+struct Foo;
#[inline(never)] //~ ERROR: E0518
-impl Foo { //~ NOTE: not a function
+impl Foo {
}
fn main() {
}
impl<T: Clone> SpaceLlama for T {
-//~^ NOTE parent `impl` is here
fn fly(&self) {}
}
impl SpaceLlama for i32 {
default fn fly(&self) {}
//~^ ERROR E0520
- //~| NOTE cannot specialize default item `fly`
- //~| NOTE `fly` in the parent `impl` must be marked `default`
}
fn main() {
match r {
&[a, b] => {
//~^ ERROR E0527
- //~| NOTE expected 4 elements
println!("a={}, b={}", a, b);
}
}
match r {
&[a, b, c, rest..] => {
//~^ ERROR E0528
- //~| NOTE pattern cannot match array of 2 elements
}
}
}
match r {
[a, b] => {
//~^ ERROR E0529
- //~| NOTE pattern cannot match with input type `f32`
}
}
}
#[export_name]
//~^ ERROR E0558
-//~| NOTE did you mean #[export_name="*"]?
pub fn something() {}
fn main() {
let s = Field::Fool { joke: 0 };
//~^ ERROR E0559
- //~| NOTE `Field::Fool` does not have this field
- //~| NOTE available fields are: `x`
}
fn main() {
let s = Simba { mother: 1, father: 0 };
//~^ ERROR E0560
- //~| NOTE `Simba` does not have this field
- //~| NOTE available fields are: `mother`
}
fn main() {
let x = 0u8;
x as Vec<u8>; //~ ERROR E0605
- //~| NOTE an `as` expression can only be used to convert between primitive types
let v = 0 as *const u8;
v as &u8; //~ ERROR E0605
- //~| NOTE an `as` expression can only be used to convert between primitive types
}
fn main() {
X::Entry(); //~ ERROR expected function, found `X::Entry` [E0618]
- //~| HELP did you mean to write `X::Entry`?
let x = 0i32;
x(); //~ ERROR expected function, found `i32` [E0618]
}