Remove NOTE/HELP annotations from error index tests

This commit is contained in:
Vadim Petrochenkov 2017-12-11 00:12:25 +03:00
parent 2974104276
commit 3a2ad576c5
119 changed files with 22 additions and 216 deletions

View File

@ -11,5 +11,4 @@
fn main() {
let x = Some(1);
let Some(y) = x; //~ ERROR E0005
//~| NOTE pattern `None` not covered
}

View File

@ -13,9 +13,7 @@ fn main() {
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 => {},
}
}

View File

@ -12,7 +12,6 @@ fn main() {
match Some("hi".to_string()) {
Some(s) if s.len() == 0 => {},
//~^ ERROR E0008
//~| NOTE moves value into pattern guard
_ => {},
}
}

View File

@ -14,8 +14,6 @@ fn main() {
match x {
Some((y, ref z)) => {},
//~^ ERROR E0009
//~| NOTE by-move pattern here
//~| NOTE both by-ref and by-move used
None => panic!()
}
}

View File

@ -12,6 +12,5 @@
#![allow(warnings)]
const CON : Box<i32> = box 0; //~ ERROR E0010
//~| NOTE allocation not allowed in
fn main() {}

View File

@ -12,10 +12,7 @@ static X: i32 = 1;
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() {}

View File

@ -18,10 +18,7 @@ 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
}
}

View File

@ -17,6 +17,4 @@ fn main() {
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`
}

View File

@ -18,6 +18,5 @@ fn main() {
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`
}
}

View File

@ -19,6 +19,5 @@ fn main() {
match d {
Dog { age: x } => {}
//~^ ERROR pattern does not mention field `name`
//~| NOTE missing field `name`
}
}

View File

@ -14,9 +14,6 @@ fn main() {
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
_ => {}
}

View File

@ -13,6 +13,5 @@ fn main() {
match 5u32 {
1000 ... 5 => {}
//~^ ERROR lower range bound must be less than or equal to upper
//~| NOTE lower bound larger than upper bound
}
}

View File

@ -15,12 +15,9 @@ trait SomeTrait {
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
}

View File

@ -20,15 +20,12 @@ trait Trait2 {
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
}

View File

@ -14,8 +14,6 @@ trait Trait {
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();
}

View File

@ -22,5 +22,4 @@ fn main() {
let mut x = Foo { x: -7 };
x.drop();
//~^ ERROR E0040
//~| NOTE explicit destructor calls not allowed
}

View File

@ -9,7 +9,6 @@
// except according to those terms.
extern "Rust" { fn foo(x: u8, ...); } //~ ERROR E0045
//~| NOTE variadics require C or cdecl calling convention
fn main() {
}

View File

@ -9,14 +9,13 @@
// 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() {

View File

@ -9,20 +9,17 @@
// 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() {

View File

@ -20,5 +20,4 @@ fn main() {
let ref_foo = &&Foo;
ref_foo.foo();
//~^ ERROR E0055
//~| NOTE deref recursion limit reached
}

View File

@ -10,7 +10,6 @@
extern "C" {
fn printf(_: *const u8, ...) -> u32;
//~^ NOTE defined here
}
fn main() {

View File

@ -9,10 +9,8 @@
// 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);

View File

@ -14,9 +14,8 @@ struct Foo {
fn main() {
let x = Foo {
x: 0, //~ NOTE first use of `x`
x: 0,
x: 0,
//~^ ERROR E0062
//~| NOTE used more than once
};
}

View File

@ -41,14 +41,10 @@ struct TruncatedPluralFoo {
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
}

View File

@ -13,6 +13,4 @@ use std::collections::LinkedList;
fn main() {
LinkedList::new() += 1; //~ ERROR E0368
//~^ ERROR E0067
//~^^ NOTE invalid expression for left-hand side
//~| NOTE cannot use `+=` on type `std::collections::LinkedList<_>`
}

View File

@ -11,7 +11,6 @@
fn foo() -> u8 {
return;
//~^ ERROR `return;` in a function whose return type is not `()`
//~| NOTE return type is not ()
}
fn main() {

View File

@ -14,5 +14,4 @@ type FooAlias = Foo;
fn main() {
let u = FooAlias { value: 0 };
//~^ ERROR expected struct, variant or union type, found enum `Foo` [E0071]
//~| NOTE not a struct
}

View File

@ -13,7 +13,6 @@
#[repr(simd)]
struct Bad(u16, u32, u32);
//~^ ERROR E0076
//~| NOTE SIMD elements must have the same type
fn main() {
}

View File

@ -9,10 +9,9 @@
// 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
}

View File

@ -9,7 +9,7 @@
// except according to those terms.
#[repr(i32)] //~ ERROR: E0084
enum Foo {} //~ NOTE: zero-variant enum
enum Foo {}
fn main() {
}

View File

@ -13,8 +13,6 @@ fn bar<T>() {}
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
}

View File

@ -12,5 +12,4 @@ fn foo<T, U>() {}
fn main() {
foo::<f64>(); //~ ERROR expected 2 type parameters, found 1 type parameter [E0089]
//~| NOTE expected 2 type parameters
}

View File

@ -12,5 +12,4 @@ fn foo<'a: 'b, 'b: 'a>() {}
fn main() {
foo::<'static>(); //~ ERROR expected 2 lifetime parameters, found 1 lifetime parameter [E0090]
//~^ NOTE expected 2 lifetime parameters
}

View File

@ -9,9 +9,7 @@
// 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() {
}

