提交 7486b9c2 编写于 作者: B bors

Auto merge of #59044 - petrochenkov:uiui, r=davidtwco

Filter away test annotations from UI test output

If you worked with UI tests for some time you could notice one issue affecting their readability and also readability of diffs when the tests change.
Look at the output of this test.
```rust
fn main() {
    let 1 = 2; //~ ERROR refutable pattern in local binding
}
```
```
error[E0005]: refutable pattern in local binding: `-2147483648i32..=0i32` not covered
 --> src/main.rs:2:9
  |
2 |     let 1 = 2; //~ ERROR refutable pattern in local binding
  |         ^ pattern `-2147483648i32..=0i32` not covered

error: aborting due to previous error

For more information about this error, try `rustc --explain E0005`.
```
You can see that the "refutable pattern in local binding" is duplicated.
One instance is the actual error, and the second instance is the expected error annotation.
This annotation is useful in the test input, but in the output it clutters the text and makes it harder to see what text refers to actual errors and what is just comments, especially if there are many errors in a single test file.

@estebank [reported](https://github.com/rust-lang/rust/pull/57379#discussion_r245523361) using the next trick to avoid the clutter
```rust
fn main() {
    let 1 = 2;
    //~^ ERROR refutable pattern in local binding
}
```
```
error[E0005]: refutable pattern in local binding: `-2147483648i32..=0i32` not covered
 --> src/main.rs:2:9
  |
2 |     let 1 = 2;
  |         ^ pattern `-2147483648i32..=0i32` not covered

error: aborting due to previous error

For more information about this error, try `rustc --explain E0005`.
```
, i.e. using `//~^` and placing the annotation one line below will remove the annotation from the output.

However, this doesn't always works (consider errors with multi-line spans), and shouldn't be necessary in general!
`compiletest` could automatically filter away its own annotations from the output instead.
This is exactly what this PR does.

r? @davidtwco

要显示的变更太多。

To preserve performance only 1000 of 1000+ files are displayed.
error: `[v2]` cannot be resolved, ignoring it...
--> $DIR/deny-intra-link-resolution-failure.rs:3:6
|
LL | /// [v2] //~ ERROR
LL | /// [v2]
| ^^ cannot be resolved, ignoring
|
note: lint level defined here
......
error: missing documentation for crate
--> $DIR/deny-missing-docs-crate.rs:1:1
|
LL | / #![deny(missing_docs)] //~ ERROR
LL | / #![deny(missing_docs)]
LL | |
LL | | pub struct Foo; //~ ERROR
LL | | pub struct Foo;
| |_______________^
|
note: lint level defined here
--> $DIR/deny-missing-docs-crate.rs:1:9
|
LL | #![deny(missing_docs)] //~ ERROR
LL | #![deny(missing_docs)]
| ^^^^^^^^^^^^
error: missing documentation for a struct
--> $DIR/deny-missing-docs-crate.rs:3:1
|
LL | pub struct Foo; //~ ERROR
LL | pub struct Foo;
| ^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
......
error: missing documentation for macro
--> $DIR/deny-missing-docs-macro.rs:6:1
|
LL | macro_rules! foo { //~ ERROR
LL | macro_rules! foo {
| ^^^^^^^^^^^^^^^^
|
note: lint level defined here
......
error: `[TypeAlias::hoge]` cannot be resolved, ignoring it...
--> $DIR/intra-doc-alias-ice.rs:5:30
|
LL | /// [broken cross-reference](TypeAlias::hoge) //~ ERROR
LL | /// [broken cross-reference](TypeAlias::hoge)
| ^^^^^^^^^^^^^^^ cannot be resolved, ignoring
|
note: lint level defined here
......
......@@ -3,7 +3,7 @@ error[E0597]: `arena` does not live long enough
|
LL | f(&arena);
| ^^^^^ borrowed value does not live long enough
LL | } //~^ ERROR `arena` does not live long enough
LL | }
| - `arena` dropped here while still borrowed
|
= note: values in a scope are dropped in the opposite order they are created
......
......@@ -3,7 +3,7 @@ error[E0597]: `arena` does not live long enough
|
LL | f(&arena);
| ^^^^^ borrowed value does not live long enough
LL | } //~^ ERROR `arena` does not live long enough
LL | }
| - `arena` dropped here while still borrowed
|
= note: values in a scope are dropped in the opposite order they are created
......
error: crate is not marked with #![crate_okay]
--> $DIR/issue-15778-fail.rs:5:1
|
LL | / #![feature(plugin)] //~ ERROR crate is not marked with #![crate_okay]
LL | / #![feature(plugin)]
LL | | #![plugin(lint_for_crate)]
LL | |
LL | | pub fn main() { }
......
error: item is named 'lintme'
--> $DIR/lint-group-plugin-deny-cmdline.rs:8:1
|
LL | fn lintme() { } //~ ERROR item is named 'lintme'
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
= note: `-D test-lint` implied by `-D lint-me`
......@@ -9,7 +9,7 @@ LL | fn lintme() { } //~ ERROR item is named 'lintme'
error: item is named 'pleaselintme'
--> $DIR/lint-group-plugin-deny-cmdline.rs:10:1
|
LL | fn pleaselintme() { } //~ ERROR item is named 'pleaselintme'
LL | fn pleaselintme() { }
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D please-lint` implied by `-D lint-me`
......
warning: item is named 'lintme'
--> $DIR/lint-group-plugin.rs:9:1
|
LL | fn lintme() { } //~ WARNING item is named 'lintme'
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
= note: #[warn(test_lint)] on by default
......@@ -9,7 +9,7 @@ LL | fn lintme() { } //~ WARNING item is named 'lintme'
warning: item is named 'pleaselintme'
--> $DIR/lint-group-plugin.rs:10:1
|
LL | fn pleaselintme() { } //~ WARNING item is named 'pleaselintme'
LL | fn pleaselintme() { }
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(please_lint)] on by default
......
warning: item is named 'lintme'
--> $DIR/lint-plugin-cmdline-load.rs:8:1
|
LL | fn lintme() { } //~ WARNING item is named 'lintme'
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
= note: #[warn(test_lint)] on by default
......
error: item is named 'lintme'
--> $DIR/lint-plugin-deny-attr.rs:8:1
|
LL | fn lintme() { } //~ ERROR item is named 'lintme'
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
note: lint level defined here
......
error: item is named 'lintme'
--> $DIR/lint-plugin-deny-cmdline.rs:8:1
|
LL | fn lintme() { } //~ ERROR item is named 'lintme'
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
= note: requested on the command line with `-D test-lint`
......
......@@ -10,7 +10,7 @@ LL | #[allow(test_lint)]
error: item is named 'lintme'
--> $DIR/lint-plugin-forbid-attrs.rs:8:1
|
LL | fn lintme() { } //~ ERROR item is named 'lintme'
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
note: lint level defined here
......
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-cmdline.rs:10:9
|
LL | #[allow(test_lint)] //~ ERROR allow(test_lint) overruled by outer forbid(test_lint)
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
|
= note: `forbid` lint level was set on command line
......@@ -9,7 +9,7 @@ LL | #[allow(test_lint)] //~ ERROR allow(test_lint) overruled by outer forbid(te
error: item is named 'lintme'
--> $DIR/lint-plugin-forbid-cmdline.rs:8:1
|
LL | fn lintme() { } //~ ERROR item is named 'lintme'
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
= note: requested on the command line with `-F test-lint`
......
warning: item is named 'lintme'
--> $DIR/lint-plugin.rs:8:1
|
LL | fn lintme() { } //~ WARNING item is named 'lintme'
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
= note: #[warn(test_lint)] on by default
......
......@@ -21,7 +21,7 @@ LL | #[allow(test_group)]
warning: unknown lint: `this_lint_does_not_exist`
--> $DIR/lint_tool_test.rs:27:8
|
LL | #[deny(this_lint_does_not_exist)] //~ WARNING unknown lint: `this_lint_does_not_exist`
LL | #[deny(this_lint_does_not_exist)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unknown_lints)] on by default
......@@ -35,7 +35,7 @@ LL | #![cfg_attr(foo, warn(test_lint))]
error: item is named 'lintme'
--> $DIR/lint_tool_test.rs:14:1
|
LL | fn lintme() { } //~ ERROR item is named 'lintme'
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
note: lint level defined here
......@@ -48,7 +48,7 @@ LL | #![deny(clippy_group)]
error: item is named 'lintmetoo'
--> $DIR/lint_tool_test.rs:22:5
|
LL | fn lintmetoo() { } //~ ERROR item is named 'lintmetoo'
LL | fn lintmetoo() { }
| ^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
......
error: compiler plugin used as an ordinary library
--> $DIR/plugin-as-extern-crate.rs:10:1
|
LL | extern crate attr_plugin_test; //~ ERROR compiler plugin used as an ordinary library
LL | extern crate attr_plugin_test;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
......
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
--> $DIR/E0508.rs:5:18
|
LL | let _value = array[0]; //~ ERROR [E0508]
LL | let _value = array[0];
| ^^^^^^^^
| |
| cannot move out of here
......
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
--> $DIR/E0508.rs:5:18
|
LL | let _value = array[0]; //~ ERROR [E0508]
LL | let _value = array[0];
| ^^^^^^^^
| |
| cannot move out of here
......
error[E0583]: file not found for module `module_that_doesnt_exist`
--> $DIR/E0583.rs:1:5
|
LL | mod module_that_doesnt_exist; //~ ERROR E0583
LL | mod module_that_doesnt_exist;
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: name the file either module_that_doesnt_exist.rs or module_that_doesnt_exist/mod.rs inside the directory "$DIR"
......
error[E0642]: patterns aren't allowed in methods without bodies
--> $DIR/E0642.rs:5:12
|
LL | fn foo((x, y): (i32, i32)); //~ ERROR patterns aren't allowed in methods without bodies
LL | fn foo((x, y): (i32, i32));
| ^^^^^^
help: give this argument a name or use an underscore to ignore it
|
LL | fn foo(_: (i32, i32)); //~ ERROR patterns aren't allowed in methods without bodies
LL | fn foo(_: (i32, i32));
| ^
error[E0642]: patterns aren't allowed in methods without bodies
--> $DIR/E0642.rs:7:12
|
LL | fn bar((x, y): (i32, i32)) {} //~ ERROR patterns aren't allowed in methods without bodies
LL | fn bar((x, y): (i32, i32)) {}
| ^^^^^^
help: give this argument a name or use an underscore to ignore it
|
LL | fn bar(_: (i32, i32)) {} //~ ERROR patterns aren't allowed in methods without bodies
LL | fn bar(_: (i32, i32)) {}
| ^
error[E0642]: patterns aren't allowed in methods without bodies
--> $DIR/E0642.rs:9:15
|
LL | fn method(S { .. }: S) {} //~ ERROR patterns aren't allowed in methods without bodies
LL | fn method(S { .. }: S) {}
| ^^^^^^^^
help: give this argument a name or use an underscore to ignore it
|
LL | fn method(_: S) {} //~ ERROR patterns aren't allowed in methods without bodies
LL | fn method(_: S) {}
| ^
error: aborting due to 3 previous errors
......
error[E0662]: input operand constraint contains '='
--> $DIR/E0662.rs:6:12
|
LL | : "=test"("a") //~ ERROR E0662
LL | : "=test"("a")
| ^^^^^^^
error: aborting due to previous error
......
error[E0663]: input operand constraint contains '+'
--> $DIR/E0663.rs:6:12
|
LL | : "+test"("a") //~ ERROR E0663
LL | : "+test"("a")
| ^^^^^^^
error: aborting due to previous error
......
error[E0664]: clobber should not be surrounded by braces
--> $DIR/E0664.rs:7:12
|
LL | : "{eax}" //~ ERROR E0664
LL | : "{eax}"
| ^^^^^^^
error: aborting due to previous error
......
error[E0665]: `Default` cannot be derived for enums, only structs
--> $DIR/E0665.rs:1:10
|
LL | #[derive(Default)] //~ ERROR E0665
LL | #[derive(Default)]
| ^^^^^^^
error: aborting due to previous error
......
error[E0433]: failed to resolve: crate root in paths can only be used in start position
--> $DIR/absolute-paths-in-nested-use-groups.rs:6:5
|
LL | ::bar, //~ ERROR crate root in paths can only be used in start position
LL | ::bar,
| ^ 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:7:5
|
LL | super::bar, //~ ERROR `super` in paths can only be used in start position
LL | super::bar,
| ^^^^^ `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:8:5
|
LL | self::bar, //~ ERROR `self` in paths can only be used in start position
LL | self::bar,
| ^^^^ `self` in paths can only be used in start position
error: aborting due to 3 previous errors
......
error[E0507]: cannot move out of borrowed content
--> $DIR/access-mode-in-closures.rs:8:15
|
LL | match *s { S(v) => v } //~ ERROR cannot move out
LL | match *s { S(v) => v }
| ^^ - data moved here
| |
| cannot move out of borrowed content
......@@ -10,7 +10,7 @@ LL | match *s { S(v) => v } //~ ERROR cannot move out
note: move occurs because `v` has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait
--> $DIR/access-mode-in-closures.rs:8:22
|
LL | match *s { S(v) => v } //~ ERROR cannot move out
LL | match *s { S(v) => v }
| ^
error: aborting due to previous error
......
error[E0507]: cannot move out of borrowed content
--> $DIR/access-mode-in-closures.rs:8:15
|
LL | match *s { S(v) => v } //~ ERROR cannot move out
LL | match *s { S(v) => v }
| ^^ - hint: to prevent move, use `ref v` or `ref mut v`
| |
| cannot move out of borrowed content
......
error: return type should be `!`
--> $DIR/alloc-error-handler-bad-signature-1.rs:12:6
|
LL | ) -> () //~ ERROR return type should be `!`
LL | ) -> ()
| ^^
error: argument should be `Layout`
--> $DIR/alloc-error-handler-bad-signature-1.rs:11:11
|
LL | info: &Layout, //~ ERROR argument should be `Layout`
LL | info: &Layout,
| ^^^^^^^
error: aborting due to 2 previous errors
......
error: return type should be `!`
--> $DIR/alloc-error-handler-bad-signature-2.rs:12:3
|
LL | ) { //~ ERROR return type should be `!`
LL | ) {
| ^
error: argument should be `Layout`
--> $DIR/alloc-error-handler-bad-signature-2.rs:11:11
|
LL | info: Layout, //~ ERROR argument should be `Layout`
LL | info: Layout,
| ^^^^^^
error: aborting due to 2 previous errors
......
error: function should have one argument
--> $DIR/alloc-error-handler-bad-signature-3.rs:10:1
|
LL | fn oom() -> ! { //~ ERROR function should have one argument
LL | fn oom() -> ! {
| ^^^^^^^^^^^^^
error: aborting due to previous error
......
error: `global_allocator` cannot be used in submodules
--> $DIR/allocator-submodule.rs:27:5
|
LL | static MY_HEAP: MyAlloc = MyAlloc; //~ ERROR global_allocator
LL | static MY_HEAP: MyAlloc = MyAlloc;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
......
error: allocators must be statics
--> $DIR/function-allocator.rs:2:1
|
LL | fn foo() {} //~ ERROR: allocators must be statics
LL | fn foo() {}
| ^^^^^^^^^^^
error: aborting due to previous error
......
error: expected one of `:` or `@`, found `)`
--> $DIR/anon-params-denied-2018.rs:6:15
|
LL | fn foo(i32); //~ expected one of `:` or `@`, found `)`
LL | fn foo(i32);
| ---^ expected one of `:` or `@` here
| |
| help: explicitly ignore parameter: `_: i32`
......
warning: anonymous parameters are deprecated and will be removed in the next edition.
--> $DIR/anon-params-deprecated.rs:9:12
|
LL | fn foo(i32); //~ WARNING anonymous parameters are deprecated
LL | fn foo(i32);
| ^^^ help: Try naming the parameter or explicitly ignoring it: `_: i32`
|
note: lint level defined here
......
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:2:5
|
LL | f1(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | f1(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'r, 's> fn(&'r (), &'s ()) -> _`
......@@ -15,7 +15,7 @@ LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:2:5
|
LL | f1(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | f1(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `fn(&(), &()) -> _`
......@@ -29,7 +29,7 @@ LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
|
LL | f2(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | f2(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'a, 'r> fn(&'a (), &'r ()) -> _`
......@@ -43,7 +43,7 @@ LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
|
LL | f2(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | f2(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `fn(&'a (), &()) -> _`
......@@ -57,7 +57,7 @@ LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
|
LL | f3(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | f3(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'r> fn(&(), &'r ()) -> _`
......@@ -71,7 +71,7 @@ LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
|
LL | f3(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | f3(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `fn(&(), &()) -> _`
......@@ -85,7 +85,7 @@ LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
|
LL | f4(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | f4(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'s, 'r> fn(&'s (), &'r ()) -> _`
......@@ -99,7 +99,7 @@ LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
|
LL | f4(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | f4(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `fn(&(), &'r ()) -> _`
......@@ -113,7 +113,7 @@ LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
|
LL | f5(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | f5(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'r> fn(&'r (), &'r ()) -> _`
......@@ -127,7 +127,7 @@ LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
|
LL | f5(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | f5(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `fn(&'r (), &'r ()) -> _`
......@@ -141,7 +141,7 @@ LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
|
LL | g1(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | g1(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'r> fn(&'r (), std::boxed::Box<(dyn for<'s> std::ops::Fn(&'s ()) + 'static)>) -> _`
......@@ -155,7 +155,7 @@ LL | fn g1<F>(_: F) where F: Fn(&(), Box<Fn(&())>) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
|
LL | g1(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | g1(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `fn(&(), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _`
......@@ -169,7 +169,7 @@ LL | fn g1<F>(_: F) where F: Fn(&(), Box<Fn(&())>) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:14:5
|
LL | g2(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | g2(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'r> fn(&'r (), for<'s> fn(&'s ())) -> _`
......@@ -183,7 +183,7 @@ LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:14:5
|
LL | g2(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | g2(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `fn(&(), for<'r> fn(&'r ())) -> _`
......@@ -197,7 +197,7 @@ LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:16:5
|
LL | g3(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | g3(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'s> fn(&'s (), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _`
......@@ -211,7 +211,7 @@ LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<Fn(&())>) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:16:5
|
LL | g3(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | g3(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `fn(&'s (), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _`
......@@ -225,7 +225,7 @@ LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<Fn(&())>) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:18:5
|
LL | g4(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | g4(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'s> fn(&'s (), for<'r> fn(&'r ())) -> _`
......@@ -239,7 +239,7 @@ LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:18:5
|
LL | g4(|_: (), _: ()| {}); //~ ERROR type mismatch
LL | g4(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `fn(&(), for<'r> fn(&'r ())) -> _`
......@@ -253,7 +253,7 @@ LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:20:5
|
LL | h1(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
LL | h1(|_: (), _: (), _: (), _: ()| {});
| ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
| |
| expected signature of `for<'r, 's> fn(&'r (), std::boxed::Box<(dyn for<'t0> std::ops::Fn(&'t0 ()) + 'static)>, &'s (), for<'t0, 't1> fn(&'t0 (), &'t1 ())) -> _`
......@@ -267,7 +267,7 @@ LL | fn h1<F>(_: F) where F: Fn(&(), Box<Fn(&())>, &(), fn(&(), &())) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:20:5
|
LL | h1(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
LL | h1(|_: (), _: (), _: (), _: ()| {});
| ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
| |
| expected signature of `fn(&(), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>, &(), for<'r, 's> fn(&'r (), &'s ())) -> _`
......@@ -281,7 +281,7 @@ LL | fn h1<F>(_: F) where F: Fn(&(), Box<Fn(&())>, &(), fn(&(), &())) {}
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:22:5
|
LL | h2(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
LL | h2(|_: (), _: (), _: (), _: ()| {});
| ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
| |
| expected signature of `for<'r, 't0> fn(&'r (), std::boxed::Box<(dyn for<'s> std::ops::Fn(&'s ()) + 'static)>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _`
......@@ -295,7 +295,7 @@ LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<Fn(&())>, &'t0 (), fn(&(), &()
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:22:5
|
LL | h2(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
LL | h2(|_: (), _: (), _: (), _: ()| {});
| ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
| |
| expected signature of `fn(&(), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>, &'t0 (), for<'r, 's> fn(&'r (), &'s ())) -> _`
......
error[E0268]: `break` outside of loop
--> $DIR/array-break-length.rs:3:17
|
LL | |_: [_; break]| {} //~ ERROR: `break` outside of loop
LL | |_: [_; break]| {}
| ^^^^^ cannot break outside of a loop
error[E0268]: `continue` outside of loop
--> $DIR/array-break-length.rs:7:17
|
LL | |_: [_; continue]| {} //~ ERROR: `continue` outside of loop
LL | |_: [_; continue]| {}
| ^^^^^^^^ cannot break outside of a loop
error: aborting due to 2 previous errors
......
error[E0662]: input operand constraint contains '='
--> $DIR/asm-in-bad-modifier.rs:23:39
|
LL | asm!("mov $1, $0" : "=r"(x) : "=r"(5)); //~ ERROR operand constraint contains '='
LL | asm!("mov $1, $0" : "=r"(x) : "=r"(5));
| ^^^^
error[E0663]: input operand constraint contains '+'
--> $DIR/asm-in-bad-modifier.rs:24:39
|
LL | asm!("mov $1, $0" : "=r"(y) : "+r"(5)); //~ ERROR operand constraint contains '+'
LL | asm!("mov $1, $0" : "=r"(y) : "+r"(5));
| ^^^^
error: aborting due to 2 previous errors
......
error[E0661]: output operand constraint lacks '=' or '+'
--> $DIR/asm-out-no-modifier.rs:22:29
|
LL | asm!("mov $1, $0" : "r"(x) : "r"(5)); //~ ERROR output operand constraint lacks '='
LL | asm!("mov $1, $0" : "r"(x) : "r"(5));
| ^^^
error: aborting due to previous error
......
error: macro requires a string literal as an argument
--> $DIR/asm-parse-errors.rs:4:5
|
LL | asm!(); //~ ERROR requires a string literal as an argument
LL | asm!();
| ^^^^^^^ string literal required
error: expected string literal
--> $DIR/asm-parse-errors.rs:5:18
|
LL | asm!("nop" : struct); //~ ERROR expected string literal
LL | asm!("nop" : struct);
| ^^^^^^ expected string literal
error: expected string literal
--> $DIR/asm-parse-errors.rs:6:30
|
LL | asm!("mov %eax, $$0x2" : struct); //~ ERROR expected string literal
LL | asm!("mov %eax, $$0x2" : struct);
| ^^^^^^ expected string literal
error: expected `(`, found keyword `struct`
--> $DIR/asm-parse-errors.rs:7:39
|
LL | asm!("mov %eax, $$0x2" : "={eax}" struct); //~ ERROR expected `(`
LL | asm!("mov %eax, $$0x2" : "={eax}" struct);
| ^^^^^^ expected `(`
error: expected expression, found keyword `struct`
--> $DIR/asm-parse-errors.rs:8:39
|
LL | asm!("mov %eax, $$0x2" : "={eax}"(struct)); //~ ERROR expected expression
LL | asm!("mov %eax, $$0x2" : "={eax}"(struct));
| ^^^^^^ expected expression
error: expected string literal
--> $DIR/asm-parse-errors.rs:9:44
|
LL | asm!("in %dx, %al" : "={al}"(result) : struct); //~ ERROR expected string literal
LL | asm!("in %dx, %al" : "={al}"(result) : struct);
| ^^^^^^ expected string literal
error: expected `(`, found keyword `struct`
--> $DIR/asm-parse-errors.rs:10:51
|
LL | asm!("in %dx, %al" : "={al}"(result) : "{dx}" struct); //~ ERROR expected `(`
LL | asm!("in %dx, %al" : "={al}"(result) : "{dx}" struct);
| ^^^^^^ expected `(`
error: expected expression, found keyword `struct`
--> $DIR/asm-parse-errors.rs:11:51
|
LL | asm!("in %dx, %al" : "={al}"(result) : "{dx}"(struct)); //~ ERROR expected expression
LL | asm!("in %dx, %al" : "={al}"(result) : "{dx}"(struct));
| ^^^^^^ expected expression
error: expected string literal
--> $DIR/asm-parse-errors.rs:12:36
|
LL | asm!("mov $$0x200, %eax" : : : struct); //~ ERROR expected string literal
LL | asm!("mov $$0x200, %eax" : : : struct);
| ^^^^^^ expected string literal
error: expected string literal
--> $DIR/asm-parse-errors.rs:13:45
|
LL | asm!("mov eax, 2" : "={eax}"(foo) : : : struct); //~ ERROR expected string literal
LL | asm!("mov eax, 2" : "={eax}"(foo) : : : struct);
| ^^^^^^ expected string literal
error: inline assembly must be a string literal
--> $DIR/asm-parse-errors.rs:14:10
|
LL | asm!(123); //~ ERROR inline assembly must be a string literal
LL | asm!(123);
| ^^^
error: aborting due to 11 previous errors
......
error[E0615]: attempted to take value of method `speak` on type `Cat`
--> $DIR/assign-to-method.rs:20:8
|
LL | nyan.speak = || println!("meow"); //~ ERROR attempted to take value of method
LL | nyan.speak = || println!("meow");
| ^^^^^
|
= help: methods are immutable and cannot be assigned to
......@@ -9,7 +9,7 @@ LL | nyan.speak = || println!("meow"); //~ ERROR attempted to take value of me
error[E0615]: attempted to take value of method `speak` on type `Cat`
--> $DIR/assign-to-method.rs:21:8
|
LL | nyan.speak += || println!("meow"); //~ ERROR attempted to take value of method
LL | nyan.speak += || println!("meow");
| ^^^^^
|
= help: methods are immutable and cannot be assigned to
......
error[E0368]: binary assignment operation `+=` cannot be applied to type `Foo`
--> $DIR/assignment-operator-unimplemented.rs:6:3
|
LL | a += *b; //~ Error: binary assignment operation `+=` cannot be applied to type `Foo`
LL | a += *b;
| -^^^^^^
| |
| cannot use `+=` on type `Foo`
......
error[E0202]: associated types are not yet supported in inherent impls (see #8995)
--> $DIR/assoc-inherent.rs:6:5
|
LL | type Bar = isize; //~ERROR associated types are not yet supported in inherent impls (see #8995)
LL | type Bar = isize;
| ^^^^^^^^^^^^^^^^^
error: aborting due to previous error
......
error[E0034]: multiple applicable items in scope
--> $DIR/associated-const-ambiguity-report.rs:17:16
|
LL | const X: i32 = <i32>::ID; //~ ERROR E0034
LL | const X: i32 = <i32>::ID;
| ^^^^^^^^^ multiple `ID` found
|
note: candidate #1 is defined in an impl of the trait `Foo` for the type `i32`
......
......@@ -3,7 +3,7 @@ error[E0201]: duplicate definitions with name `bar`:
|
LL | const bar: bool = true;
| ----------------------- previous definition of `bar` here
LL | fn bar() {} //~ ERROR duplicate definitions
LL | fn bar() {}
| ^^^^^^^^^^^ duplicate definition
error: aborting due to previous error
......
......@@ -3,7 +3,7 @@ error[E0201]: duplicate definitions with name `Bar`:
|
LL | type Bar = i16;
| --------------- previous definition of `Bar` here
LL | type Bar = u16; //~ ERROR duplicate definitions
LL | type Bar = u16;
| ^^^^^^^^^^^^^^^ duplicate definition
error: aborting due to previous error
......
......@@ -3,7 +3,7 @@ error[E0201]: duplicate definitions with name `Ty`:
|
LL | type Ty = ();
| ------------- previous definition of `Ty` here
LL | type Ty = usize; //~ ERROR duplicate definitions
LL | type Ty = usize;
| ^^^^^^^^^^^^^^^^ duplicate definition
error[E0201]: duplicate definitions with name `BAR`:
......@@ -11,7 +11,7 @@ error[E0201]: duplicate definitions with name `BAR`:
|
LL | const BAR: u32 = 7;
| ------------------- previous definition of `BAR` here
LL | const BAR: u32 = 8; //~ ERROR duplicate definitions
LL | const BAR: u32 = 8;
| ^^^^^^^^^^^^^^^^^^^ duplicate definition
error: aborting due to 2 previous errors
......
error[E0412]: cannot find type `A` in this scope
--> $DIR/associated-path-shl.rs:4:14
|
LL | let _: <<A>::B>::C; //~ ERROR cannot find type `A` in this scope
LL | let _: <<A>::B>::C;
| ^ not found in this scope
error[E0412]: cannot find type `A` in this scope
--> $DIR/associated-path-shl.rs:5:15
|
LL | let _ = <<A>::B>::C; //~ ERROR cannot find type `A` in this scope
LL | let _ = <<A>::B>::C;
| ^ not found in this scope
error[E0412]: cannot find type `A` in this scope
--> $DIR/associated-path-shl.rs:6:11
|
LL | let <<A>::B>::C; //~ ERROR cannot find type `A` in this scope
LL | let <<A>::B>::C;
| ^ not found in this scope
error[E0412]: cannot find type `A` in this scope
--> $DIR/associated-path-shl.rs:7:17
|
LL | let 0 ..= <<A>::B>::C; //~ ERROR cannot find type `A` in this scope
LL | let 0 ..= <<A>::B>::C;
| ^ not found in this scope
error[E0412]: cannot find type `A` in this scope
--> $DIR/associated-path-shl.rs:9:7
|
LL | <<A>::B>::C; //~ ERROR cannot find type `A` in this scope
LL | <<A>::B>::C;
| ^ not found in this scope
error[E0029]: only char and numeric types are allowed in range patterns
--> $DIR/associated-path-shl.rs:7:15
|
LL | let 0 ..= <<A>::B>::C; //~ ERROR cannot find type `A` in this scope
LL | let 0 ..= <<A>::B>::C;
| ^^^^^^^^^^^ ranges require char or numeric types
|
= note: start type: {integer}
......
error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:33:23
|
LL | fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types
LL | fn b() { dent(ModelT, Blue); }
| ^^^^ expected struct `Black`, found struct `Blue`
|
= note: expected type `Black`
......@@ -10,7 +10,7 @@ LL | fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types
error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:34:23
|
LL | fn c() { dent(ModelU, Black); } //~ ERROR mismatched types
LL | fn c() { dent(ModelU, Black); }
| ^^^^^ expected struct `Blue`, found struct `Black`
|
= note: expected type `Blue`
......@@ -19,7 +19,7 @@ LL | fn c() { dent(ModelU, Black); } //~ ERROR mismatched types
error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:40:28
|
LL | fn f() { ModelT.chip_paint(Blue); } //~ ERROR mismatched types
LL | fn f() { ModelT.chip_paint(Blue); }
| ^^^^ expected struct `Black`, found struct `Blue`
|
= note: expected type `Black`
......@@ -28,7 +28,7 @@ LL | fn f() { ModelT.chip_paint(Blue); } //~ ERROR mismatched types
error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:41:28
|
LL | fn g() { ModelU.chip_paint(Black); } //~ ERROR mismatched types
LL | fn g() { ModelU.chip_paint(Black); }
| ^^^^^ expected struct `Blue`, found struct `Black`
|
= note: expected type `Blue`
......
error[E0271]: type mismatch resolving `<ModelT as Vehicle>::Color == Blue`
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:37:10
|
LL | fn b() { blue_car(ModelT); } //~ ERROR type mismatch
LL | fn b() { blue_car(ModelT); }
| ^^^^^^^^ expected struct `Black`, found struct `Blue`
|
= note: expected type `Black`
......@@ -15,7 +15,7 @@ LL | fn blue_car<C:Car<Color=Blue>>(c: C) {
error[E0271]: type mismatch resolving `<ModelU as Vehicle>::Color == Black`
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:38:10
|
LL | fn c() { black_car(ModelU); } //~ ERROR type mismatch
LL | fn c() { black_car(ModelU); }
| ^^^^^^^^^ expected struct `Blue`, found struct `Black`
|
= note: expected type `Blue`
......
error[E0277]: the trait bound `<G as GetToInt>::R: ToInt` is not satisfied
--> $DIR/associated-types-bound-failure.rs:17:5
|
LL | ToInt::to_int(&g.get()) //~ ERROR E0277
LL | ToInt::to_int(&g.get())
| ^^^^^^^^^^^^^ the trait `ToInt` is not implemented for `<G as GetToInt>::R`
|
= help: consider adding a `where <G as GetToInt>::R: ToInt` bound
......
error[E0412]: cannot find type `A` in this scope
--> $DIR/associated-types-eq-1.rs:10:12
|
LL | let _: A = x.boo(); //~ ERROR cannot find type `A` in this scope
LL | let _: A = x.boo();
| ^ help: a type parameter with a similar name exists: `I`
error: aborting due to previous error
......
error[E0271]: type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
--> $DIR/associated-types-eq-hr.rs:82:5
|
LL | foo::<UintStruct>(); //~ ERROR type mismatch
LL | foo::<UintStruct>();
| ^^^^^^^^^^^^^^^^^ expected usize, found isize
|
= note: expected type `&usize`
......@@ -19,7 +19,7 @@ LL | | }
error[E0271]: type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
--> $DIR/associated-types-eq-hr.rs:86:5
|
LL | bar::<IntStruct>(); //~ ERROR type mismatch
LL | bar::<IntStruct>();
| ^^^^^^^^^^^^^^^^ expected isize, found usize
|
= note: expected type `&isize`
......
......@@ -4,7 +4,7 @@ error[E0046]: not all trait items implemented, missing: `Type`
LL | type Type;
| ---------- `Type` from trait
...
LL | impl Trait for isize {} //~ ERROR missing: `Type`
LL | impl Trait for isize {}
| ^^^^^^^^^^^^^^^^^^^^ missing `Type` in implementation
error: aborting due to previous error
......
error[E0271]: type mismatch resolving `<Adapter<I> as Iterator>::Item == std::option::Option<T>`
--> $DIR/associated-types-issue-20346.rs:34:5
|
LL | is_iterator_of::<Option<T>, _>(&adapter); //~ ERROR type mismatch
LL | is_iterator_of::<Option<T>, _>(&adapter);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter, found enum `std::option::Option`
|
= note: expected type `T`
......
error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`
--> $DIR/associated-types-multiple-types-one-trait.rs:13:5
|
LL | want_y(t); //~ ERROR type mismatch
LL | want_y(t);
| ^^^^^^ expected associated type, found i32
|
= note: expected type `<T as Foo>::Y`
......@@ -15,7 +15,7 @@ LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
error[E0271]: type mismatch resolving `<T as Foo>::X == u32`
--> $DIR/associated-types-multiple-types-one-trait.rs:18:5
|
LL | want_x(t); //~ ERROR type mismatch
LL | want_x(t);
| ^^^^^^ expected associated type, found u32
|
= note: expected type `<T as Foo>::X`
......
......@@ -3,7 +3,7 @@ error[E0505]: cannot move out of `x` because it is borrowed
|
LL | 's: loop { y = denormalise(&x); break }
| -- borrow of `x` occurs here
LL | drop(x); //~ ERROR cannot move out of `x` because it is borrowed
LL | drop(x);
| ^ move out of `x` occurs here
LL | return f(y);
| - borrow later used here
......
......@@ -3,7 +3,7 @@ error[E0505]: cannot move out of `x` because it is borrowed
|
LL | 's: loop { y = denormalise(&x); break }
| - borrow of `x` occurs here
LL | drop(x); //~ ERROR cannot move out of `x` because it is borrowed
LL | drop(x);
| ^ move out of `x` occurs here
error: aborting due to previous error
......
error[E0284]: type annotations required: cannot resolve `<Self as std::iter::Iterator>::Item == i32`
--> $DIR/associated-types-overridden-binding.rs:4:1
|
LL | trait Bar: Foo<Item = u32> {} //~ ERROR type annotations required
LL | trait Bar: Foo<Item = u32> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required by `Foo`
......
error[E0220]: associated type `A` not found for `T`
--> $DIR/associated-types-path-1.rs:10:23
|
LL | pub fn f1<T>(a: T, x: T::A) {} //~ERROR associated type `A` not found
LL | pub fn f1<T>(a: T, x: T::A) {}
| ^^^^ associated type `A` not found
error[E0221]: ambiguous associated type `A` in bounds of `T`
......@@ -13,7 +13,7 @@ LL | type A;
LL | type A;
| ------- ambiguous `A` from `Bar`
...
LL | pub fn f2<T: Foo + Bar>(a: T, x: T::A) {} //~ERROR ambiguous associated type `A`
LL | pub fn f2<T: Foo + Bar>(a: T, x: T::A) {}
| ^^^^ ambiguous associated type `A`
error: aborting due to 2 previous errors
......
......@@ -4,7 +4,7 @@ error[E0623]: lifetime mismatch
LL | fn method2<'a,'b,T>(x: &'a T, y: &'b T)
| ----- ----- these two types are declared with different lifetimes...
...
LL | let _c: <T as Trait<'b>>::Type = a; //~ ERROR E0623
LL | let _c: <T as Trait<'b>>::Type = a;
| ^ ...but data from `y` flows into `x` here
error[E0623]: lifetime mismatch
......@@ -13,7 +13,7 @@ error[E0623]: lifetime mismatch
LL | fn method3<'a,'b,T>(x: &'a T, y: &'b T)
| ----- ----- these two types are declared with different lifetimes...
...
LL | let _c: <T as Trait<'a>>::Type = b; //~ ERROR E0623
LL | let _c: <T as Trait<'a>>::Type = b;
| ^ ...but data from `y` flows into `x` here
error: aborting due to 2 previous errors
......
error[E0277]: the size for values of type `<T as Get>::Value` cannot be known at compilation time
--> $DIR/associated-types-unsized.rs:7:9
|
LL | let x = t.get(); //~ ERROR the size for values of type
LL | let x = t.get();
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `<T as Get>::Value`
......
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
--> $DIR/attempted-access-non-fatal.rs:4:15
|
LL | let _ = x.foo; //~ `{integer}` is a primitive type and therefore doesn't have fields [E0610]
LL | let _ = x.foo;
| ^^^
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
--> $DIR/attempted-access-non-fatal.rs:5:15
|
LL | let _ = x.bar; //~ `{integer}` is a primitive type and therefore doesn't have fields [E0610]
LL | let _ = x.bar;
| ^^^
error: aborting due to 2 previous errors
......
error: unexpected token: `!`
--> $DIR/attr-eq-token-tree.rs:3:11
|
LL | #[my_attr = !] //~ ERROR unexpected token: `!`
LL | #[my_attr = !]
| ^
error: aborting due to previous error
......
error[E0518]: attribute should be applied to function or closure
--> $DIR/attr-usage-inline.rs:6:1
|
LL | #[inline] //~ ERROR: attribute should be applied to function or closure
LL | #[inline]
| ^^^^^^^^^
LL | struct S;
| --------- not a function or closure
......
error[E0517]: attribute should be applied to struct, enum or union
--> $DIR/attr-usage-repr.rs:4:8
|
LL | #[repr(C)] //~ ERROR: attribute should be applied to struct, enum or union
LL | #[repr(C)]
| ^
LL | fn f() {}
| --------- not a struct, enum or union
......@@ -9,7 +9,7 @@ LL | fn f() {}
error[E0517]: attribute should be applied to enum
--> $DIR/attr-usage-repr.rs:16:8
|
LL | #[repr(i8)] //~ ERROR: attribute should be applied to enum
LL | #[repr(i8)]
| ^^
LL | struct SInt(f64, f64);
| ---------------------- not an enum
......@@ -17,7 +17,7 @@ LL | struct SInt(f64, f64);
error[E0517]: attribute should be applied to struct or union
--> $DIR/attr-usage-repr.rs:25:8
|
LL | #[repr(packed)] //~ ERROR: attribute should be applied to struct
LL | #[repr(packed)]
| ^^^^^^
LL | enum EPacked { A, B }
| --------------------- not a struct or union
......@@ -25,7 +25,7 @@ LL | enum EPacked { A, B }
error[E0517]: attribute should be applied to struct
--> $DIR/attr-usage-repr.rs:28:8
|
LL | #[repr(simd)] //~ ERROR: attribute should be applied to struct
LL | #[repr(simd)]
| ^^^^
LL | enum ESimd { A, B }
| ------------------- not a struct
......
error: attribute without generic parameters
--> $DIR/attribute-with-no-generics-in-parameter-list.rs:1:8
|
LL | fn foo<#[attr]>() {} //~ ERROR attribute without generic parameters
LL | fn foo<#[attr]>() {}
| ^^^^^^^ attributes are only permitted when preceding parameters
error: aborting due to previous error
......
error[E0505]: cannot move out of `x` because it is borrowed
--> $DIR/augmented-assignments.rs:16:5
|
LL | x //~ error: use of moved value: `x`
LL | x
| -
| |
| _____borrow of `x` occurs here
| |
LL | | //~^ value used here after move
LL | |
LL | | +=
LL | | x; //~ value moved here
LL | | x;
| | ^
| | |
| |_____move out of `x` occurs here
......@@ -20,7 +20,7 @@ error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
LL | let y = Int(2);
| - help: consider changing this to be mutable: `mut y`
...
LL | y //~ error: cannot borrow immutable local variable `y` as mutable
LL | y
| ^ cannot borrow as mutable
error: aborting due to 2 previous errors
......
......@@ -4,16 +4,16 @@ error[E0596]: cannot borrow immutable local variable `y` as mutable
LL | let y = Int(2);
| - help: make this binding mutable: `mut y`
...
LL | y //~ error: cannot borrow immutable local variable `y` as mutable
LL | y
| ^ cannot borrow mutably
error[E0382]: use of moved value: `x`
--> $DIR/augmented-assignments.rs:13:5
|
LL | x //~ error: use of moved value: `x`
LL | x
| ^ value used here after move
...
LL | x; //~ value moved here
LL | x;
| - value moved here
|
= note: move occurs because `x` has type `Int`, which does not implement the `Copy` trait
......
error[E0599]: no method named `test_mut` found for type `std::vec::Vec<{integer}>` in the current scope
--> $DIR/auto-ref-slice-plus-ref.rs:7:7
|
LL | a.test_mut(); //~ ERROR no method named `test_mut` found
LL | a.test_mut();
| ^^^^^^^^ help: did you mean: `get_mut`
|
= help: items from traits can only be used if the trait is implemented and in scope
......@@ -11,7 +11,7 @@ LL | a.test_mut(); //~ ERROR no method named `test_mut` found
error[E0599]: no method named `test` found for type `std::vec::Vec<{integer}>` in the current scope
--> $DIR/auto-ref-slice-plus-ref.rs:8:7
|
LL | a.test(); //~ ERROR no method named `test` found
LL | a.test();
| ^^^^
|
= help: items from traits can only be used if the trait is implemented and in scope
......@@ -21,7 +21,7 @@ LL | a.test(); //~ ERROR no method named `test` found
error[E0599]: no method named `test` found for type `[{integer}; 1]` in the current scope
--> $DIR/auto-ref-slice-plus-ref.rs:10:11
|
LL | ([1]).test(); //~ ERROR no method named `test` found
LL | ([1]).test();
| ^^^^
|
= help: items from traits can only be used if the trait is implemented and in scope
......@@ -31,7 +31,7 @@ LL | ([1]).test(); //~ ERROR no method named `test` found
error[E0599]: no method named `test` found for type `&[{integer}; 1]` in the current scope
--> $DIR/auto-ref-slice-plus-ref.rs:11:12
|
LL | (&[1]).test(); //~ ERROR no method named `test` found
LL | (&[1]).test();
| ^^^^
|
= help: items from traits can only be used if the trait is implemented and in scope
......
error[E0721]: `await` is a keyword in the 2018 edition
--> $DIR/2018-edition-error.rs:5:13
|
LL | pub mod await { //~ ERROR `await` is a keyword
LL | pub mod await {
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
error[E0721]: `await` is a keyword in the 2018 edition
--> $DIR/2018-edition-error.rs:6:20
|
LL | pub struct await; //~ ERROR `await` is a keyword
LL | pub struct await;
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
error[E0721]: `await` is a keyword in the 2018 edition
--> $DIR/2018-edition-error.rs:9:22
|
LL | use self::outer_mod::await::await; //~ ERROR `await` is a keyword
LL | use self::outer_mod::await::await;
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
error[E0721]: `await` is a keyword in the 2018 edition
--> $DIR/2018-edition-error.rs:9:29
|
LL | use self::outer_mod::await::await; //~ ERROR `await` is a keyword
LL | use self::outer_mod::await::await;
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
error[E0721]: `await` is a keyword in the 2018 edition
--> $DIR/2018-edition-error.rs:13:11
|
LL | match await { await => () } //~ ERROR `await` is a keyword
LL | match await { await => () }
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
error[E0721]: `await` is a keyword in the 2018 edition
--> $DIR/2018-edition-error.rs:13:19
|
LL | match await { await => () } //~ ERROR `await` is a keyword
LL | match await { await => () }
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
error: aborting due to 6 previous errors
......
error[E0070]: invalid left-hand side expression
--> $DIR/bad-expr-lhs.rs:2:5
|
LL | 1 = 2; //~ ERROR invalid left-hand side expression
LL | 1 = 2;
| ^^^^^ left-hand of expression not valid
error[E0067]: invalid left-hand side expression
--> $DIR/bad-expr-lhs.rs:3:5
|
LL | 1 += 2; //~ ERROR invalid left-hand side expression
LL | 1 += 2;
| ^ invalid expression for left-hand side
error[E0070]: invalid left-hand side expression
--> $DIR/bad-expr-lhs.rs:4:5
|
LL | (1, 2) = (3, 4); //~ ERROR invalid left-hand side expression
LL | (1, 2) = (3, 4);
| ^^^^^^^^^^^^^^^ left-hand of expression not valid
error[E0070]: invalid left-hand side expression
--> $DIR/bad-expr-lhs.rs:7:5
|
LL | (a, b) = (3, 4); //~ ERROR invalid left-hand side expression
LL | (a, b) = (3, 4);
| ^^^^^^^^^^^^^^^ left-hand of expression not valid
error[E0070]: invalid left-hand side expression
--> $DIR/bad-expr-lhs.rs:9:5
|
LL | None = Some(3); //~ ERROR invalid left-hand side expression
LL | None = Some(3);
| ^^^^^^^^^^^^^^ left-hand of expression not valid
error: aborting due to 5 previous errors
......
......@@ -19,7 +19,7 @@ LL | log(debug, m1::arguments);
error[E0580]: main function has wrong type
--> $DIR/bad-expr-path.rs:3:1
|
LL | fn main(arguments: Vec<String>) { //~ ERROR main function has wrong type
LL | fn main(arguments: Vec<String>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters
|
= note: expected type `fn()`
......
......@@ -19,7 +19,7 @@ LL | log(debug, m1::arguments);
error[E0580]: main function has wrong type
--> $DIR/bad-expr-path2.rs:5:1
|
LL | fn main(arguments: Vec<String>) { //~ ERROR main function has wrong type
LL | fn main(arguments: Vec<String>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters
|
= note: expected type `fn()`
......
error[E0459]: #[link(...)] specified without `name = "foo"`
--> $DIR/bad-extern-link-attrs.rs:1:1
|
LL | #[link()] //~ ERROR: specified without `name =
LL | #[link()]
| ^^^^^^^^^ missing `name` argument
error[E0454]: #[link(name = "")] given with empty name
--> $DIR/bad-extern-link-attrs.rs:2:1
|
LL | #[link(name = "")] //~ ERROR: with empty name
LL | #[link(name = "")]
| ^^^^^^^^^^^^^^^^^^ empty name given
error[E0458]: unknown kind: `bar`
--> $DIR/bad-extern-link-attrs.rs:4:1
|
LL | #[link(name = "foo", kind = "bar")] //~ ERROR: unknown kind
LL | #[link(name = "foo", kind = "bar")]
| ^^^^^^^^^^^^^^^^^^^^^------------^^
| |
| unknown kind
......
error: unused import: `std::option`
--> $DIR/bad-lint-cap2.rs:6:5
|
LL | use std::option; //~ ERROR
LL | use std::option;
| ^^^^^^^^^^^
|
note: lint level defined here
......
warning: unused import: `std::option`
--> $DIR/bad-lint-cap3.rs:7:5
|
LL | use std::option; //~ WARN
LL | use std::option;
| ^^^^^^^^^^^
|
note: lint level defined here
......
error[E0580]: main function has wrong type
--> $DIR/bad-main.rs:1:1
|
LL | fn main(x: isize) { } //~ ERROR: main function has wrong type [E0580]
LL | fn main(x: isize) { }
| ^^^^^^^^^^^^^^^^^ incorrect number of function parameters
|
= note: expected type `fn()`
......
error[E0277]: `T` cannot be sent between threads safely
--> $DIR/bad-method-typaram-kind.rs:2:7
|
LL | 1.bar::<T>(); //~ ERROR `T` cannot be sent between threads safely
LL | 1.bar::<T>();
| ^^^ `T` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `T`
......
......@@ -3,7 +3,7 @@ error[E0401]: can't use generic parameters from outer function
|
LL | fn foo<T>() {
| - type variable from outer function
LL | fn bar(b: T) { } //~ ERROR can't use generic parameters from outer
LL | fn bar(b: T) { }
| --- ^ use of generic parameter from outer function
| |
| help: try using a local generic parameter instead: `bar<T>`
......
error[E0009]: cannot bind by-move and by-ref in the same pattern
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-2.rs:12:23
|
LL | Some((ref _y, _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern
LL | Some((ref _y, _z)) => { },
| ------ ^^ by-move pattern here
| |
| both by-ref and by-move used
......
error[E0009]: cannot bind by-move and by-ref in the same pattern
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-4.rs:12:15
|
LL | Some((_y, ref _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern
LL | Some((_y, ref _z)) => { },
| ^^ ------ both by-ref and by-move used
| |
| by-move pattern here
......
......@@ -7,7 +7,7 @@ LL | fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs + rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `rhs`
......@@ -19,8 +19,8 @@ LL | fn add<A: Add<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs + rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `lhs`
......@@ -32,7 +32,7 @@ LL | fn sub<A: Sub<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs - rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `rhs`
......@@ -44,8 +44,8 @@ LL | fn sub<A: Sub<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs - rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `lhs`
......@@ -57,7 +57,7 @@ LL | fn mul<A: Mul<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs * rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `rhs`
......@@ -69,8 +69,8 @@ LL | fn mul<A: Mul<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs * rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `lhs`
......@@ -82,7 +82,7 @@ LL | fn div<A: Div<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs / rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `rhs`
......@@ -94,8 +94,8 @@ LL | fn div<A: Div<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs / rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `lhs`
......@@ -107,7 +107,7 @@ LL | fn rem<A: Rem<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs % rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `rhs`
......@@ -119,8 +119,8 @@ LL | fn rem<A: Rem<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs % rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `lhs`
......@@ -132,7 +132,7 @@ LL | fn bitand<A: BitAnd<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs & rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `rhs`
......@@ -144,8 +144,8 @@ LL | fn bitand<A: BitAnd<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs & rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `lhs`
......@@ -157,7 +157,7 @@ LL | fn bitor<A: BitOr<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs | rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `rhs`
......@@ -169,8 +169,8 @@ LL | fn bitor<A: BitOr<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs | rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `lhs`
......@@ -182,7 +182,7 @@ LL | fn bitxor<A: BitXor<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs ^ rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `rhs`
......@@ -194,8 +194,8 @@ LL | fn bitxor<A: BitXor<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs ^ rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `lhs`
......@@ -207,7 +207,7 @@ LL | fn shl<A: Shl<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs << rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `rhs`
......@@ -219,8 +219,8 @@ LL | fn shl<A: Shl<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs << rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `lhs`
......@@ -232,7 +232,7 @@ LL | fn shr<A: Shr<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs >> rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
error[E0382]: use of moved value: `rhs`
......@@ -244,8 +244,8 @@ LL | fn shr<A: Shr<B, Output=()>, B>(lhs: A, rhs: B) {
| consider adding a `Copy` constraint to this type argument
LL | lhs >> rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
error: aborting due to 20 previous errors
......
......@@ -3,7 +3,7 @@ error[E0382]: use of moved value: `lhs`
|
LL | lhs + rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
|
= note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
......@@ -13,8 +13,8 @@ error[E0382]: use of moved value: `rhs`
|
LL | lhs + rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
|
= note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
......@@ -24,7 +24,7 @@ error[E0382]: use of moved value: `lhs`
|
LL | lhs - rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
|
= note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
......@@ -34,8 +34,8 @@ error[E0382]: use of moved value: `rhs`
|
LL | lhs - rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
|
= note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
......@@ -45,7 +45,7 @@ error[E0382]: use of moved value: `lhs`
|
LL | lhs * rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
|
= note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
......@@ -55,8 +55,8 @@ error[E0382]: use of moved value: `rhs`
|
LL | lhs * rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
|
= note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
......@@ -66,7 +66,7 @@ error[E0382]: use of moved value: `lhs`
|
LL | lhs / rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
|
= note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
......@@ -76,8 +76,8 @@ error[E0382]: use of moved value: `rhs`
|
LL | lhs / rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
|
= note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
......@@ -87,7 +87,7 @@ error[E0382]: use of moved value: `lhs`
|
LL | lhs % rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
|
= note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
......@@ -97,8 +97,8 @@ error[E0382]: use of moved value: `rhs`
|
LL | lhs % rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
|
= note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
......@@ -108,7 +108,7 @@ error[E0382]: use of moved value: `lhs`
|
LL | lhs & rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
|
= note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
......@@ -118,8 +118,8 @@ error[E0382]: use of moved value: `rhs`
|
LL | lhs & rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
|
= note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
......@@ -129,7 +129,7 @@ error[E0382]: use of moved value: `lhs`
|
LL | lhs | rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
|
= note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
......@@ -139,8 +139,8 @@ error[E0382]: use of moved value: `rhs`
|
LL | lhs | rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
|
= note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
......@@ -150,7 +150,7 @@ error[E0382]: use of moved value: `lhs`
|
LL | lhs ^ rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
|
= note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
......@@ -160,8 +160,8 @@ error[E0382]: use of moved value: `rhs`
|
LL | lhs ^ rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
|
= note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
......@@ -171,7 +171,7 @@ error[E0382]: use of moved value: `lhs`
|
LL | lhs << rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
|
= note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
......@@ -181,8 +181,8 @@ error[E0382]: use of moved value: `rhs`
|
LL | lhs << rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
|
= note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
......@@ -192,7 +192,7 @@ error[E0382]: use of moved value: `lhs`
|
LL | lhs >> rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(lhs);
| ^^^ value used here after move
|
= note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
......@@ -202,8 +202,8 @@ error[E0382]: use of moved value: `rhs`
|
LL | lhs >> rhs;
| --- value moved here
LL | drop(lhs); //~ ERROR use of moved value: `lhs`
LL | drop(rhs); //~ ERROR use of moved value: `rhs`
LL | drop(lhs);
LL | drop(rhs);
| ^^^ value used here after move
|
= note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
......
......@@ -8,7 +8,7 @@ LL | fn double_move<T: Add<Output=()>>(x: T) {
LL | x
| - value moved here
LL | +
LL | x; //~ ERROR: use of moved value
LL | x;
| ^ value used here after move
error[E0382]: borrow of moved value: `x`
......@@ -21,7 +21,7 @@ LL | fn move_then_borrow<T: Add<Output=()> + Clone>(x: T) {
LL | x
| - value moved here
LL | +
LL | x.clone(); //~ ERROR: use of moved value
LL | x.clone();
| ^ value borrowed here after move
error[E0505]: cannot move out of `x` because it is borrowed
......@@ -30,7 +30,7 @@ error[E0505]: cannot move out of `x` because it is borrowed
LL | let m = &x;
| -- borrow of `x` occurs here
...
LL | x //~ ERROR: cannot move out of `x` because it is borrowed
LL | x
| ^ move out of `x` occurs here
...
LL | use_mut(n); use_imm(m);
......@@ -42,7 +42,7 @@ error[E0505]: cannot move out of `y` because it is borrowed
LL | let n = &mut y;
| ------ borrow of `y` occurs here
...
LL | y; //~ ERROR: cannot move out of `y` because it is borrowed
LL | y;
| ^ move out of `y` occurs here
LL | use_mut(n); use_imm(m);
| - borrow later used here
......@@ -50,13 +50,13 @@ LL | use_mut(n); use_imm(m);
error[E0507]: cannot move out of borrowed content
--> $DIR/binop-move-semantics.rs:30:5
|
LL | *m //~ ERROR: cannot move out of borrowed content
LL | *m
| ^^ cannot move out of borrowed content
error[E0507]: cannot move out of borrowed content
--> $DIR/binop-move-semantics.rs:32:5
|
LL | *n; //~ ERROR: cannot move out of borrowed content
LL | *n;
| ^^ cannot move out of borrowed content
error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
......@@ -68,7 +68,7 @@ LL | &mut f
| _____mutable borrow occurs here
| |
LL | | +
LL | | &f; //~ ERROR: cannot borrow `f` as immutable because it is also borrowed as mutable
LL | | &f;
| | ^-
| |_____||
| |mutable borrow later used here
......@@ -83,7 +83,7 @@ LL | &f
| _____immutable borrow occurs here
| |
LL | | +
LL | | &mut f; //~ ERROR: cannot borrow `f` as mutable because it is also borrowed as immutable
LL | | &mut f;
| | ^^^^^-
| |_____|____|
| | immutable borrow later used here
......
......@@ -4,7 +4,7 @@ error[E0382]: use of moved value: `x`
LL | x
| - value moved here
LL | +
LL | x; //~ ERROR: use of moved value
LL | x;
| ^ value used here after move
|
= note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
......@@ -15,7 +15,7 @@ error[E0382]: use of moved value: `x`
LL | x
| - value moved here
LL | +
LL | x.clone(); //~ ERROR: use of moved value
LL | x.clone();
| ^ value used here after move
|
= note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
......@@ -26,7 +26,7 @@ error[E0505]: cannot move out of `x` because it is borrowed
LL | let m = &x;
| - borrow of `x` occurs here
...
LL | x //~ ERROR: cannot move out of `x` because it is borrowed
LL | x
| ^ move out of `x` occurs here
error[E0505]: cannot move out of `y` because it is borrowed
......@@ -35,19 +35,19 @@ error[E0505]: cannot move out of `y` because it is borrowed
LL | let n = &mut y;
| - borrow of `y` occurs here
...
LL | y; //~ ERROR: cannot move out of `y` because it is borrowed
LL | y;
| ^ move out of `y` occurs here
error[E0507]: cannot move out of borrowed content
--> $DIR/binop-move-semantics.rs:30:5
|
LL | *m //~ ERROR: cannot move out of borrowed content
LL | *m
| ^^ cannot move out of borrowed content
error[E0507]: cannot move out of borrowed content
--> $DIR/binop-move-semantics.rs:32:5
|
LL | *n; //~ ERROR: cannot move out of borrowed content
LL | *n;
| ^^ cannot move out of borrowed content
error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
......@@ -56,7 +56,7 @@ error[E0502]: cannot borrow `f` as immutable because it is also borrowed as muta
LL | &mut f
| - mutable borrow occurs here
LL | +
LL | &f; //~ ERROR: cannot borrow `f` as immutable because it is also borrowed as mutable
LL | &f;
| ^
| |
| immutable borrow occurs here
......@@ -68,7 +68,7 @@ error[E0502]: cannot borrow `f` as mutable because it is also borrowed as immuta
LL | &f
| - immutable borrow occurs here
LL | +
LL | &mut f; //~ ERROR: cannot borrow `f` as mutable because it is also borrowed as immutable
LL | &mut f;
| ^
| |
| mutable borrow occurs here
......
error[E0308]: mismatched types
--> $DIR/block-must-not-have-result-do.rs:3:9
|
LL | true //~ ERROR mismatched types
LL | true
| ^^^^ expected (), found bool
|
= note: expected type `()`
......
......@@ -3,7 +3,7 @@ error[E0308]: mismatched types
|
LL | fn drop(&mut self) {
| - expected `()` because of default return type
LL | true //~ ERROR mismatched types
LL | true
| ^^^^ expected (), found bool
|
= note: expected type `()`
......
error[E0308]: mismatched types
--> $DIR/block-must-not-have-result-while.rs:3:9
|
LL | true //~ ERROR mismatched types
LL | true
| ^^^^ expected (), found bool
|
= note: expected type `()`
......
error[E0308]: mismatched types
--> $DIR/consider-removing-last-semi.rs:1:11
|
LL | fn f() -> String { //~ ERROR mismatched types
LL | fn f() -> String {
| - ^^^^^^ expected struct `std::string::String`, found ()
| |
| this function's body doesn't return
......@@ -15,7 +15,7 @@ LL | "bla".to_string();
error[E0308]: mismatched types
--> $DIR/consider-removing-last-semi.rs:6:11
|
LL | fn g() -> String { //~ ERROR mismatched types
LL | fn g() -> String {
| - ^^^^^^ expected struct `std::string::String`, found ()
| |
| this function's body doesn't return
......
error[E0308]: mismatched types
--> $DIR/issue-11714.rs:1:14
|
LL | fn blah() -> i32 { //~ ERROR mismatched types
LL | fn blah() -> i32 {
| ---- ^^^ expected i32, found ()
| |
| this function's body doesn't return
......
error[E0308]: mismatched types
--> $DIR/issue-13428.rs:3:13
|
LL | fn foo() -> String { //~ ERROR mismatched types
LL | fn foo() -> String {
| --- ^^^^^^ expected struct `std::string::String`, found ()
| |
| this function's body doesn't return
......@@ -15,7 +15,7 @@ LL | ;
error[E0308]: mismatched types
--> $DIR/issue-13428.rs:11:13
|
LL | fn bar() -> String { //~ ERROR mismatched types
LL | fn bar() -> String {
| --- ^^^^^^ expected struct `std::string::String`, found ()
| |
| this function's body doesn't return
......
......@@ -14,7 +14,7 @@ error[E0618]: expected function, found `()`
|
LL | / fn foo(x: i32) {
LL | | |y| x + y
LL | | //~^ ERROR: mismatched types
LL | |
LL | | }
| |_- `foo` defined here returns `()`
...
......
error[E0277]: the trait bound `{integer}: Scalar` is not satisfied
--> $DIR/issue-22645.rs:15:5
|
LL | b + 3 //~ ERROR E0277
LL | b + 3
| ^ the trait `Scalar` is not implemented for `{integer}`
|
= help: the following implementations were found:
......@@ -14,7 +14,7 @@ error[E0308]: mismatched types
LL | fn main() {
| - expected `()` because of default return type
LL | let b = Bob + 3.5;
LL | b + 3 //~ ERROR E0277
LL | b + 3
| ^^^^^ expected (), found struct `Bob`
|
= note: expected type `()`
......
error[E0308]: mismatched types
--> $DIR/unexpected-return-on-unit.rs:9:5
|
LL | foo() //~ ERROR mismatched types
LL | foo()
| ^^^^^ expected (), found usize
|
= note: expected type `()`
found type `usize`
help: try adding a semicolon
|
LL | foo(); //~ ERROR mismatched types
LL | foo();
| ^
help: try adding a return type
|
......
error[E0381]: use of possibly uninitialized variable: `x.0`
--> $DIR/assign_mutable_fields.rs:11:10
|
LL | drop(x.0); //~ ERROR
LL | drop(x.0);
| ^^^ use of possibly uninitialized `x.0`
error[E0381]: use of possibly uninitialized variable: `x.1`
--> $DIR/assign_mutable_fields.rs:12:10
|
LL | drop(x.1); //~ ERROR
LL | drop(x.1);
| ^^^ use of possibly uninitialized `x.1`
error[E0381]: use of possibly uninitialized variable: `x`
--> $DIR/assign_mutable_fields.rs:19:10
|
LL | drop(x); //~ ERROR
LL | drop(x);
| ^ use of possibly uninitialized `x`
error: aborting due to 3 previous errors
......
error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
--> $DIR/borrow-immutable-upvar-mutation.rs:15:27
|
LL | let _f = to_fn(|| x = 42); //~ ERROR cannot assign
LL | let _f = to_fn(|| x = 42);
| ^^^^^^ cannot assign
|
help: consider changing this to accept closures that implement `FnMut`
--> $DIR/borrow-immutable-upvar-mutation.rs:15:24
|
LL | let _f = to_fn(|| x = 42); //~ ERROR cannot assign
LL | let _f = to_fn(|| x = 42);
| ^^^^^^^^^
error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure
--> $DIR/borrow-immutable-upvar-mutation.rs:18:31
|
LL | let _g = to_fn(|| set(&mut y)); //~ ERROR cannot borrow
LL | let _g = to_fn(|| set(&mut y));
| ^^^^^^ cannot borrow as mutable
|
help: consider changing this to accept closures that implement `FnMut`
--> $DIR/borrow-immutable-upvar-mutation.rs:18:24
|
LL | let _g = to_fn(|| set(&mut y)); //~ ERROR cannot borrow
LL | let _g = to_fn(|| set(&mut y));
| ^^^^^^^^^^^^^^
error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure
--> $DIR/borrow-immutable-upvar-mutation.rs:21:55
|
LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); }); //~ ERROR cannot assign
LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); });
| ^^^^^^ cannot assign
|
help: consider changing this to accept closures that implement `FnMut`
--> $DIR/borrow-immutable-upvar-mutation.rs:21:52
|
LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); }); //~ ERROR cannot assign
LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); });
| ^^^^^^^^^
error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
--> $DIR/borrow-immutable-upvar-mutation.rs:27:32
|
LL | let _f = to_fn(move || x = 42); //~ ERROR cannot assign
LL | let _f = to_fn(move || x = 42);
| ^^^^^^ cannot assign
|
help: consider changing this to accept closures that implement `FnMut`
--> $DIR/borrow-immutable-upvar-mutation.rs:27:24
|
LL | let _f = to_fn(move || x = 42); //~ ERROR cannot assign
LL | let _f = to_fn(move || x = 42);
| ^^^^^^^^^^^^^^
error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure
--> $DIR/borrow-immutable-upvar-mutation.rs:30:36
|
LL | let _g = to_fn(move || set(&mut y)); //~ ERROR cannot borrow
LL | let _g = to_fn(move || set(&mut y));
| ^^^^^^ cannot borrow as mutable
|
help: consider changing this to accept closures that implement `FnMut`
--> $DIR/borrow-immutable-upvar-mutation.rs:30:24
|
LL | let _g = to_fn(move || set(&mut y)); //~ ERROR cannot borrow
LL | let _g = to_fn(move || set(&mut y));
| ^^^^^^^^^^^^^^^^^^^
error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure
--> $DIR/borrow-immutable-upvar-mutation.rs:33:65
|
LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); }); //~ ERROR cannot assign
LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); });
| ^^^^^^ cannot assign
|
help: consider changing this to accept closures that implement `FnMut`
--> $DIR/borrow-immutable-upvar-mutation.rs:33:57
|
LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); }); //~ ERROR cannot assign
LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); });
| ^^^^^^^^^^^^^^
error: aborting due to 6 previous errors
......
error[E0387]: cannot assign to data in a captured outer variable in an `Fn` closure
--> $DIR/borrow-immutable-upvar-mutation.rs:15:27
|
LL | let _f = to_fn(|| x = 42); //~ ERROR cannot assign
LL | let _f = to_fn(|| x = 42);
| ^^^^^^
|
help: consider changing this closure to take self by mutable reference
--> $DIR/borrow-immutable-upvar-mutation.rs:15:24
|
LL | let _f = to_fn(|| x = 42); //~ ERROR cannot assign
LL | let _f = to_fn(|| x = 42);
| ^^^^^^^^^
error[E0387]: cannot borrow data mutably in a captured outer variable in an `Fn` closure
--> $DIR/borrow-immutable-upvar-mutation.rs:18:36
|
LL | let _g = to_fn(|| set(&mut y)); //~ ERROR cannot borrow
LL | let _g = to_fn(|| set(&mut y));
| ^
|
help: consider changing this closure to take self by mutable reference
--> $DIR/borrow-immutable-upvar-mutation.rs:18:24
|
LL | let _g = to_fn(|| set(&mut y)); //~ ERROR cannot borrow
LL | let _g = to_fn(|| set(&mut y));
| ^^^^^^^^^^^^^^
error[E0387]: cannot assign to data in a captured outer variable in an `Fn` closure
--> $DIR/borrow-immutable-upvar-mutation.rs:21:55
|
LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); }); //~ ERROR cannot assign
LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); });
| ^^^^^^
|
help: consider changing this closure to take self by mutable reference
--> $DIR/borrow-immutable-upvar-mutation.rs:21:52
|
LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); }); //~ ERROR cannot assign
LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); });
| ^^^^^^^^^
error[E0594]: cannot assign to captured outer variable in an `Fn` closure
--> $DIR/borrow-immutable-upvar-mutation.rs:27:32
|
LL | let _f = to_fn(move || x = 42); //~ ERROR cannot assign
LL | let _f = to_fn(move || x = 42);
| ^^^^^^
|
= note: `Fn` closures cannot capture their enclosing environment for modifications
help: consider changing this closure to take self by mutable reference
--> $DIR/borrow-immutable-upvar-mutation.rs:27:24
|
LL | let _f = to_fn(move || x = 42); //~ ERROR cannot assign
LL | let _f = to_fn(move || x = 42);
| ^^^^^^^^^^^^^^
error[E0596]: cannot borrow captured outer variable in an `Fn` closure as mutable
--> $DIR/borrow-immutable-upvar-mutation.rs:30:41
|
LL | let _g = to_fn(move || set(&mut y)); //~ ERROR cannot borrow
LL | let _g = to_fn(move || set(&mut y));
| ^
|
help: consider changing this closure to take self by mutable reference
--> $DIR/borrow-immutable-upvar-mutation.rs:30:24
|
LL | let _g = to_fn(move || set(&mut y)); //~ ERROR cannot borrow
LL | let _g = to_fn(move || set(&mut y));
| ^^^^^^^^^^^^^^^^^^^
error[E0594]: cannot assign to captured outer variable in an `Fn` closure
--> $DIR/borrow-immutable-upvar-mutation.rs:33:65
|
LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); }); //~ ERROR cannot assign
LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); });
| ^^^^^^
|
= note: `Fn` closures cannot capture their enclosing environment for modifications
help: consider changing this closure to take self by mutable reference
--> $DIR/borrow-immutable-upvar-mutation.rs:33:57
|
LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); }); //~ ERROR cannot assign
LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); });
| ^^^^^^^^^^^^^^
error: aborting due to 6 previous errors
......
......@@ -3,7 +3,7 @@ error[E0505]: cannot move out of `x` because it is borrowed
|
LL | let r = &x.0;
| ---- borrow of `x.0` occurs here
LL | let y = x; //~ ERROR cannot move out of `x` because it is borrowed
LL | let y = x;
| ^ move out of `x` occurs here
LL |
LL | r.use_ref();
......@@ -14,7 +14,7 @@ error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immu
|
LL | let a = &x.0;
| ---- immutable borrow occurs here
LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable because it is also borrowed as
LL | let b = &mut x.0;
| ^^^^^^^^ mutable borrow occurs here
LL | a.use_ref();
| - immutable borrow later used here
......@@ -24,7 +24,7 @@ error[E0499]: cannot borrow `x.0` as mutable more than once at a time
|
LL | let a = &mut x.0;
| -------- first mutable borrow occurs here
LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable more than once at a time
LL | let b = &mut x.0;
| ^^^^^^^^ second mutable borrow occurs here
LL | a.use_ref();
| - first borrow later used here
......@@ -34,7 +34,7 @@ error[E0505]: cannot move out of `x` because it is borrowed
|
LL | let r = &x.0;
| ---- borrow of `x.0` occurs here
LL | let y = x; //~ ERROR cannot move out of `x` because it is borrowed
LL | let y = x;
| ^ move out of `x` occurs here
LL | r.use_ref();
| - borrow later used here
......@@ -44,7 +44,7 @@ error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immu
|
LL | let a = &x.0;
| ---- immutable borrow occurs here
LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable because it is also borrowed as
LL | let b = &mut x.0;
| ^^^^^^^^ mutable borrow occurs here
LL | a.use_ref();
| - immutable borrow later used here
......@@ -54,7 +54,7 @@ error[E0499]: cannot borrow `x.0` as mutable more than once at a time
|
LL | let a = &mut x.0;
| -------- first mutable borrow occurs here
LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable more than once at a time
LL | let b = &mut x.0;
| ^^^^^^^^ second mutable borrow occurs here
LL | a.use_mut();
| - first borrow later used here
......
......@@ -3,7 +3,7 @@ error[E0505]: cannot move out of `x` because it is borrowed
|
LL | let r = &x.0;
| --- borrow of `x.0` occurs here
LL | let y = x; //~ ERROR cannot move out of `x` because it is borrowed
LL | let y = x;
| ^ move out of `x` occurs here
error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immutable
......@@ -11,7 +11,7 @@ error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immu
|
LL | let a = &x.0;
| --- immutable borrow occurs here
LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable because it is also borrowed as
LL | let b = &mut x.0;
| ^^^ mutable borrow occurs here
...
LL | }
......@@ -22,7 +22,7 @@ error[E0499]: cannot borrow `x.0` as mutable more than once at a time
|
LL | let a = &mut x.0;
| --- first mutable borrow occurs here
LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable more than once at a time
LL | let b = &mut x.0;
| ^^^ second mutable borrow occurs here
...
LL | }
......@@ -33,7 +33,7 @@ error[E0505]: cannot move out of `x` because it is borrowed
|
LL | let r = &x.0;
| --- borrow of `x.0` occurs here
LL | let y = x; //~ ERROR cannot move out of `x` because it is borrowed
LL | let y = x;
| ^ move out of `x` occurs here
error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immutable
......@@ -41,7 +41,7 @@ error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immu
|
LL | let a = &x.0;
| --- immutable borrow occurs here
LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable because it is also borrowed as
LL | let b = &mut x.0;
| ^^^ mutable borrow occurs here
...
LL | }
......@@ -52,7 +52,7 @@ error[E0499]: cannot borrow `x.0` as mutable more than once at a time
|
LL | let a = &mut x.0;
| --- first mutable borrow occurs here
LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable more than once at a time
LL | let b = &mut x.0;
| ^^^ second mutable borrow occurs here
LL | a.use_mut();
LL | }
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册