Moved compile-fail tests to ui tests.

This commit is contained in:
David Wood 2018-08-08 14:28:26 +02:00
parent fe28bcf1db
commit b16a30677f
No known key found for this signature in database
GPG Key ID: 01760B4F9F53F154
4052 changed files with 59249 additions and 0 deletions

View File

@ -0,0 +1,31 @@
error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access
--> $DIR/E0501.rs:28:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
LL | };
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
| ^ borrow occurs here
...
LL | drop(bar);
| --- borrow later used here
error[E0501]: cannot borrow `*a` as immutable because previous closure requires unique access
--> $DIR/E0501.rs:31:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
...
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
| ^ borrow occurs here
...
LL | drop(bar);
| --- borrow later used here
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0501`.

View File

@ -0,0 +1,31 @@
error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access
--> $DIR/E0501.rs:28:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - previous borrow occurs due to use of `a` in closure
LL | };
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
| ^ borrow occurs here
...
LL | }
| - borrow from closure ends here
error[E0501]: cannot borrow `*a` as immutable because previous closure requires unique access
--> $DIR/E0501.rs:31:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - previous borrow occurs due to use of `a` in closure
...
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
| ^ borrow occurs here
...
LL | }
| - borrow from closure ends here
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0501`.

View File

@ -0,0 +1,31 @@
error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access
--> $DIR/E0501.rs:28:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
LL | };
LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access
| ^ borrow occurs here
...
LL | drop(bar);
| --- borrow later used here
error[E0501]: cannot borrow `*a` as immutable because previous closure requires unique access
--> $DIR/E0501.rs:31:23
|
LL | let bar = || {
| -- closure construction occurs here
LL | inside_closure(a)
| - first borrow occurs due to use of `a` in closure
...
LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access
| ^ borrow occurs here
...
LL | drop(bar);
| --- borrow later used here
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0501`.

View File

@ -0,0 +1,14 @@
error[E0506]: cannot assign to `fancy_num` because it is borrowed
--> $DIR/E0506.rs:21:5
|
LL | let fancy_ref = &fancy_num;
| ---------- borrow of `fancy_num` occurs here
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
...
LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
| ------------- borrow later used here
error: aborting due to previous error
For more information about this error, try `rustc --explain E0506`.

View File

@ -0,0 +1,11 @@
error[E0506]: cannot assign to `fancy_num` because it is borrowed
--> $DIR/E0506.rs:21:5
|
LL | let fancy_ref = &fancy_num;
| --------- borrow of `fancy_num` occurs here
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
error: aborting due to previous error
For more information about this error, try `rustc --explain E0506`.

View File

@ -0,0 +1,14 @@
error[E0506]: cannot assign to `fancy_num` because it is borrowed
--> $DIR/E0506.rs:21:5
|
LL | let fancy_ref = &fancy_num;
| ---------- borrow of `fancy_num` occurs here
LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here
...
LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num);
| ------------- borrow later used here
error: aborting due to previous error
For more information about this error, try `rustc --explain E0506`.

View File

@ -0,0 +1,12 @@
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
--> $DIR/E0508.rs:18:18
|
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
| ^^^^^^^^
| |
| cannot move out of here
| help: consider using a reference instead: `&array[0]`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0508`.

View File

@ -0,0 +1,12 @@
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
--> $DIR/E0508.rs:18:18
|
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
| ^^^^^^^^
| |
| cannot move out of here
| help: consider using a reference instead: `&array[0]`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0508`.

View File

@ -0,0 +1,11 @@
error[E0583]: file not found for module `module_that_doesnt_exist`
--> $DIR/E0583.rs:11:5
|
LL | mod module_that_doesnt_exist; //~ ERROR E0583
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: name the file either module_that_doesnt_exist.rs or module_that_doesnt_exist/mod.rs inside the directory "$DIR"
error: aborting due to previous error
For more information about this error, try `rustc --explain E0583`.

View File

@ -0,0 +1,9 @@
error[E0594]: cannot assign to immutable static item `NUM`
--> $DIR/E0594.rs:17:5
|
LL | NUM = 20; //[ast]~ ERROR E0594
| ^^^^^^^^ cannot assign
error: aborting due to previous error
For more information about this error, try `rustc --explain E0594`.

View File

@ -0,0 +1,9 @@
error[E0594]: cannot assign to immutable static item
--> $DIR/E0594.rs:17:5
|
LL | NUM = 20; //[ast]~ ERROR E0594
| ^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0594`.

View File

@ -0,0 +1,9 @@
error[E0594]: cannot assign to immutable static item `NUM`
--> $DIR/E0594.rs:17:5
|
LL | NUM = 20; //[ast]~ ERROR E0594
| ^^^^^^^^ cannot assign
error: aborting due to previous error
For more information about this error, try `rustc --explain E0594`.

View File

@ -0,0 +1,11 @@
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/E0596.rs:16:13
|
LL | let x = 1;
| - help: consider changing this to be mutable: `mut x`
LL | let y = &mut x; //[ast]~ ERROR [E0596]
| ^^^^^^ cannot borrow as mutable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0596`.

View File

@ -0,0 +1,11 @@
error[E0596]: cannot borrow immutable local variable `x` as mutable
--> $DIR/E0596.rs:16:18
|
LL | let x = 1;
| - consider changing this to `mut x`
LL | let y = &mut x; //[ast]~ ERROR [E0596]
| ^ cannot borrow mutably
error: aborting due to previous error
For more information about this error, try `rustc --explain E0596`.

View File

@ -0,0 +1,11 @@
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/E0596.rs:16:13
|
LL | let x = 1;
| - help: consider changing this to be mutable: `mut x`
LL | let y = &mut x; //[ast]~ ERROR [E0596]
| ^^^^^^ cannot borrow as mutable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0596`.

View File

@ -0,0 +1,21 @@
error[E0433]: failed to resolve. crate root in paths can only be used in start position
--> $DIR/absolute-paths-in-nested-use-groups.rs:16:5
|
LL | ::bar, //~ ERROR crate root in paths can only be used in start position
| ^ crate root in paths can only be used in start position
error[E0433]: failed to resolve. `super` in paths can only be used in start position
--> $DIR/absolute-paths-in-nested-use-groups.rs:17:5
|
LL | super::bar, //~ ERROR `super` in paths can only be used in start position
| ^^^^^ `super` in paths can only be used in start position
error[E0433]: failed to resolve. `self` in paths can only be used in start position
--> $DIR/absolute-paths-in-nested-use-groups.rs:18:5
|
LL | self::bar, //~ ERROR `self` in paths can only be used in start position
| ^^^^ `self` in paths can only be used in start position
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0433`.

View File

@ -0,0 +1,12 @@
error[E0507]: cannot move out of borrowed content
--> $DIR/access-mode-in-closures.rs:19:15
|
LL | match *s { sty(v) => v } //~ ERROR cannot move out
| ^^ - move occurs because v has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait
| |
| cannot move out of borrowed content
| help: consider removing this dereference operator: `s`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0507`.

View File

@ -0,0 +1,11 @@
error[E0507]: cannot move out of borrowed content
--> $DIR/access-mode-in-closures.rs:19:15
|
LL | match *s { sty(v) => v } //~ ERROR cannot move out
| ^^ - hint: to prevent move, use `ref v` or `ref mut v`
| |
| cannot move out of borrowed content
error: aborting due to previous error
For more information about this error, try `rustc --explain E0507`.

View File

@ -0,0 +1,14 @@
error: return type should be `!`
--> $DIR/alloc-error-handler-bad-signature-1.rs:22:6
|
LL | ) -> () //~ ERROR return type should be `!`
| ^^
error: argument should be `Layout`
--> $DIR/alloc-error-handler-bad-signature-1.rs:21:11
|
LL | info: &Layout, //~ ERROR argument should be `Layout`
| ^^^^^^^
error: aborting due to 2 previous errors