View File

@ -11,7 +11,7 @@
#![feature(intrinsics)]
extern "rust-intrinsic" {
fn atomic_foo(); //~ ERROR E0092
} //~| NOTE unrecognized atomic operation
}
fn main() {
}

View File

@ -12,7 +12,6 @@
extern "rust-intrinsic" {
fn foo();
//~^ ERROR E0093
//~| NOTE unrecognized intrinsic
}
fn main() {

View File

@ -11,7 +11,6 @@
#![feature(intrinsics)]
extern "rust-intrinsic" {
fn size_of<T, U>() -> usize; //~ ERROR E0094
//~| NOTE expected 1 type parameter
}
fn main() {

View File

@ -11,17 +11,14 @@
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);

View File

@ -9,7 +9,6 @@
// except according to those terms.
type X = u32<i32>; //~ ERROR E0109
//~| NOTE type parameter not allowed
fn main() {
}

View File

@ -9,7 +9,6 @@
// except according to those terms.
type X = u32<'static>; //~ ERROR E0110
//~| NOTE lifetime parameter not allowed on this type
fn main() {
}

View File

@ -10,8 +10,6 @@
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() {
}

View File

@ -9,9 +9,6 @@
// 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

View File

@ -9,8 +9,6 @@
// 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()
}

View File

@ -12,7 +12,7 @@ trait MyTrait {
fn get(&self) -> usize;
}
impl<T> MyTrait for T { //~ NOTE first implementation here
impl<T> MyTrait for T {
fn get(&self) -> usize { 0 }
}
@ -21,7 +21,6 @@ struct Foo {
}
impl MyTrait for Foo { //~ ERROR E0119
//~| NOTE conflicting implementation for `Foo`
fn get(&self) -> usize { self.value }
}

View File

@ -12,7 +12,6 @@ trait MyTrait { fn foo() {} }
impl Drop for MyTrait {
//~^ ERROR E0120
//~| NOTE implementing Drop requires a struct
fn drop(&mut self) {}
}

View File

@ -9,10 +9,9 @@
// 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() {

View File

@ -9,7 +9,6 @@
// except according to those terms.
struct Foo<T=U, U=()> { //~ ERROR E0128
//~| NOTE defaulted type parameters cannot be forward declared
field1: T,
field2: U,
}

View File

@ -11,7 +11,6 @@
extern {
fn foo((a, b): (u32, u32));
//~^ ERROR E0130
//~| NOTE pattern not allowed in foreign function
}
fn main() {

View File

@ -10,5 +10,4 @@
fn main<T>() {
//~^ ERROR E0131
//~| NOTE main cannot have type parameters
}

View File

@ -12,7 +12,6 @@
#[start]
fn f< T >() {} //~ ERROR E0132
//~| NOTE start function cannot have type parameters
fn main() {
}

View File

@ -13,5 +13,4 @@ unsafe fn f() { return; }
fn main() {
f();
//~^ ERROR E0133
//~| NOTE call to unsafe function
}

View File

@ -11,9 +11,8 @@
#![feature(main)]
#[main]
fn foo() {} //~ NOTE first #[main] function
fn foo() {}
#[main]
fn f() {}
//~^ ERROR E0137
//~| NOTE additional #[main] function

View File

@ -12,9 +12,7 @@
#[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

View File

@ -13,7 +13,6 @@ struct Irrefutable(i32);
fn main() {
let irr = Irrefutable(0);
if let Irrefutable(x) = irr { //~ ERROR E0162
//~| NOTE irrefutable pattern
println!("{}", x);
}
}

View File

@ -18,7 +18,6 @@ impl Foo {
fn bar(foo: Foo) -> u32 {
match foo {
Foo::B(i) => i, //~ ERROR E0164
//~| NOTE not a tuple variant or struct
}
}

View File

@ -9,8 +9,6 @@
// 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 {

View File

@ -13,7 +13,6 @@ trait Trait {
}
type Foo = Trait; //~ ERROR E0191
//~| NOTE missing associated type `Bar` value
fn main() {
}

View File

@ -8,11 +8,10 @@
// 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() {

View File

@ -12,18 +12,13 @@ type Foo = i32;
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() {
}

View File

@ -11,7 +11,6 @@
struct Foo;
impl<T: Default> Foo { //~ ERROR E0207
//~| NOTE unconstrained type parameter
fn get(&self) -> T {
<T as Default>::default()
}

View File

@ -11,5 +11,4 @@
fn main() {
let v: Vec(&str) = vec!["foo"];
//~^ ERROR E0214
//~| NOTE only traits may use parentheses
}

View File

@ -13,8 +13,6 @@ trait Trait {
}
type Foo = Trait<F=i32>; //~ ERROR E0220
//~| NOTE associated type `F` not found
//~| ERROR E0191
//~| NOTE missing associated type `Bar` value
fn main() {
}

View File

@ -12,27 +12,24 @@ trait T1 {}
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`
}
}

View File

@ -13,6 +13,4 @@ trait MyTrait { type X; }
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`
}

View File

@ -11,5 +11,4 @@
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
}

View File

@ -22,7 +22,6 @@ impl Foo for isize {
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() {
}

View File

@ -12,8 +12,6 @@
#[rustc_on_unimplemented]
//~^ ERROR E0232
//~| NOTE value required here
//~| NOTE eg `#[rustc_on_unimplemented = "foo"]`
trait Bar {}
fn main() {

View File

@ -11,7 +11,6 @@
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() {
}

View File

@ -11,7 +11,6 @@
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() {

View File

@ -16,6 +16,5 @@ mod foo {
use foo::MyTrait::do_something;
//~^ ERROR E0253
//~|NOTE cannot be imported directly
fn main() {}

View File

@ -12,7 +12,6 @@
#![allow(unused_extern_crates)]
extern crate alloc;
//~^ NOTE previous import of the extern crate `alloc` here
mod foo {
pub trait alloc {
@ -22,7 +21,5 @@ mod foo {
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() {}

View File

@ -12,12 +12,8 @@
#![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() {}

View File

@ -12,12 +12,9 @@
#![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();
}

View File

@ -10,8 +10,6 @@
fn foo<'a, 'b, 'a>(x: &'a str, y: &'b str) {
//~^ ERROR E0263
//~| NOTE declared twice
//~| NOTE previous declaration here
}
fn main() {}

View File

@ -10,5 +10,4 @@
fn main() {
let w = || { break; }; //~ ERROR E0267
//~| NOTE cannot break inside of a closure
}

View File

@ -10,5 +10,4 @@
fn main() {
break; //~ ERROR E0268
//~| NOTE cannot break outside of a loop
}

View File

@ -25,9 +25,4 @@ fn is_send<T: Send>() { }
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`
}

View File

@ -20,13 +20,8 @@ fn some_func<T: Foo>(foo: T) {
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`
}

View File

@ -13,5 +13,4 @@ fn main() {
for Some(x) in xs {}
//~^ ERROR E0005
//~| NOTE pattern `None` not covered
}

View File

@ -12,7 +12,6 @@ fn main() {
match Some(()) {
None => { },
option if option.take().is_none() => {}, //~ ERROR E0301
//~| NOTE borrowed mutably in pattern guard
Some(_) => { }
}
}

View File

@ -12,7 +12,6 @@ fn main() {
match Some(()) {
None => { },
option if { option = None; false } => { }, //~ ERROR E0302
//~| NOTE assignment in pattern guard
Some(_) => { }
}
}

View File

@ -12,10 +12,7 @@ fn main() {
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 => {},
}
}

View File

@ -14,7 +14,5 @@ mod foo {
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() {}

View File

@ -21,8 +21,5 @@ struct Foo<T: ?Sized, U: ?Sized> {
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() {}

View File

@ -16,6 +16,5 @@ 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);
}

View File

@ -9,7 +9,6 @@
// except according to those terms.
enum Foo<T> { Bar } //~ ERROR E0392
//~| NOTE unused type parameter
fn main() {
}

View File

@ -12,8 +12,6 @@ trait A<T=Self> {}
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() {
}

View File

@ -13,8 +13,6 @@
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() {
}

View File

@ -12,6 +12,5 @@ static FOO: i32 = 42;
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() {
}

View File

@ -11,7 +11,6 @@
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() {
}

View File

@ -9,8 +9,6 @@
// 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() {
}

View File

@ -18,7 +18,6 @@ impl Foo for Bar {
fn a() {}
fn b() {}
//~^ ERROR E0407
//~| NOTE not a member of trait `Foo`
}
fn main() {

View File

@ -13,7 +13,6 @@ 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
_ => ()
}
}

View File

@ -12,6 +12,5 @@ fn main () {
loop {
break 'a;
//~^ ERROR E0426
//~| NOTE undeclared label `'a`
}
}

View File

@ -10,8 +10,6 @@
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 () {
}

View File

@ -11,5 +11,4 @@
fn main () {
let foo = 42u32;
let _: [u8; foo]; //~ ERROR E0435
//~| NOTE non-constant value
}

View File

@ -12,7 +12,6 @@ trait Foo {}
impl Foo for i32 {
type Bar = bool; //~ ERROR E0437
//~| NOTE not a member of trait `Foo`
}
fn main () {

View File

@ -13,7 +13,6 @@ trait Bar {}
impl Bar for i32 {
const BAR: bool = true; //~ ERROR E0438
//~| NOTE not a member of trait `Bar`
}
fn main () {

View File

@ -14,12 +14,9 @@ trait Foo {
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() {}

View File

@ -12,7 +12,6 @@ mod Foo {
struct Bar(u32);
pub fn bar() -> Bar { //~ ERROR E0446
//~| NOTE can't leak private type
Bar(0)
}
}

Some files were not shown because too many files have changed in this diff Show More