View File

@ -0,0 +1,14 @@
error: return type should be `!`
--> $DIR/alloc-error-handler-bad-signature-2.rs:22:3
|
LL | ) { //~ ERROR return type should be `!`
| ^
error: argument should be `Layout`
--> $DIR/alloc-error-handler-bad-signature-2.rs:21:11
|
LL | info: Layout, //~ ERROR argument should be `Layout`
| ^^^^^^
error: aborting due to 2 previous errors

View File

@ -0,0 +1,10 @@
error: function should have one argument
--> $DIR/alloc-error-handler-bad-signature-3.rs:20:1
|
LL | / fn oom() -> ! { //~ ERROR function should have one argument
LL | | loop {}
LL | | }
| |_^
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
error: allocators must be statics
--> $DIR/function-allocator.rs:13:1
|
LL | fn foo() {} //~ ERROR: allocators must be statics
| ^^^^^^^^^^^
error: aborting due to previous error

View File

@ -0,0 +1,35 @@
error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:12:1
|
LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
|
= note: required by `std::alloc::GlobalAlloc::alloc`
error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:12:1
|
LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
|
= note: required by `std::alloc::GlobalAlloc::dealloc`
error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:12:1
|
LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
|
= note: required by `std::alloc::GlobalAlloc::realloc`
error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
--> $DIR/not-an-allocator.rs:12:1
|
LL | static A: usize = 0;
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
|
= note: required by `std::alloc::GlobalAlloc::alloc_zeroed`
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -0,0 +1,8 @@
error: cannot define more than one #[global_allocator]
--> $DIR/two-allocators.rs:16:1
|
LL | static B: System = System;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -0,0 +1,4 @@
error: the #[global_allocator] in this crate conflicts with global allocator in: system_allocator
error: aborting due to previous error

View File

@ -0,0 +1,4 @@
error: the #[global_allocator] in system_allocator conflicts with this global allocator in: system_allocator2
error: aborting due to previous error

View File

@ -0,0 +1,34 @@
error: anonymous parameters are deprecated and will be removed in the next edition.
--> $DIR/anon-params-deprecated.rs:15:12
|
LL | fn foo(i32); //~ ERROR anonymous parameters are deprecated
| ^^^ help: Try naming the parameter or explicitly ignoring it: `_: i32`
|
note: lint level defined here
--> $DIR/anon-params-deprecated.rs:11:11
|
LL | #![forbid(anonymous_parameters)]
| ^^^^^^^^^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
error: anonymous parameters are deprecated and will be removed in the next edition.
--> $DIR/anon-params-deprecated.rs:18:30
|
LL | fn bar_with_default_impl(String, String) {}
| ^^^^^^ help: Try naming the parameter or explicitly ignoring it: `_: String`
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
error: anonymous parameters are deprecated and will be removed in the next edition.
--> $DIR/anon-params-deprecated.rs:18:38
|
LL | fn bar_with_default_impl(String, String) {}
| ^^^^^^ help: Try naming the parameter or explicitly ignoring it: `_: String`
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
error: aborting due to 3 previous errors

View File

@ -0,0 +1,12 @@
error[E0061]: this function takes 1 parameter but 0 parameters were supplied
--> $DIR/arg-count-mismatch.rs:15:28
|
LL | fn f(x: isize) { }
| -------------- defined here
LL |
LL | fn main() { let i: (); i = f(); }
| ^^^ expected 1 parameter
error: aborting due to previous error
For more information about this error, try `rustc --explain E0061`.

View File

@ -0,0 +1,12 @@
error[E0308]: mismatched types
--> $DIR/arg-type-mismatch.rs:16:30
|
LL | fn main() { let i: (); i = f(()); }
| ^^ expected isize, found ()
|
= note: expected type `isize`
found type `()`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.

View File

@ -0,0 +1,21 @@
error[E0308]: mismatched types
--> $DIR/array-not-vector.rs:12:19
|
LL | let _x: i32 = [1, 2, 3];
| ^^^^^^^^^ expected i32, found array of 3 elements
|
= note: expected type `i32`
found type `[{integer}; 3]`
error[E0308]: mismatched types
--> $DIR/array-not-vector.rs:19:20
|
LL | let _y: &i32 = x;
| ^ expected i32, found slice
|
= note: expected type `&i32`
found type `&[i32]`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.

View File

@ -0,0 +1,12 @@
error: this constant cannot be used
--> $DIR/array_const_index-0.rs:12:1
|
LL | const B: i32 = (&A)[1];
| ^^^^^^^^^^^^^^^-------^
| |
| index out of bounds: the len is 0 but the index is 1
|
= note: #[deny(const_err)] on by default
error: aborting due to previous error

View File

@ -0,0 +1,12 @@
error: this constant cannot be used
--> $DIR/array_const_index-1.rs:12:1
|
LL | const B: i32 = A[1];
| ^^^^^^^^^^^^^^^----^
| |
| index out of bounds: the len is 0 but the index is 1
|
= note: #[deny(const_err)] on by default
error: aborting due to previous error

View File

@ -0,0 +1,9 @@
error[E0664]: clobber should not be surrounded by braces
--> $DIR/asm-bad-clobber.rs:32:37
|
LL | asm!("xor %eax, %eax" : : : "{eax}");
| ^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0664`.

View File

@ -0,0 +1,16 @@
error[E0662]: input operand constraint contains '='
--> $DIR/asm-in-bad-modifier.rs:33:39
|
LL | asm!("mov $1, $0" : "=r"(x) : "=r"(5)); //~ ERROR operand constraint contains '='
| ^^^^
error[E0663]: input operand constraint contains '+'
--> $DIR/asm-in-bad-modifier.rs:34:39
|
LL | asm!("mov $1, $0" : "=r"(y) : "+r"(5)); //~ ERROR operand constraint contains '+'
| ^^^^
error: aborting due to 2 previous errors
Some errors occurred: E0662, E0663.
For more information about an error, try `rustc --explain E0662`.

View File

@ -0,0 +1,26 @@
warning: unrecognized option
--> $DIR/asm-misplaced-option.rs:36:64
|
LL | asm!("mov $1, $0" : "=r"(x) : "r"(5_usize), "0"(x) : : "cc");
| ^^^^
warning: expected a clobber, found an option
--> $DIR/asm-misplaced-option.rs:43:80
|
LL | asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8_usize) : "cc", "volatile");
| ^^^^^^^^^^
error: compilation successful
--> $DIR/asm-misplaced-option.rs:31:1
|
LL | / pub fn main() { //~ ERROR compilation successful
LL | | // assignment not dead
LL | | let mut x: isize = 0;
LL | | unsafe {
... |
LL | | assert_eq!(x, 13);
LL | | }
| |_^
error: aborting due to previous error

View File

@ -0,0 +1,9 @@
error[E0661]: output operand constraint lacks '=' or '+'
--> $DIR/asm-out-no-modifier.rs:32:29
|
LL | asm!("mov $1, $0" : "r"(x) : "r"(5)); //~ ERROR output operand constraint lacks '='
| ^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0661`.

View File

@ -0,0 +1,9 @@
error[E0381]: use of possibly uninitialized variable: `x`
--> $DIR/asm-out-read-uninit.rs:35:43
|
LL | asm!("mov $1, $0" : "=r"(x) : "r"(x));
| ^ use of possibly uninitialized `x`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0381`.

View File

@ -0,0 +1,9 @@
error[E0381]: use of possibly uninitialized variable: `x`
--> $DIR/asm-out-read-uninit.rs:35:43
|
LL | asm!("mov $1, $0" : "=r"(x) : "r"(x));
| ^ use of possibly uninitialized `x`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0381`.

View File

@ -0,0 +1,11 @@
error: <inline asm>:1:2: error: invalid instruction mnemonic 'nowayisthisavalidinstruction'
nowayisthisavalidinstruction
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
--> $DIR/asm-src-loc-codegen-units.rs:20:9
|
LL | asm!("nowayisthisavalidinstruction"); //~ ERROR instruction
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -0,0 +1,11 @@
error: <inline asm>:1:2: error: invalid instruction mnemonic 'nowayisthisavalidinstruction'
nowayisthisavalidinstruction
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
--> $DIR/asm-src-loc.rs:17:9
|
LL | asm!("nowayisthisavalidinstruction"); //~ ERROR instruction
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View File

@ -0,0 +1,15 @@
error[E0384]: cannot assign twice to immutable variable `v`
--> $DIR/assign-imm-local-twice.rs:20:5
|
LL | let v: isize;
| - consider changing this to `mut v`
LL | //[mir]~^ NOTE consider changing this to `mut v`
LL | v = 1; //[ast]~ NOTE first assignment
| ----- first assignment to `v`
...
LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
| ^^^^^ cannot assign twice to immutable variable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0384`.

View File

@ -0,0 +1,12 @@
error[E0384]: cannot assign twice to immutable variable `v`
--> $DIR/assign-imm-local-twice.rs:20:5
|
LL | v = 1; //[ast]~ NOTE first assignment
| ----- first assignment to `v`
...
LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
| ^^^^^ cannot assign twice to immutable variable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0384`.

View File

@ -0,0 +1,15 @@
error[E0384]: cannot assign twice to immutable variable `v`
--> $DIR/assign-imm-local-twice.rs:20:5
|
LL | let v: isize;
| - consider changing this to `mut v`
LL | //[mir]~^ NOTE consider changing this to `mut v`
LL | v = 1; //[ast]~ NOTE first assignment
| ----- first assignment to `v`
...
LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable
| ^^^^^ cannot assign twice to immutable variable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0384`.

View File

@ -0,0 +1,11 @@
error[E0615]: attempted to take value of method `speak` on type `cat`
--> $DIR/assign-to-method.rs:30:8
|
LL | nyan.speak = || println!("meow"); //~ ERROR attempted to take value of method
| ^^^^^
|
= help: maybe a `()` to call it is missing?
error: aborting due to previous error
For more information about this error, try `rustc --explain E0615`.

View File

@ -0,0 +1,13 @@
error[E0368]: binary assignment operation `+=` cannot be applied to type `Foo`
--> $DIR/assignment-operator-unimplemented.rs:16:3
|
LL | a += *b; //~ Error: binary assignment operation `+=` cannot be applied to type `Foo`
| -^^^^^^
| |
| cannot use `+=` on type `Foo`
|
= note: an implementation of `std::ops::AddAssign` might be missing for `Foo`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0368`.

View File

@ -0,0 +1,9 @@
error[E0202]: associated types are not allowed in inherent impls
--> $DIR/assoc-inherent.rs:16:5
|
LL | type Bar = isize; //~ERROR associated types are not allowed in inherent impls
| ^^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0202`.

View File

@ -0,0 +1,20 @@
error[E0034]: multiple applicable items in scope
--> $DIR/associated-const-ambiguity-report.rs:28:16
|
LL | const X: i32 = <i32>::ID; //~ ERROR E0034
| ^^^^^^^^^ multiple `ID` found
|
note: candidate #1 is defined in an impl of the trait `Foo` for the type `i32`
--> $DIR/associated-const-ambiguity-report.rs:21:5
|
LL | const ID: i32 = 1;
| ^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in an impl of the trait `Bar` for the type `i32`
--> $DIR/associated-const-ambiguity-report.rs:25:5
|
LL | const ID: i32 = 3;
| ^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0034`.

View File

@ -0,0 +1,15 @@
error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/associated-const-array-len.rs:16:16
|
LL | const X: [i32; <i32 as Foo>::ID] = [0, 1, 2];
| ^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i32`
|
note: required by `Foo::ID`
--> $DIR/associated-const-array-len.rs:13:5
|
LL | const ID: usize;
| ^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.

View File

@ -0,0 +1,14 @@
error: associated const is never used: `BAR`
--> $DIR/associated-const-dead-code.rs:16:5
|
LL | const BAR: u32 = 1;
| ^^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/associated-const-dead-code.rs:11:9
|
LL | #![deny(dead_code)]
| ^^^^^^^^^
error: aborting due to previous error

View File

@ -0,0 +1,11 @@
error[E0277]: the trait bound `T: Foo` is not satisfied
--> $DIR/associated-const-generic-obligations.rs:25:5
|
LL | const FROM: &'static str = "foo";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `T`
|
= help: consider adding a `where T: Foo` bound
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.

View File

@ -0,0 +1,11 @@
error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/associated-const-in-trait.rs:19:6
|
LL | impl Trait {
| ^^^^^ the trait `Trait` cannot be made into an object
|
= note: the trait cannot contain associated consts like `N`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0038`.

View File

@ -0,0 +1,13 @@
error[E0599]: no associated item named `ID` found for type `i32` in the current scope
--> $DIR/associated-const-no-item.rs:16:16
|
LL | const X: i32 = <i32>::ID;
| ^^^^^^^^^ associated item not found in `i32`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `ID`, perhaps you need to implement it:
candidate #1: `Foo`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.

View File

@ -0,0 +1,9 @@
error[E0624]: associated constant `ID` is private
--> $DIR/associated-const-private-impl.rs:24:19
|
LL | assert_eq!(1, bar1::Foo::ID);
| ^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0624`.

View File

@ -0,0 +1,15 @@
error[E0158]: associated consts cannot be referenced in patterns
--> $DIR/associated-const-type-parameter-arms.rs:31:9
|
LL | A::X => println!("A::X"),
| ^^^^
error[E0158]: associated consts cannot be referenced in patterns
--> $DIR/associated-const-type-parameter-arms.rs:33:9
|
LL | B::X => println!("B::X"),
| ^^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0158`.

View File

@ -0,0 +1,16 @@
error[E0277]: the trait bound `A: Foo` is not satisfied
--> $DIR/associated-const-type-parameter-arrays-2.rs:27:22
|
LL | let _array = [4; <A as Foo>::Y];
| ^^^^^^^^^^^^^ the trait `Foo` is not implemented for `A`
|
= help: consider adding a `where A: Foo` bound
note: required by `Foo::Y`
--> $DIR/associated-const-type-parameter-arrays-2.rs:13:5
|
LL | const Y: usize;
| ^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.

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