Auto merge of #48449 - petrochenkov:uidiff, r=nikomatsakis
Anonymize some line numbers in UI test output New unstable flag `-Z ui-testing` is introduced. This flag changes diagnostic output of the compiler *in some way* making it more suitable for UI testing (this is intentionally vague). At the moment this flag anonymizes line numbers at line starts thus solving the largest issue with UI test diffs. If diffs continue to be too noisy, some other tweaks could be applied (e.g. anonymizing lines/columns in `--> $DIR/file.rs:line:column`), but this needs some time and experience (we shouldn't diverge too much from the actual output in general). If comment `// disable-ui-testing-normalization` is added to an UI test, then `-Z ui-testing` is not passed. Closes https://github.com/rust-lang/rust/issues/46643
This commit is contained in:
commit
29f5c699b1
@ -1322,6 +1322,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
|
||||
epoch). Crates compiled with different epochs can be linked together."),
|
||||
run_dsymutil: Option<bool> = (None, parse_opt_bool, [TRACKED],
|
||||
"run `dsymutil` and delete intermediate object files"),
|
||||
ui_testing: bool = (false, parse_bool, [UNTRACKED],
|
||||
"format compiler diagnostics in a way that's better suitable for UI testing"),
|
||||
}
|
||||
|
||||
pub fn default_lib_output() -> CrateType {
|
||||
|
@ -909,21 +909,24 @@ pub fn build_session_with_codemap(sopts: config::Options,
|
||||
|
||||
let emitter: Box<Emitter> = match (sopts.error_format, emitter_dest) {
|
||||
(config::ErrorOutputType::HumanReadable(color_config), None) => {
|
||||
Box::new(EmitterWriter::stderr(color_config,
|
||||
Some(codemap.clone()),
|
||||
false,
|
||||
sopts.debugging_opts.teach))
|
||||
Box::new(EmitterWriter::stderr(color_config, Some(codemap.clone()),
|
||||
false, sopts.debugging_opts.teach)
|
||||
.ui_testing(sopts.debugging_opts.ui_testing))
|
||||
}
|
||||
(config::ErrorOutputType::HumanReadable(_), Some(dst)) => {
|
||||
Box::new(EmitterWriter::new(dst, Some(codemap.clone()), false, false))
|
||||
Box::new(EmitterWriter::new(dst, Some(codemap.clone()),
|
||||
false, false)
|
||||
.ui_testing(sopts.debugging_opts.ui_testing))
|
||||
}
|
||||
(config::ErrorOutputType::Json(pretty), None) => {
|
||||
Box::new(JsonEmitter::stderr(Some(registry), codemap.clone(),
|
||||
pretty, sopts.debugging_opts.approximate_suggestions))
|
||||
pretty, sopts.debugging_opts.approximate_suggestions)
|
||||
.ui_testing(sopts.debugging_opts.ui_testing))
|
||||
}
|
||||
(config::ErrorOutputType::Json(pretty), Some(dst)) => {
|
||||
Box::new(JsonEmitter::new(dst, Some(registry), codemap.clone(),
|
||||
pretty, sopts.debugging_opts.approximate_suggestions))
|
||||
pretty, sopts.debugging_opts.approximate_suggestions)
|
||||
.ui_testing(sopts.debugging_opts.ui_testing))
|
||||
}
|
||||
(config::ErrorOutputType::Short(color_config), None) => {
|
||||
Box::new(EmitterWriter::stderr(color_config, Some(codemap.clone()), true, false))
|
||||
|
@ -25,6 +25,8 @@ use std::collections::{HashMap, HashSet};
|
||||
use std::cmp::min;
|
||||
use unicode_width;
|
||||
|
||||
const ANONYMIZED_LINE_NUM: &str = "LL";
|
||||
|
||||
/// Emitter trait for emitting errors.
|
||||
pub trait Emitter {
|
||||
/// Emit a structured diagnostic.
|
||||
@ -108,6 +110,7 @@ pub struct EmitterWriter {
|
||||
short_message: bool,
|
||||
teach: bool,
|
||||
error_codes: HashSet<String>,
|
||||
ui_testing: bool,
|
||||
}
|
||||
|
||||
struct FileWithAnnotatedLines {
|
||||
@ -157,6 +160,7 @@ impl EmitterWriter {
|
||||
short_message,
|
||||
teach,
|
||||
error_codes: HashSet::new(),
|
||||
ui_testing: false,
|
||||
}
|
||||
} else {
|
||||
EmitterWriter {
|
||||
@ -165,6 +169,7 @@ impl EmitterWriter {
|
||||
short_message,
|
||||
teach,
|
||||
error_codes: HashSet::new(),
|
||||
ui_testing: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -180,6 +185,20 @@ impl EmitterWriter {
|
||||
short_message,
|
||||
teach,
|
||||
error_codes: HashSet::new(),
|
||||
ui_testing: false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ui_testing(mut self, ui_testing: bool) -> Self {
|
||||
self.ui_testing = ui_testing;
|
||||
self
|
||||
}
|
||||
|
||||
fn maybe_anonymized(&self, line_num: usize) -> String {
|
||||
if self.ui_testing {
|
||||
ANONYMIZED_LINE_NUM.to_string()
|
||||
} else {
|
||||
line_num.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
@ -336,7 +355,7 @@ impl EmitterWriter {
|
||||
buffer.puts(line_offset, code_offset, &source_string, Style::Quotation);
|
||||
buffer.puts(line_offset,
|
||||
0,
|
||||
&(line.line_index.to_string()),
|
||||
&self.maybe_anonymized(line.line_index),
|
||||
Style::LineNumber);
|
||||
|
||||
draw_col_separator(buffer, line_offset, width_offset - 2);
|
||||
@ -1159,8 +1178,8 @@ impl EmitterWriter {
|
||||
|
||||
buffer.puts(last_buffer_line_num,
|
||||
0,
|
||||
&(annotated_file.lines[line_idx + 1].line_index - 1)
|
||||
.to_string(),
|
||||
&self.maybe_anonymized(annotated_file.lines[line_idx + 1]
|
||||
.line_index - 1),
|
||||
Style::LineNumber);
|
||||
draw_col_separator(&mut buffer,
|
||||
last_buffer_line_num,
|
||||
@ -1235,7 +1254,7 @@ impl EmitterWriter {
|
||||
// Print the span column to avoid confusion
|
||||
buffer.puts(row_num,
|
||||
0,
|
||||
&((line_start + line_pos).to_string()),
|
||||
&self.maybe_anonymized(line_start + line_pos),
|
||||
Style::LineNumber);
|
||||
// print the suggestion
|
||||
draw_col_separator(&mut buffer, row_num, max_line_num_len + 1);
|
||||
@ -1288,8 +1307,11 @@ impl EmitterWriter {
|
||||
span: &MultiSpan,
|
||||
children: &Vec<SubDiagnostic>,
|
||||
suggestions: &[CodeSuggestion]) {
|
||||
let max_line_num = self.get_max_line_num(span, children);
|
||||
let max_line_num_len = max_line_num.to_string().len();
|
||||
let max_line_num_len = if self.ui_testing {
|
||||
ANONYMIZED_LINE_NUM.len()
|
||||
} else {
|
||||
self.get_max_line_num(span, children).to_string().len()
|
||||
};
|
||||
|
||||
match self.emit_message_default(span,
|
||||
message,
|
||||
|
@ -40,6 +40,7 @@ pub struct JsonEmitter {
|
||||
pretty: bool,
|
||||
/// Whether "approximate suggestions" are enabled in the config
|
||||
approximate_suggestions: bool,
|
||||
ui_testing: bool,
|
||||
}
|
||||
|
||||
impl JsonEmitter {
|
||||
@ -53,6 +54,7 @@ impl JsonEmitter {
|
||||
cm: code_map,
|
||||
pretty,
|
||||
approximate_suggestions,
|
||||
ui_testing: false,
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,8 +75,13 @@ impl JsonEmitter {
|
||||
cm: code_map,
|
||||
pretty,
|
||||
approximate_suggestions,
|
||||
ui_testing: false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ui_testing(self, ui_testing: bool) -> Self {
|
||||
Self { ui_testing, ..self }
|
||||
}
|
||||
}
|
||||
|
||||
impl Emitter for JsonEmitter {
|
||||
@ -199,7 +206,8 @@ impl Diagnostic {
|
||||
}
|
||||
let buf = BufWriter::default();
|
||||
let output = buf.clone();
|
||||
EmitterWriter::new(Box::new(buf), Some(je.cm.clone()), false, false).emit(db);
|
||||
EmitterWriter::new(Box::new(buf), Some(je.cm.clone()), false, false)
|
||||
.ui_testing(je.ui_testing).emit(db);
|
||||
let output = Arc::try_unwrap(output.0).unwrap().into_inner().unwrap();
|
||||
let output = String::from_utf8(output).unwrap();
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
error: proc-macro derive panicked
|
||||
--> $DIR/issue-36935.rs:18:15
|
||||
|
|
||||
18 | #[derive(Foo, Bar)] //~ ERROR proc-macro derive panicked
|
||||
LL | #[derive(Foo, Bar)] //~ ERROR proc-macro derive panicked
|
||||
| ^^^
|
||||
|
|
||||
= help: message: lolnope
|
||||
|
@ -1,6 +1,6 @@
|
||||
warning: derive(Encodable) is deprecated in favor of derive(RustcEncodable)
|
||||
--> $DIR/deprecated-derive.rs:18:10
|
||||
|
|
||||
18 | #[derive(Encodable)]
|
||||
LL | #[derive(Encodable)]
|
||||
| ^^^^^^^^^
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
warning: item is named 'lintme'
|
||||
--> $DIR/lint-group-plugin.rs:18:1
|
||||
|
|
||||
18 | fn lintme() { } //~ WARNING item is named 'lintme'
|
||||
LL | fn lintme() { } //~ WARNING item is named 'lintme'
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: #[warn(test_lint)] on by default
|
||||
@ -9,7 +9,7 @@ warning: item is named 'lintme'
|
||||
warning: item is named 'pleaselintme'
|
||||
--> $DIR/lint-group-plugin.rs:19:1
|
||||
|
|
||||
19 | fn pleaselintme() { } //~ WARNING item is named 'pleaselintme'
|
||||
LL | fn pleaselintme() { } //~ WARNING item is named 'pleaselintme'
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: #[warn(please_lint)] on by default
|
||||
|
@ -1,13 +1,13 @@
|
||||
warning: function is never used: `lintme`
|
||||
--> $DIR/lint-plugin-cmdline-allow.rs:20:1
|
||||
|
|
||||
20 | fn lintme() { }
|
||||
LL | fn lintme() { }
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/lint-plugin-cmdline-allow.rs:17:9
|
||||
|
|
||||
17 | #![warn(unused)]
|
||||
LL | #![warn(unused)]
|
||||
| ^^^^^^
|
||||
= note: #[warn(dead_code)] implied by #[warn(unused)]
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
warning: item is named 'lintme'
|
||||
--> $DIR/lint-plugin-cmdline-load.rs:18:1
|
||||
|
|
||||
18 | fn lintme() { } //~ WARNING item is named 'lintme'
|
||||
LL | fn lintme() { } //~ WARNING item is named 'lintme'
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: #[warn(test_lint)] on by default
|
||||
|
@ -1,22 +1,22 @@
|
||||
error: item is named 'lintme'
|
||||
--> $DIR/lint-plugin-forbid-attrs.rs:18:1
|
||||
|
|
||||
18 | fn lintme() { } //~ ERROR item is named 'lintme'
|
||||
LL | fn lintme() { } //~ ERROR item is named 'lintme'
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/lint-plugin-forbid-attrs.rs:16:11
|
||||
|
|
||||
16 | #![forbid(test_lint)]
|
||||
LL | #![forbid(test_lint)]
|
||||
| ^^^^^^^^^
|
||||
|
||||
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
|
||||
--> $DIR/lint-plugin-forbid-attrs.rs:20:9
|
||||
|
|
||||
16 | #![forbid(test_lint)]
|
||||
LL | #![forbid(test_lint)]
|
||||
| --------- `forbid` level set here
|
||||
...
|
||||
20 | #[allow(test_lint)]
|
||||
LL | #[allow(test_lint)]
|
||||
| ^^^^^^^^^ overruled by previous forbid
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -1,7 +1,7 @@
|
||||
warning: item is named 'lintme'
|
||||
--> $DIR/lint-plugin.rs:18:1
|
||||
|
|
||||
18 | fn lintme() { } //~ WARNING item is named 'lintme'
|
||||
LL | fn lintme() { } //~ WARNING item is named 'lintme'
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: #[warn(test_lint)] on by default
|
||||
|
@ -1,7 +1,7 @@
|
||||
error: proc-macro derive panicked
|
||||
--> $DIR/load-panic.rs:17:10
|
||||
|
|
||||
17 | #[derive(A)]
|
||||
LL | #[derive(A)]
|
||||
| ^
|
||||
|
|
||||
= help: message: nope!
|
||||
|
@ -1,127 +1,127 @@
|
||||
error: first final: "hello"
|
||||
--> $DIR/parent-source-spans.rs:27:12
|
||||
|
|
||||
27 | three!($a, $b);
|
||||
LL | three!($a, $b);
|
||||
| ^^
|
||||
...
|
||||
44 | one!("hello", "world");
|
||||
LL | one!("hello", "world");
|
||||
| ----------------------- in this macro invocation
|
||||
|
||||
error: second final: "world"
|
||||
--> $DIR/parent-source-spans.rs:27:16
|
||||
|
|
||||
27 | three!($a, $b);
|
||||
LL | three!($a, $b);
|
||||
| ^^
|
||||
...
|
||||
44 | one!("hello", "world");
|
||||
LL | one!("hello", "world");
|
||||
| ----------------------- in this macro invocation
|
||||
|
||||
error: first parent: "hello"
|
||||
--> $DIR/parent-source-spans.rs:21:5
|
||||
|
|
||||
21 | two!($a, $b);
|
||||
LL | two!($a, $b);
|
||||
| ^^^^^^^^^^^^^
|
||||
...
|
||||
44 | one!("hello", "world");
|
||||
LL | one!("hello", "world");
|
||||
| ----------------------- in this macro invocation
|
||||
|
||||
error: second parent: "world"
|
||||
--> $DIR/parent-source-spans.rs:21:5
|
||||
|
|
||||
21 | two!($a, $b);
|
||||
LL | two!($a, $b);
|
||||
| ^^^^^^^^^^^^^
|
||||
...
|
||||
44 | one!("hello", "world");
|
||||
LL | one!("hello", "world");
|
||||
| ----------------------- in this macro invocation
|
||||
|
||||
error: first grandparent: "hello"
|
||||
--> $DIR/parent-source-spans.rs:44:5
|
||||
|
|
||||
44 | one!("hello", "world");
|
||||
LL | one!("hello", "world");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: second grandparent: "world"
|
||||
--> $DIR/parent-source-spans.rs:44:5
|
||||
|
|
||||
44 | one!("hello", "world");
|
||||
LL | one!("hello", "world");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: first source: "hello"
|
||||
--> $DIR/parent-source-spans.rs:44:5
|
||||
|
|
||||
44 | one!("hello", "world");
|
||||
LL | one!("hello", "world");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: second source: "world"
|
||||
--> $DIR/parent-source-spans.rs:44:5
|
||||
|
|
||||
44 | one!("hello", "world");
|
||||
LL | one!("hello", "world");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: first final: "yay"
|
||||
--> $DIR/parent-source-spans.rs:27:12
|
||||
|
|
||||
27 | three!($a, $b);
|
||||
LL | three!($a, $b);
|
||||
| ^^
|
||||
...
|
||||
50 | two!("yay", "rust");
|
||||
LL | two!("yay", "rust");
|
||||
| -------------------- in this macro invocation
|
||||
|
||||
error: second final: "rust"
|
||||
--> $DIR/parent-source-spans.rs:27:16
|
||||
|
|
||||
27 | three!($a, $b);
|
||||
LL | three!($a, $b);
|
||||
| ^^
|
||||
...
|
||||
50 | two!("yay", "rust");
|
||||
LL | two!("yay", "rust");
|
||||
| -------------------- in this macro invocation
|
||||
|
||||
error: first parent: "yay"
|
||||
--> $DIR/parent-source-spans.rs:50:5
|
||||
|
|
||||
50 | two!("yay", "rust");
|
||||
LL | two!("yay", "rust");
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: second parent: "rust"
|
||||
--> $DIR/parent-source-spans.rs:50:5
|
||||
|
|
||||
50 | two!("yay", "rust");
|
||||
LL | two!("yay", "rust");
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: first source: "yay"
|
||||
--> $DIR/parent-source-spans.rs:50:5
|
||||
|
|
||||
50 | two!("yay", "rust");
|
||||
LL | two!("yay", "rust");
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: second source: "rust"
|
||||
--> $DIR/parent-source-spans.rs:50:5
|
||||
|
|
||||
50 | two!("yay", "rust");
|
||||
LL | two!("yay", "rust");
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: first final: "hip"
|
||||
--> $DIR/parent-source-spans.rs:56:12
|
||||
|
|
||||
56 | three!("hip", "hop");
|
||||
LL | three!("hip", "hop");
|
||||
| ^^^^^
|
||||
|
||||
error: second final: "hop"
|
||||
--> $DIR/parent-source-spans.rs:56:19
|
||||
|
|
||||
56 | three!("hip", "hop");
|
||||
LL | three!("hip", "hop");
|
||||
| ^^^^^
|
||||
|
||||
error: first source: "hip"
|
||||
--> $DIR/parent-source-spans.rs:56:12
|
||||
|
|
||||
56 | three!("hip", "hop");
|
||||
LL | three!("hip", "hop");
|
||||
| ^^^^^
|
||||
|
||||
error: second source: "hop"
|
||||
--> $DIR/parent-source-spans.rs:56:19
|
||||
|
|
||||
56 | three!("hip", "hop");
|
||||
LL | three!("hip", "hop");
|
||||
| ^^^^^
|
||||
|
||||
error: aborting due to 18 previous errors
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/signature.rs:17:1
|
||||
|
|
||||
17 | / pub unsafe extern fn foo(a: i32, b: u32) -> u32 {
|
||||
18 | | //~^ ERROR: mismatched types
|
||||
19 | | loop {}
|
||||
20 | | }
|
||||
LL | / pub unsafe extern fn foo(a: i32, b: u32) -> u32 {
|
||||
LL | | //~^ ERROR: mismatched types
|
||||
LL | | loop {}
|
||||
LL | | }
|
||||
| |_^ expected normal fn, found unsafe fn
|
||||
|
|
||||
= note: expected type `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
|
||||
|
@ -1,7 +1,7 @@
|
||||
error: found 2 equal signs, need exactly 3
|
||||
--> $DIR/three-equals.rs:25:5
|
||||
|
|
||||
25 | three_equals!(==); //~ ERROR found 2 equal signs, need exactly 3
|
||||
LL | three_equals!(==); //~ ERROR found 2 equal signs, need exactly 3
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: input must be: `===`
|
||||
@ -9,38 +9,38 @@ error: found 2 equal signs, need exactly 3
|
||||
error: expected EOF, found `=`.
|
||||
--> $DIR/three-equals.rs:28:21
|
||||
|
|
||||
28 | three_equals!(=====); //~ ERROR expected EOF
|
||||
LL | three_equals!(=====); //~ ERROR expected EOF
|
||||
| ^^
|
||||
|
|
||||
note: last good input was here
|
||||
--> $DIR/three-equals.rs:28:21
|
||||
|
|
||||
28 | three_equals!(=====); //~ ERROR expected EOF
|
||||
LL | three_equals!(=====); //~ ERROR expected EOF
|
||||
| ^^
|
||||
= help: input must be: `===`
|
||||
|
||||
error: expected `=`, found `abc`.
|
||||
--> $DIR/three-equals.rs:31:19
|
||||
|
|
||||
31 | three_equals!(abc); //~ ERROR expected `=`
|
||||
LL | three_equals!(abc); //~ ERROR expected `=`
|
||||
| ^^^
|
||||
|
||||
error: expected `=`, found `!`.
|
||||
--> $DIR/three-equals.rs:34:19
|
||||
|
|
||||
34 | three_equals!(!!); //~ ERROR expected `=`
|
||||
LL | three_equals!(!!); //~ ERROR expected `=`
|
||||
| ^
|
||||
|
||||
error: expected EOF, found `a`.
|
||||
--> $DIR/three-equals.rs:37:22
|
||||
|
|
||||
37 | three_equals!(===a); //~ ERROR expected EOF
|
||||
LL | three_equals!(===a); //~ ERROR expected EOF
|
||||
| ^
|
||||
|
|
||||
note: last good input was here
|
||||
--> $DIR/three-equals.rs:37:21
|
||||
|
|
||||
37 | three_equals!(===a); //~ ERROR expected EOF
|
||||
LL | three_equals!(===a); //~ ERROR expected EOF
|
||||
| ^
|
||||
= help: input must be: `===`
|
||||
|
||||
|
@ -1,61 +1,61 @@
|
||||
error: cannot find derive macro `FooWithLongNan` in this scope
|
||||
--> $DIR/resolve-error.rs:37:10
|
||||
|
|
||||
37 | #[derive(FooWithLongNan)]
|
||||
LL | #[derive(FooWithLongNan)]
|
||||
| ^^^^^^^^^^^^^^ help: try: `FooWithLongName`
|
||||
|
||||
error: cannot find attribute macro `attr_proc_macra` in this scope
|
||||
--> $DIR/resolve-error.rs:41:3
|
||||
|
|
||||
41 | #[attr_proc_macra]
|
||||
LL | #[attr_proc_macra]
|
||||
| ^^^^^^^^^^^^^^^ help: try: `attr_proc_macro`
|
||||
|
||||
error: cannot find attribute macro `FooWithLongNan` in this scope
|
||||
--> $DIR/resolve-error.rs:45:3
|
||||
|
|
||||
45 | #[FooWithLongNan]
|
||||
LL | #[FooWithLongNan]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: cannot find derive macro `Dlone` in this scope
|
||||
--> $DIR/resolve-error.rs:49:10
|
||||
|
|
||||
49 | #[derive(Dlone)]
|
||||
LL | #[derive(Dlone)]
|
||||
| ^^^^^ help: try: `Clone`
|
||||
|
||||
error: cannot find derive macro `Dlona` in this scope
|
||||
--> $DIR/resolve-error.rs:53:10
|
||||
|
|
||||
53 | #[derive(Dlona)]
|
||||
LL | #[derive(Dlona)]
|
||||
| ^^^^^ help: try: `Clona`
|
||||
|
||||
error: cannot find derive macro `attr_proc_macra` in this scope
|
||||
--> $DIR/resolve-error.rs:57:10
|
||||
|
|
||||
57 | #[derive(attr_proc_macra)]
|
||||
LL | #[derive(attr_proc_macra)]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: cannot find macro `FooWithLongNama!` in this scope
|
||||
--> $DIR/resolve-error.rs:62:5
|
||||
|
|
||||
62 | FooWithLongNama!();
|
||||
LL | FooWithLongNama!();
|
||||
| ^^^^^^^^^^^^^^^ help: you could try the macro: `FooWithLongNam`
|
||||
|
||||
error: cannot find macro `attr_proc_macra!` in this scope
|
||||
--> $DIR/resolve-error.rs:65:5
|
||||
|
|
||||
65 | attr_proc_macra!();
|
||||
LL | attr_proc_macra!();
|
||||
| ^^^^^^^^^^^^^^^ help: you could try the macro: `attr_proc_mac`
|
||||
|
||||
error: cannot find macro `Dlona!` in this scope
|
||||
--> $DIR/resolve-error.rs:68:5
|
||||
|
|
||||
68 | Dlona!();
|
||||
LL | Dlona!();
|
||||
| ^^^^^
|
||||
|
||||
error: cannot find macro `bang_proc_macrp!` in this scope
|
||||
--> $DIR/resolve-error.rs:71:5
|
||||
|
|
||||
71 | bang_proc_macrp!();
|
||||
LL | bang_proc_macrp!();
|
||||
| ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro`
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
|
||||
|
|
||||
12 | f1(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
LL | f1(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
| ^^ -------------- found signature of `fn((), ()) -> _`
|
||||
| |
|
||||
| expected signature of `for<'r, 's> fn(&'r (), &'s ()) -> _`
|
||||
@ -9,13 +9,13 @@ error[E0631]: type mismatch in closure arguments
|
||||
note: required by `f1`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:26:1
|
||||
|
|
||||
26 | fn f1<F>(_: F) where F: Fn(&(), &()) {}
|
||||
LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:13:5
|
||||
|
|
||||
13 | f2(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
LL | f2(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
| ^^ -------------- found signature of `fn((), ()) -> _`
|
||||
| |
|
||||
| expected signature of `for<'a, 'r> fn(&'a (), &'r ()) -> _`
|
||||
@ -23,13 +23,13 @@ error[E0631]: type mismatch in closure arguments
|
||||
note: required by `f2`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:27:1
|
||||
|
|
||||
27 | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
|
||||
LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:14:5
|
||||
|
|
||||
14 | f3(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
LL | f3(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
| ^^ -------------- found signature of `fn((), ()) -> _`
|
||||
| |
|
||||
| expected signature of `for<'r> fn(&(), &'r ()) -> _`
|
||||
@ -37,13 +37,13 @@ error[E0631]: type mismatch in closure arguments
|
||||
note: required by `f3`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:28:1
|
||||
|
|
||||
28 | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
|
||||
LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:15:5
|
||||
|
|
||||
15 | f4(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
LL | f4(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
| ^^ -------------- found signature of `fn((), ()) -> _`
|
||||
| |
|
||||
| expected signature of `for<'s, 'r> fn(&'s (), &'r ()) -> _`
|
||||
@ -51,13 +51,13 @@ error[E0631]: type mismatch in closure arguments
|
||||
note: required by `f4`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:29:1
|
||||
|
|
||||
29 | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
|
||||
LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:16:5
|
||||
|
|
||||
16 | f5(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
LL | f5(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
| ^^ -------------- found signature of `fn((), ()) -> _`
|
||||
| |
|
||||
| expected signature of `for<'r> fn(&'r (), &'r ()) -> _`
|
||||
@ -65,13 +65,13 @@ error[E0631]: type mismatch in closure arguments
|
||||
note: required by `f5`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:30:1
|
||||
|
|
||||
30 | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
|
||||
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:17:5
|
||||
|
|
||||
17 | g1(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
LL | g1(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
| ^^ -------------- found signature of `fn((), ()) -> _`
|
||||
| |
|
||||
| expected signature of `for<'r> fn(&'r (), std::boxed::Box<for<'s> std::ops::Fn(&'s ()) + 'static>) -> _`
|
||||
@ -79,13 +79,13 @@ error[E0631]: type mismatch in closure arguments
|
||||
note: required by `g1`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:33:1
|
||||
|
|
||||
33 | fn g1<F>(_: F) where F: Fn(&(), Box<Fn(&())>) {}
|
||||
LL | fn g1<F>(_: F) where F: Fn(&(), Box<Fn(&())>) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:18:5
|
||||
|
|
||||
18 | g2(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
LL | g2(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
| ^^ -------------- found signature of `fn((), ()) -> _`
|
||||
| |
|
||||
| expected signature of `for<'r> fn(&'r (), for<'s> fn(&'s ())) -> _`
|
||||
@ -93,13 +93,13 @@ error[E0631]: type mismatch in closure arguments
|
||||
note: required by `g2`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:34:1
|
||||
|
|
||||
34 | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
|
||||
LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:19:5
|
||||
|
|
||||
19 | g3(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
LL | g3(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
| ^^ -------------- found signature of `fn((), ()) -> _`
|
||||
| |
|
||||
| expected signature of `for<'s> fn(&'s (), std::boxed::Box<for<'r> std::ops::Fn(&'r ()) + 'static>) -> _`
|
||||
@ -107,13 +107,13 @@ error[E0631]: type mismatch in closure arguments
|
||||
note: required by `g3`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:35:1
|
||||
|
|
||||
35 | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<Fn(&())>) {}
|
||||
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:20:5
|
||||
|
|
||||
20 | g4(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
LL | g4(|_: (), _: ()| {}); //~ ERROR type mismatch
|
||||
| ^^ -------------- found signature of `fn((), ()) -> _`
|
||||
| |
|
||||
| expected signature of `for<'s> fn(&'s (), for<'r> fn(&'r ())) -> _`
|
||||
@ -121,13 +121,13 @@ error[E0631]: type mismatch in closure arguments
|
||||
note: required by `g4`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:36:1
|
||||
|
|
||||
36 | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
|
||||
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:21:5
|
||||
|
|
||||
21 | h1(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
|
||||
LL | h1(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
|
||||
| ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
|
||||
| |
|
||||
| expected signature of `for<'r, 's> fn(&'r (), std::boxed::Box<for<'t0> std::ops::Fn(&'t0 ()) + 'static>, &'s (), for<'t0, 't1> fn(&'t0 (), &'t1 ())) -> _`
|
||||
@ -135,13 +135,13 @@ error[E0631]: type mismatch in closure arguments
|
||||
note: required by `h1`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:39:1
|
||||
|
|
||||
39 | fn h1<F>(_: F) where F: Fn(&(), Box<Fn(&())>, &(), fn(&(), &())) {}
|
||||
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
|
||||
|
|
||||
22 | h2(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
|
||||
LL | h2(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
|
||||
| ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
|
||||
| |
|
||||
| expected signature of `for<'r, 't0> fn(&'r (), std::boxed::Box<for<'s> std::ops::Fn(&'s ()) + 'static>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _`
|
||||
@ -149,7 +149,7 @@ error[E0631]: type mismatch in closure arguments
|
||||
note: required by `h2`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:40:1
|
||||
|
|
||||
40 | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<Fn(&())>, &'t0 (), fn(&(), &())) {}
|
||||
LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<Fn(&())>, &'t0 (), fn(&(), &())) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 11 previous errors
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0038]: the trait `Foo` cannot be made into an object
|
||||
--> $DIR/arbitrary-self-types-not-object-safe.rs:40:33
|
||||
|
|
||||
40 | let x = Box::new(5usize) as Box<Foo>;
|
||||
LL | let x = Box::new(5usize) as Box<Foo>;
|
||||
| ^^^^^^^^ the trait `Foo` cannot be made into an object
|
||||
|
|
||||
= note: method `foo` has a non-standard `self` type
|
||||
@ -9,7 +9,7 @@ error[E0038]: the trait `Foo` cannot be made into an object
|
||||
error[E0038]: the trait `Foo` cannot be made into an object
|
||||
--> $DIR/arbitrary-self-types-not-object-safe.rs:40:13
|
||||
|
|
||||
40 | let x = Box::new(5usize) as Box<Foo>;
|
||||
LL | let x = Box::new(5usize) as Box<Foo>;
|
||||
| ^^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object
|
||||
|
|
||||
= note: method `foo` has a non-standard `self` type
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0384]: cannot assign twice to immutable variable `x`
|
||||
--> $DIR/asm-out-assign-imm.rs:29:9
|
||||
|
|
||||
26 | x = 1;
|
||||
LL | x = 1;
|
||||
| ----- first assignment to `x`
|
||||
...
|
||||
29 | asm!("mov $1, $0" : "=r"(x) : "r"(5));
|
||||
LL | asm!("mov $1, $0" : "=r"(x) : "r"(5));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/associated-const-impl-wrong-lifetime.rs:18:5
|
||||
|
|
||||
18 | const NAME: &'a str = "unit";
|
||||
LL | const NAME: &'a str = "unit";
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
||||
|
|
||||
= note: expected type `&'static str`
|
||||
@ -9,7 +9,7 @@ error[E0308]: mismatched types
|
||||
note: the lifetime 'a as defined on the impl at 17:1...
|
||||
--> $DIR/associated-const-impl-wrong-lifetime.rs:17:1
|
||||
|
|
||||
17 | impl<'a> Foo for &'a () {
|
||||
LL | impl<'a> Foo for &'a () {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: ...does not necessarily outlive the static lifetime
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0326]: implemented const `BAR` has an incompatible type for trait
|
||||
--> $DIR/associated-const-impl-wrong-type.rs:19:16
|
||||
|
|
||||
13 | const BAR: u32;
|
||||
LL | const BAR: u32;
|
||||
| --- type in trait
|
||||
...
|
||||
19 | const BAR: i32 = -1;
|
||||
LL | const BAR: i32 = -1;
|
||||
| ^^^ expected u32, found i32
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,43 +1,43 @@
|
||||
error[E0221]: ambiguous associated type `Color` in bounds of `C`
|
||||
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:29:32
|
||||
|
|
||||
15 | type Color;
|
||||
LL | type Color;
|
||||
| ----------- ambiguous `Color` from `Vehicle`
|
||||
...
|
||||
21 | type Color;
|
||||
LL | type Color;
|
||||
| ----------- ambiguous `Color` from `Box`
|
||||
...
|
||||
29 | fn dent<C:BoxCar>(c: C, color: C::Color) {
|
||||
LL | fn dent<C:BoxCar>(c: C, color: C::Color) {
|
||||
| ^^^^^^^^ ambiguous associated type `Color`
|
||||
|
||||
error[E0221]: ambiguous associated type `Color` in bounds of `BoxCar`
|
||||
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:33:33
|
||||
|
|
||||
15 | type Color;
|
||||
LL | type Color;
|
||||
| ----------- ambiguous `Color` from `Vehicle`
|
||||
...
|
||||
21 | type Color;
|
||||
LL | type Color;
|
||||
| ----------- ambiguous `Color` from `Box`
|
||||
...
|
||||
33 | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
|
||||
LL | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
|
||||
| ^^^^^^^^^^^ ambiguous associated type `Color`
|
||||
|
||||
error[E0191]: the value of the associated type `Color` (from the trait `Vehicle`) must be specified
|
||||
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:33:26
|
||||
|
|
||||
33 | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
|
||||
LL | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
|
||||
| ^^^^^^^^^^^^^^^^^^^ missing associated type `Color` value
|
||||
|
||||
error[E0221]: ambiguous associated type `Color` in bounds of `C`
|
||||
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:38:29
|
||||
|
|
||||
15 | type Color;
|
||||
LL | type Color;
|
||||
| ----------- ambiguous `Color` from `Vehicle`
|
||||
...
|
||||
21 | type Color;
|
||||
LL | type Color;
|
||||
| ----------- ambiguous `Color` from `Box`
|
||||
...
|
||||
38 | fn paint<C:BoxCar>(c: C, d: C::Color) {
|
||||
LL | fn paint<C:BoxCar>(c: C, d: C::Color) {
|
||||
| ^^^^^^^^ ambiguous associated type `Color`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0277]: the trait bound `(): Add<A>` is not satisfied
|
||||
--> $DIR/associated-types-ICE-when-projecting-out-of-err.rs:33:11
|
||||
|
|
||||
33 | r = r + a;
|
||||
LL | r = r + a;
|
||||
| ^ the trait `Add<A>` is not implemented for `()`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0223]: ambiguous associated type
|
||||
--> $DIR/associated-types-in-ambiguous-context.rs:16:36
|
||||
|
|
||||
16 | fn get<T:Get,U:Get>(x: T, y: U) -> Get::Value {}
|
||||
LL | fn get<T:Get,U:Get>(x: T, y: U) -> Get::Value {}
|
||||
| ^^^^^^^^^^ ambiguous associated type
|
||||
|
|
||||
= note: specify the type using the syntax `<Type as Get>::Value`
|
||||
@ -9,7 +9,7 @@ error[E0223]: ambiguous associated type
|
||||
error[E0223]: ambiguous associated type
|
||||
--> $DIR/associated-types-in-ambiguous-context.rs:25:10
|
||||
|
|
||||
25 | type X = std::ops::Deref::Target;
|
||||
LL | type X = std::ops::Deref::Target;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type
|
||||
|
|
||||
= note: specify the type using the syntax `<Type as std::ops::Deref>::Target`
|
||||
@ -17,7 +17,7 @@ error[E0223]: ambiguous associated type
|
||||
error[E0223]: ambiguous associated type
|
||||
--> $DIR/associated-types-in-ambiguous-context.rs:21:23
|
||||
|
|
||||
21 | fn grab(&self) -> Grab::Value;
|
||||
LL | fn grab(&self) -> Grab::Value;
|
||||
| ^^^^^^^^^^^ ambiguous associated type
|
||||
|
|
||||
= note: specify the type using the syntax `<Type as Grab>::Value`
|
||||
|
@ -1,41 +1,41 @@
|
||||
error[E0517]: attribute should be applied to struct, enum or union
|
||||
--> $DIR/attr-usage-repr.rs:14:8
|
||||
|
|
||||
14 | #[repr(C)] //~ ERROR: attribute should be applied to struct, enum or union
|
||||
LL | #[repr(C)] //~ ERROR: attribute should be applied to struct, enum or union
|
||||
| ^
|
||||
15 | fn f() {}
|
||||
LL | fn f() {}
|
||||
| --------- not a struct, enum or union
|
||||
|
||||
error[E0517]: attribute should be applied to enum
|
||||
--> $DIR/attr-usage-repr.rs:26:8
|
||||
|
|
||||
26 | #[repr(i8)] //~ ERROR: attribute should be applied to enum
|
||||
LL | #[repr(i8)] //~ ERROR: attribute should be applied to enum
|
||||
| ^^
|
||||
27 | struct SInt(f64, f64);
|
||||
LL | struct SInt(f64, f64);
|
||||
| ---------------------- not an enum
|
||||
|
||||
error[E0517]: attribute should be applied to struct or union
|
||||
--> $DIR/attr-usage-repr.rs:32:8
|
||||
|
|
||||
32 | #[repr(align(8))] //~ ERROR: attribute should be applied to struct
|
||||
LL | #[repr(align(8))] //~ ERROR: attribute should be applied to struct
|
||||
| ^^^^^^^^
|
||||
33 | enum EAlign { A, B }
|
||||
LL | enum EAlign { A, B }
|
||||
| -------------------- not a struct or union
|
||||
|
||||
error[E0517]: attribute should be applied to struct or union
|
||||
--> $DIR/attr-usage-repr.rs:35:8
|
||||
|
|
||||
35 | #[repr(packed)] //~ ERROR: attribute should be applied to struct
|
||||
LL | #[repr(packed)] //~ ERROR: attribute should be applied to struct
|
||||
| ^^^^^^
|
||||
36 | enum EPacked { A, B }
|
||||
LL | enum EPacked { A, B }
|
||||
| --------------------- not a struct or union
|
||||
|
||||
error[E0517]: attribute should be applied to struct
|
||||
--> $DIR/attr-usage-repr.rs:38:8
|
||||
|
|
||||
38 | #[repr(simd)] //~ ERROR: attribute should be applied to struct
|
||||
LL | #[repr(simd)] //~ ERROR: attribute should be applied to struct
|
||||
| ^^^^
|
||||
39 | enum ESimd { A, B }
|
||||
LL | enum ESimd { A, B }
|
||||
| ------------------- not a struct
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
@ -1,19 +1,19 @@
|
||||
error[E0596]: cannot borrow immutable local variable `y` as mutable
|
||||
--> $DIR/augmented-assignments.rs:30:5
|
||||
|
|
||||
28 | let y = Int(2);
|
||||
LL | let y = Int(2);
|
||||
| - consider changing this to `mut y`
|
||||
29 | //~^ consider changing this to `mut y`
|
||||
30 | y //~ error: cannot borrow immutable local variable `y` as mutable
|
||||
LL | //~^ consider changing this to `mut y`
|
||||
LL | y //~ error: cannot borrow immutable local variable `y` as mutable
|
||||
| ^ cannot borrow mutably
|
||||
|
||||
error[E0382]: use of moved value: `x`
|
||||
--> $DIR/augmented-assignments.rs:23:5
|
||||
|
|
||||
23 | x //~ error: use of moved value: `x`
|
||||
LL | x //~ error: use of moved value: `x`
|
||||
| ^ value used here after move
|
||||
...
|
||||
26 | x; //~ value moved here
|
||||
LL | x; //~ value moved here
|
||||
| - value moved here
|
||||
|
|
||||
= note: move occurs because `x` has type `Int`, which does not implement the `Copy` trait
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0369]: binary operation `%` cannot be applied to type `&&{integer}`
|
||||
--> $DIR/binary-op-on-double-ref.rs:14:9
|
||||
|
|
||||
14 | x % 2 == 0
|
||||
LL | x % 2 == 0
|
||||
| ^^^^^
|
||||
|
|
||||
= note: this is a reference to a type that `%` can be applied to; you need to dereference this variable once for this operation to work
|
||||
|
@ -1,16 +1,16 @@
|
||||
error[E0255]: the name `foo` is defined multiple times
|
||||
--> $DIR/blind-item-item-shadow.rs:13:5
|
||||
|
|
||||
11 | mod foo { pub mod foo { } }
|
||||
LL | mod foo { pub mod foo { } }
|
||||
| ------- previous definition of the module `foo` here
|
||||
12 |
|
||||
13 | use foo::foo;
|
||||
LL |
|
||||
LL | use foo::foo;
|
||||
| ^^^^^^^^ `foo` reimported here
|
||||
|
|
||||
= note: `foo` must be defined only once in the type namespace of this module
|
||||
help: You can use `as` to change the binding name of the import
|
||||
|
|
||||
13 | use foo::foo as other_foo;
|
||||
LL | use foo::foo as other_foo;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/block-must-not-have-result-do.rs:13:9
|
||||
|
|
||||
13 | true //~ ERROR mismatched types
|
||||
LL | true //~ ERROR mismatched types
|
||||
| ^^^^ expected (), found bool
|
||||
|
|
||||
= note: expected type `()`
|
||||
|
@ -1,9 +1,9 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/block-must-not-have-result-res.rs:15:9
|
||||
|
|
||||
14 | fn drop(&mut self) {
|
||||
LL | fn drop(&mut self) {
|
||||
| - expected `()` because of default return type
|
||||
15 | true //~ ERROR mismatched types
|
||||
LL | true //~ ERROR mismatched types
|
||||
| ^^^^ expected (), found bool
|
||||
|
|
||||
= note: expected type `()`
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/block-must-not-have-result-while.rs:13:9
|
||||
|
|
||||
13 | true //~ ERROR mismatched types
|
||||
LL | true //~ ERROR mismatched types
|
||||
| ^^^^ expected (), found bool
|
||||
|
|
||||
= note: expected type `()`
|
||||
|
@ -1,12 +1,12 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/consider-removing-last-semi.rs:11:18
|
||||
|
|
||||
11 | fn f() -> String { //~ ERROR mismatched types
|
||||
LL | fn f() -> String { //~ ERROR mismatched types
|
||||
| __________________^
|
||||
12 | | 0u8;
|
||||
13 | | "bla".to_string();
|
||||
LL | | 0u8;
|
||||
LL | | "bla".to_string();
|
||||
| | - help: consider removing this semicolon
|
||||
14 | | }
|
||||
LL | | }
|
||||
| |_^ expected struct `std::string::String`, found ()
|
||||
|
|
||||
= note: expected type `std::string::String`
|
||||
@ -15,12 +15,12 @@ error[E0308]: mismatched types
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/consider-removing-last-semi.rs:16:18
|
||||
|
|
||||
16 | fn g() -> String { //~ ERROR mismatched types
|
||||
LL | fn g() -> String { //~ ERROR mismatched types
|
||||
| __________________^
|
||||
17 | | "this won't work".to_string();
|
||||
18 | | "removeme".to_string();
|
||||
LL | | "this won't work".to_string();
|
||||
LL | | "removeme".to_string();
|
||||
| | - help: consider removing this semicolon
|
||||
19 | | }
|
||||
LL | | }
|
||||
| |_^ expected struct `std::string::String`, found ()
|
||||
|
|
||||
= note: expected type `std::string::String`
|
||||
|
@ -1,13 +1,13 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-11714.rs:11:18
|
||||
|
|
||||
11 | fn blah() -> i32 { //~ ERROR mismatched types
|
||||
LL | fn blah() -> i32 { //~ ERROR mismatched types
|
||||
| __________________^
|
||||
12 | | 1
|
||||
13 | |
|
||||
14 | | ;
|
||||
LL | | 1
|
||||
LL | |
|
||||
LL | | ;
|
||||
| | - help: consider removing this semicolon
|
||||
15 | | }
|
||||
LL | | }
|
||||
| |_^ expected i32, found ()
|
||||
|
|
||||
= note: expected type `i32`
|
||||
|
@ -1,15 +1,15 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-13428.rs:13:20
|
||||
|
|
||||
13 | fn foo() -> String { //~ ERROR mismatched types
|
||||
LL | fn foo() -> String { //~ ERROR mismatched types
|
||||
| ____________________^
|
||||
14 | | format!("Hello {}",
|
||||
15 | | "world")
|
||||
16 | | // Put the trailing semicolon on its own line to test that the
|
||||
17 | | // note message gets the offending semicolon exactly
|
||||
18 | | ;
|
||||
LL | | format!("Hello {}",
|
||||
LL | | "world")
|
||||
LL | | // Put the trailing semicolon on its own line to test that the
|
||||
LL | | // note message gets the offending semicolon exactly
|
||||
LL | | ;
|
||||
| | - help: consider removing this semicolon
|
||||
19 | | }
|
||||
LL | | }
|
||||
| |_^ expected struct `std::string::String`, found ()
|
||||
|
|
||||
= note: expected type `std::string::String`
|
||||
@ -18,12 +18,12 @@ error[E0308]: mismatched types
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-13428.rs:21:20
|
||||
|
|
||||
21 | fn bar() -> String { //~ ERROR mismatched types
|
||||
LL | fn bar() -> String { //~ ERROR mismatched types
|
||||
| ____________________^
|
||||
22 | | "foobar".to_string()
|
||||
23 | | ;
|
||||
LL | | "foobar".to_string()
|
||||
LL | | ;
|
||||
| | - help: consider removing this semicolon
|
||||
24 | | }
|
||||
LL | | }
|
||||
| |_^ expected struct `std::string::String`, found ()
|
||||
|
|
||||
= note: expected type `std::string::String`
|
||||
|
@ -1,9 +1,9 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-13624.rs:17:5
|
||||
|
|
||||
16 | pub fn get_enum_struct_variant() -> () {
|
||||
LL | pub fn get_enum_struct_variant() -> () {
|
||||
| -- expected `()` because of return type
|
||||
17 | Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
|
||||
LL | Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum`
|
||||
|
|
||||
= note: expected type `()`
|
||||
@ -12,7 +12,7 @@ error[E0308]: mismatched types
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-13624.rs:32:9
|
||||
|
|
||||
32 | a::Enum::EnumStructVariant { x, y, z } => {
|
||||
LL | a::Enum::EnumStructVariant { x, y, z } => {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum`
|
||||
|
|
||||
= note: expected type `()`
|
||||
|
@ -1,9 +1,9 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-20862.rs:12:5
|
||||
|
|
||||
11 | fn foo(x: i32) {
|
||||
LL | fn foo(x: i32) {
|
||||
| - possibly return type missing here?
|
||||
12 | |y| x + y
|
||||
LL | |y| x + y
|
||||
| ^^^^^^^^^ expected (), found closure
|
||||
|
|
||||
= note: expected type `()`
|
||||
@ -12,7 +12,7 @@ error[E0308]: mismatched types
|
||||
error[E0618]: expected function, found `()`
|
||||
--> $DIR/issue-20862.rs:17:13
|
||||
|
|
||||
17 | let x = foo(5)(2);
|
||||
LL | let x = foo(5)(2);
|
||||
| ^^^^^^^^^ not a function
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0277]: the trait bound `{integer}: Scalar` is not satisfied
|
||||
--> $DIR/issue-22645.rs:25:5
|
||||
|
|
||||
25 | b + 3 //~ ERROR E0277
|
||||
LL | b + 3 //~ ERROR E0277
|
||||
| ^ the trait `Scalar` is not implemented for `{integer}`
|
||||
|
|
||||
= help: the following implementations were found:
|
||||
@ -11,10 +11,10 @@ error[E0277]: the trait bound `{integer}: Scalar` is not satisfied
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-22645.rs:25:3
|
||||
|
|
||||
23 | fn main() {
|
||||
LL | fn main() {
|
||||
| - expected `()` because of default return type
|
||||
24 | let b = Bob + 3.5;
|
||||
25 | b + 3 //~ ERROR E0277
|
||||
LL | let b = Bob + 3.5;
|
||||
LL | b + 3 //~ ERROR E0277
|
||||
| ^^^^^ expected (), found struct `Bob`
|
||||
|
|
||||
= note: expected type `()`
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0599]: no method named `b` found for type `&Self` in the current scope
|
||||
--> $DIR/issue-3563.rs:13:17
|
||||
|
|
||||
13 | || self.b()
|
||||
LL | || self.b()
|
||||
| ^
|
||||
|
|
||||
= help: did you mean `a`?
|
||||
|
@ -1,9 +1,9 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-5500.rs:12:5
|
||||
|
|
||||
11 | fn main() {
|
||||
LL | fn main() {
|
||||
| - expected `()` because of default return type
|
||||
12 | &panic!()
|
||||
LL | &panic!()
|
||||
| ^^^^^^^^^ expected (), found reference
|
||||
|
|
||||
= note: expected type `()`
|
||||
|
@ -1,18 +1,18 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/unexpected-return-on-unit.rs:19:5
|
||||
|
|
||||
19 | foo() //~ ERROR mismatched types
|
||||
LL | foo() //~ ERROR mismatched types
|
||||
| ^^^^^ expected (), found usize
|
||||
|
|
||||
= note: expected type `()`
|
||||
found type `usize`
|
||||
help: try adding a semicolon
|
||||
|
|
||||
19 | foo(); //~ ERROR mismatched types
|
||||
LL | foo(); //~ ERROR mismatched types
|
||||
| ^
|
||||
help: try adding a return type
|
||||
|
|
||||
18 | fn bar() -> usize {
|
||||
LL | fn bar() -> usize {
|
||||
| ^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0599]: no variant named `hsl` found for type `color` in the current scope
|
||||
--> $DIR/bogus-tag.rs:18:7
|
||||
|
|
||||
12 | enum color { rgb(isize, isize, isize), rgba(isize, isize, isize, isize), }
|
||||
LL | enum color { rgb(isize, isize, isize), rgba(isize, isize, isize, isize), }
|
||||
| ---------- variant `hsl` not found here
|
||||
...
|
||||
18 | color::hsl(h, s, l) => { println!("hsl"); }
|
||||
LL | color::hsl(h, s, l) => { println!("hsl"); }
|
||||
| ^^^^^^^^^^^^^^^^^^^ variant not found in `color`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0382]: use of moved value: `a`
|
||||
--> $DIR/borrowck-box-insensitivity.rs:37:9
|
||||
|
|
||||
35 | let _x = a.x;
|
||||
LL | let _x = a.x;
|
||||
| -- value moved here
|
||||
36 | //~^ value moved here
|
||||
37 | let _y = a.y; //~ ERROR use of moved
|
||||
LL | //~^ value moved here
|
||||
LL | let _y = a.y; //~ ERROR use of moved
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
@ -12,10 +12,10 @@ error[E0382]: use of moved value: `a`
|
||||
error[E0382]: use of moved value: `a`
|
||||
--> $DIR/borrowck-box-insensitivity.rs:46:9
|
||||
|
|
||||
44 | let _x = a.x;
|
||||
LL | let _x = a.x;
|
||||
| -- value moved here
|
||||
45 | //~^ value moved here
|
||||
46 | let _y = a.y; //~ ERROR use of moved
|
||||
LL | //~^ value moved here
|
||||
LL | let _y = a.y; //~ ERROR use of moved
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
@ -23,10 +23,10 @@ error[E0382]: use of moved value: `a`
|
||||
error[E0382]: use of moved value: `a`
|
||||
--> $DIR/borrowck-box-insensitivity.rs:55:15
|
||||
|
|
||||
53 | let _x = a.x;
|
||||
LL | let _x = a.x;
|
||||
| -- value moved here
|
||||
54 | //~^ value moved here
|
||||
55 | let _y = &a.y; //~ ERROR use of moved
|
||||
LL | //~^ value moved here
|
||||
LL | let _y = &a.y; //~ ERROR use of moved
|
||||
| ^^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
@ -34,130 +34,130 @@ error[E0382]: use of moved value: `a`
|
||||
error[E0505]: cannot move out of `a.y` because it is borrowed
|
||||
--> $DIR/borrowck-box-insensitivity.rs:63:9
|
||||
|
|
||||
62 | let _x = &a.x;
|
||||
LL | let _x = &a.x;
|
||||
| --- borrow of `a.x` occurs here
|
||||
63 | let _y = a.y;
|
||||
LL | let _y = a.y;
|
||||
| ^^ move out of `a.y` occurs here
|
||||
|
||||
error[E0503]: cannot use `a.y` because it was mutably borrowed
|
||||
--> $DIR/borrowck-box-insensitivity.rs:71:9
|
||||
|
|
||||
70 | let _x = &mut a.x;
|
||||
LL | let _x = &mut a.x;
|
||||
| --- borrow of `a.x` occurs here
|
||||
71 | let _y = a.y; //~ ERROR cannot use
|
||||
LL | let _y = a.y; //~ ERROR cannot use
|
||||
| ^^ use of borrowed `a.x`
|
||||
|
||||
error[E0505]: cannot move out of `a.y` because it is borrowed
|
||||
--> $DIR/borrowck-box-insensitivity.rs:77:9
|
||||
|
|
||||
76 | let _x = &mut a.x;
|
||||
LL | let _x = &mut a.x;
|
||||
| --- borrow of `a.x` occurs here
|
||||
77 | let _y = a.y;
|
||||
LL | let _y = a.y;
|
||||
| ^^ move out of `a.y` occurs here
|
||||
|
||||
error[E0502]: cannot borrow `a` (via `a.y`) as immutable because `a` is also borrowed as mutable (via `a.x`)
|
||||
--> $DIR/borrowck-box-insensitivity.rs:85:15
|
||||
|
|
||||
84 | let _x = &mut a.x;
|
||||
LL | let _x = &mut a.x;
|
||||
| --- mutable borrow occurs here (via `a.x`)
|
||||
85 | let _y = &a.y; //~ ERROR cannot borrow
|
||||
LL | let _y = &a.y; //~ ERROR cannot borrow
|
||||
| ^^^ immutable borrow occurs here (via `a.y`)
|
||||
86 | //~^ immutable borrow occurs here (via `a.y`)
|
||||
87 | }
|
||||
LL | //~^ immutable borrow occurs here (via `a.y`)
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
error[E0502]: cannot borrow `a` (via `a.y`) as mutable because `a` is also borrowed as immutable (via `a.x`)
|
||||
--> $DIR/borrowck-box-insensitivity.rs:92:19
|
||||
|
|
||||
91 | let _x = &a.x;
|
||||
LL | let _x = &a.x;
|
||||
| --- immutable borrow occurs here (via `a.x`)
|
||||
92 | let _y = &mut a.y; //~ ERROR cannot borrow
|
||||
LL | let _y = &mut a.y; //~ ERROR cannot borrow
|
||||
| ^^^ mutable borrow occurs here (via `a.y`)
|
||||
93 | //~^ mutable borrow occurs here (via `a.y`)
|
||||
94 | }
|
||||
LL | //~^ mutable borrow occurs here (via `a.y`)
|
||||
LL | }
|
||||
| - immutable borrow ends here
|
||||
|
||||
error[E0382]: use of collaterally moved value: `a.y`
|
||||
--> $DIR/borrowck-box-insensitivity.rs:100:9
|
||||
|
|
||||
98 | let _x = a.x.x;
|
||||
| -- value moved here
|
||||
99 | //~^ value moved here
|
||||
100 | let _y = a.y; //~ ERROR use of collaterally moved
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
--> $DIR/borrowck-box-insensitivity.rs:100:9
|
||||
|
|
||||
LL | let _x = a.x.x;
|
||||
| -- value moved here
|
||||
LL | //~^ value moved here
|
||||
LL | let _y = a.y; //~ ERROR use of collaterally moved
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0382]: use of collaterally moved value: `a.y`
|
||||
--> $DIR/borrowck-box-insensitivity.rs:108:9
|
||||
|
|
||||
106 | let _x = a.x.x;
|
||||
| -- value moved here
|
||||
107 | //~^ value moved here
|
||||
108 | let _y = a.y; //~ ERROR use of collaterally moved
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
--> $DIR/borrowck-box-insensitivity.rs:108:9
|
||||
|
|
||||
LL | let _x = a.x.x;
|
||||
| -- value moved here
|
||||
LL | //~^ value moved here
|
||||
LL | let _y = a.y; //~ ERROR use of collaterally moved
|
||||
| ^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0382]: use of collaterally moved value: `a.y`
|
||||
--> $DIR/borrowck-box-insensitivity.rs:116:15
|
||||
|
|
||||
114 | let _x = a.x.x;
|
||||
| -- value moved here
|
||||
115 | //~^ value moved here
|
||||
116 | let _y = &a.y; //~ ERROR use of collaterally moved
|
||||
| ^^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
--> $DIR/borrowck-box-insensitivity.rs:116:15
|
||||
|
|
||||
LL | let _x = a.x.x;
|
||||
| -- value moved here
|
||||
LL | //~^ value moved here
|
||||
LL | let _y = &a.y; //~ ERROR use of collaterally moved
|
||||
| ^^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0505]: cannot move out of `a.y` because it is borrowed
|
||||
--> $DIR/borrowck-box-insensitivity.rs:124:9
|
||||
|
|
||||
122 | let _x = &a.x.x;
|
||||
| ----- borrow of `a.x.x` occurs here
|
||||
123 | //~^ borrow of `a.x.x` occurs here
|
||||
124 | let _y = a.y;
|
||||
| ^^ move out of `a.y` occurs here
|
||||
--> $DIR/borrowck-box-insensitivity.rs:124:9
|
||||
|
|
||||
LL | let _x = &a.x.x;
|
||||
| ----- borrow of `a.x.x` occurs here
|
||||
LL | //~^ borrow of `a.x.x` occurs here
|
||||
LL | let _y = a.y;
|
||||
| ^^ move out of `a.y` occurs here
|
||||
|
||||
error[E0503]: cannot use `a.y` because it was mutably borrowed
|
||||
--> $DIR/borrowck-box-insensitivity.rs:132:9
|
||||
|
|
||||
131 | let _x = &mut a.x.x;
|
||||
| ----- borrow of `a.x.x` occurs here
|
||||
132 | let _y = a.y; //~ ERROR cannot use
|
||||
| ^^ use of borrowed `a.x.x`
|
||||
--> $DIR/borrowck-box-insensitivity.rs:132:9
|
||||
|
|
||||
LL | let _x = &mut a.x.x;
|
||||
| ----- borrow of `a.x.x` occurs here
|
||||
LL | let _y = a.y; //~ ERROR cannot use
|
||||
| ^^ use of borrowed `a.x.x`
|
||||
|
||||
error[E0505]: cannot move out of `a.y` because it is borrowed
|
||||
--> $DIR/borrowck-box-insensitivity.rs:138:9
|
||||
|
|
||||
137 | let _x = &mut a.x.x;
|
||||
| ----- borrow of `a.x.x` occurs here
|
||||
138 | let _y = a.y;
|
||||
| ^^ move out of `a.y` occurs here
|
||||
--> $DIR/borrowck-box-insensitivity.rs:138:9
|
||||
|
|
||||
LL | let _x = &mut a.x.x;
|
||||
| ----- borrow of `a.x.x` occurs here
|
||||
LL | let _y = a.y;
|
||||
| ^^ move out of `a.y` occurs here
|
||||
|
||||
error[E0502]: cannot borrow `a.y` as immutable because `a.x.x` is also borrowed as mutable
|
||||
--> $DIR/borrowck-box-insensitivity.rs:147:15
|
||||
|
|
||||
145 | let _x = &mut a.x.x;
|
||||
| ----- mutable borrow occurs here
|
||||
146 | //~^ mutable borrow occurs here
|
||||
147 | let _y = &a.y; //~ ERROR cannot borrow
|
||||
| ^^^ immutable borrow occurs here
|
||||
148 | //~^ immutable borrow occurs here
|
||||
149 | }
|
||||
| - mutable borrow ends here
|
||||
--> $DIR/borrowck-box-insensitivity.rs:147:15
|
||||
|
|
||||
LL | let _x = &mut a.x.x;
|
||||
| ----- mutable borrow occurs here
|
||||
LL | //~^ mutable borrow occurs here
|
||||
LL | let _y = &a.y; //~ ERROR cannot borrow
|
||||
| ^^^ immutable borrow occurs here
|
||||
LL | //~^ immutable borrow occurs here
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
error[E0502]: cannot borrow `a.y` as mutable because `a.x.x` is also borrowed as immutable
|
||||
--> $DIR/borrowck-box-insensitivity.rs:155:19
|
||||
|
|
||||
153 | let _x = &a.x.x;
|
||||
| ----- immutable borrow occurs here
|
||||
154 | //~^ immutable borrow occurs here
|
||||
155 | let _y = &mut a.y; //~ ERROR cannot borrow
|
||||
| ^^^ mutable borrow occurs here
|
||||
156 | //~^ mutable borrow occurs here
|
||||
157 | }
|
||||
| - immutable borrow ends here
|
||||
--> $DIR/borrowck-box-insensitivity.rs:155:19
|
||||
|
|
||||
LL | let _x = &a.x.x;
|
||||
| ----- immutable borrow occurs here
|
||||
LL | //~^ immutable borrow occurs here
|
||||
LL | let _y = &mut a.y; //~ ERROR cannot borrow
|
||||
| ^^^ mutable borrow occurs here
|
||||
LL | //~^ mutable borrow occurs here
|
||||
LL | }
|
||||
| - immutable borrow ends here
|
||||
|
||||
error: aborting due to 16 previous errors
|
||||
|
||||
|
@ -1,151 +1,151 @@
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
|
||||
--> $DIR/borrowck-closures-two-mut.rs:24:24
|
||||
|
|
||||
23 | let c1 = to_fn_mut(|| x = 4);
|
||||
LL | let c1 = to_fn_mut(|| x = 4);
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| first mutable borrow occurs here
|
||||
24 | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
LL | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
25 | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
26 | }
|
||||
LL | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
|
||||
--> $DIR/borrowck-closures-two-mut.rs:35:24
|
||||
|
|
||||
34 | let c1 = to_fn_mut(|| set(&mut x));
|
||||
LL | let c1 = to_fn_mut(|| set(&mut x));
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| first mutable borrow occurs here
|
||||
35 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
36 | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
37 | }
|
||||
LL | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
|
||||
--> $DIR/borrowck-closures-two-mut.rs:42:24
|
||||
|
|
||||
41 | let c1 = to_fn_mut(|| x = 5);
|
||||
LL | let c1 = to_fn_mut(|| x = 5);
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| first mutable borrow occurs here
|
||||
42 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
43 | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
44 | }
|
||||
LL | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
|
||||
--> $DIR/borrowck-closures-two-mut.rs:49:24
|
||||
|
|
||||
48 | let c1 = to_fn_mut(|| x = 5);
|
||||
LL | let c1 = to_fn_mut(|| x = 5);
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| first mutable borrow occurs here
|
||||
49 | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
|
||||
LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
...
|
||||
52 | }
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
|
||||
--> $DIR/borrowck-closures-two-mut.rs:61:24
|
||||
|
|
||||
60 | let c1 = to_fn_mut(|| set(&mut *x.f));
|
||||
LL | let c1 = to_fn_mut(|| set(&mut *x.f));
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| first mutable borrow occurs here
|
||||
61 | let c2 = to_fn_mut(|| set(&mut *x.f));
|
||||
LL | let c2 = to_fn_mut(|| set(&mut *x.f));
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
...
|
||||
64 | }
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
|
||||
--> $DIR/borrowck-closures-two-mut.rs:24:24
|
||||
|
|
||||
23 | let c1 = to_fn_mut(|| x = 4);
|
||||
LL | let c1 = to_fn_mut(|| x = 4);
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| first mutable borrow occurs here
|
||||
24 | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
LL | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
25 | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
26 | }
|
||||
LL | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
|
||||
--> $DIR/borrowck-closures-two-mut.rs:35:24
|
||||
|
|
||||
34 | let c1 = to_fn_mut(|| set(&mut x));
|
||||
LL | let c1 = to_fn_mut(|| set(&mut x));
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| first mutable borrow occurs here
|
||||
35 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
36 | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
37 | }
|
||||
LL | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
|
||||
--> $DIR/borrowck-closures-two-mut.rs:42:24
|
||||
|
|
||||
41 | let c1 = to_fn_mut(|| x = 5);
|
||||
LL | let c1 = to_fn_mut(|| x = 5);
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| first mutable borrow occurs here
|
||||
42 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
43 | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
44 | }
|
||||
LL | //~| ERROR cannot borrow `x` as mutable more than once
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
|
||||
--> $DIR/borrowck-closures-two-mut.rs:49:24
|
||||
|
|
||||
48 | let c1 = to_fn_mut(|| x = 5);
|
||||
LL | let c1 = to_fn_mut(|| x = 5);
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| first mutable borrow occurs here
|
||||
49 | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
|
||||
LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
...
|
||||
52 | }
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
|
||||
--> $DIR/borrowck-closures-two-mut.rs:61:24
|
||||
|
|
||||
60 | let c1 = to_fn_mut(|| set(&mut *x.f));
|
||||
LL | let c1 = to_fn_mut(|| set(&mut *x.f));
|
||||
| -- - previous borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| first mutable borrow occurs here
|
||||
61 | let c2 = to_fn_mut(|| set(&mut *x.f));
|
||||
LL | let c2 = to_fn_mut(|| set(&mut *x.f));
|
||||
| ^^ - borrow occurs due to use of `x` in closure
|
||||
| |
|
||||
| second mutable borrow occurs here
|
||||
...
|
||||
64 | }
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
|
@ -1,13 +1,13 @@
|
||||
error[E0373]: closure may outlive the current function, but it borrows `books`, which is owned by the current function
|
||||
--> $DIR/borrowck-escaping-closure-error-1.rs:23:11
|
||||
|
|
||||
23 | spawn(|| books.push(4));
|
||||
LL | spawn(|| books.push(4));
|
||||
| ^^ ----- `books` is borrowed here
|
||||
| |
|
||||
| may outlive borrowed value `books`
|
||||
help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword
|
||||
|
|
||||
23 | spawn(move || books.push(4));
|
||||
LL | spawn(move || books.push(4));
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,13 +1,13 @@
|
||||
error[E0373]: closure may outlive the current function, but it borrows `books`, which is owned by the current function
|
||||
--> $DIR/borrowck-escaping-closure-error-2.rs:21:14
|
||||
|
|
||||
21 | Box::new(|| books.push(4))
|
||||
LL | Box::new(|| books.push(4))
|
||||
| ^^ ----- `books` is borrowed here
|
||||
| |
|
||||
| may outlive borrowed value `books`
|
||||
help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword
|
||||
|
|
||||
21 | Box::new(move || books.push(4))
|
||||
LL | Box::new(move || books.push(4))
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,9 +1,9 @@
|
||||
error[E0507]: cannot move out of captured outer variable in an `Fn` closure
|
||||
--> $DIR/borrowck-in-static.rs:15:17
|
||||
|
|
||||
14 | let x = Box::new(0);
|
||||
LL | let x = Box::new(0);
|
||||
| - captured outer variable
|
||||
15 | Box::new(|| x) //~ ERROR cannot move out of captured outer variable
|
||||
LL | Box::new(|| x) //~ ERROR cannot move out of captured outer variable
|
||||
| ^ cannot move out of captured outer variable in an `Fn` closure
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,35 +1,35 @@
|
||||
error[E0507]: cannot move out of borrowed content
|
||||
--> $DIR/borrowck-move-error-with-note.rs:21:11
|
||||
|
|
||||
21 | match *f { //~ ERROR cannot move out of
|
||||
LL | match *f { //~ ERROR cannot move out of
|
||||
| ^^ cannot move out of borrowed content
|
||||
22 | //~| cannot move out
|
||||
23 | Foo::Foo1(num1,
|
||||
LL | //~| cannot move out
|
||||
LL | Foo::Foo1(num1,
|
||||
| ---- hint: to prevent move, use `ref num1` or `ref mut num1`
|
||||
24 | num2) => (),
|
||||
LL | num2) => (),
|
||||
| ---- ...and here (use `ref num2` or `ref mut num2`)
|
||||
25 | Foo::Foo2(num) => (),
|
||||
LL | Foo::Foo2(num) => (),
|
||||
| --- ...and here (use `ref num` or `ref mut num`)
|
||||
|
||||
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
|
||||
--> $DIR/borrowck-move-error-with-note.rs:40:9
|
||||
|
|
||||
40 | / S { //~ ERROR cannot move out of type `S`, which implements the `Drop` trait
|
||||
41 | | //~| cannot move out of here
|
||||
42 | | f: _s,
|
||||
LL | / S { //~ ERROR cannot move out of type `S`, which implements the `Drop` trait
|
||||
LL | | //~| cannot move out of here
|
||||
LL | | f: _s,
|
||||
| | -- hint: to prevent move, use `ref _s` or `ref mut _s`
|
||||
43 | | g: _t
|
||||
LL | | g: _t
|
||||
| | -- ...and here (use `ref _t` or `ref mut _t`)
|
||||
44 | | } => {}
|
||||
LL | | } => {}
|
||||
| |_________^ cannot move out of here
|
||||
|
||||
error[E0507]: cannot move out of borrowed content
|
||||
--> $DIR/borrowck-move-error-with-note.rs:57:11
|
||||
|
|
||||
57 | match a.a { //~ ERROR cannot move out of
|
||||
LL | match a.a { //~ ERROR cannot move out of
|
||||
| ^ cannot move out of borrowed content
|
||||
58 | //~| cannot move out
|
||||
59 | n => {
|
||||
LL | //~| cannot move out
|
||||
LL | n => {
|
||||
| - hint: to prevent move, use `ref n` or `ref mut n`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
@ -1,14 +1,14 @@
|
||||
error[E0508]: cannot move out of type `[Foo]`, a non-copy slice
|
||||
--> $DIR/borrowck-move-out-of-vec-tail.rs:30:18
|
||||
|
|
||||
30 | &[Foo { string: a },
|
||||
LL | &[Foo { string: a },
|
||||
| ^ - hint: to prevent move, use `ref a` or `ref mut a`
|
||||
| __________________|
|
||||
| |
|
||||
31 | | //~^ ERROR cannot move out of type `[Foo]`
|
||||
32 | | //~| cannot move out
|
||||
33 | | //~| to prevent move
|
||||
34 | | Foo { string: b }] => {
|
||||
LL | | //~^ ERROR cannot move out of type `[Foo]`
|
||||
LL | | //~| cannot move out
|
||||
LL | | //~| to prevent move
|
||||
LL | | Foo { string: b }] => {
|
||||
| |_________________________________-__^ cannot move out of here
|
||||
| |
|
||||
| ...and here (use `ref b` or `ref mut b`)
|
||||
|
@ -1,9 +1,9 @@
|
||||
error[E0382]: use of moved value: `x` (Ast)
|
||||
--> $DIR/borrowck-reinit.rs:18:16
|
||||
|
|
||||
17 | drop(x);
|
||||
LL | drop(x);
|
||||
| - value moved here
|
||||
18 | let _ = (1,x); //~ ERROR use of moved value: `x` (Ast)
|
||||
LL | let _ = (1,x); //~ ERROR use of moved value: `x` (Ast)
|
||||
| ^ value used here after move
|
||||
|
|
||||
= note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
|
||||
@ -11,9 +11,9 @@ error[E0382]: use of moved value: `x` (Ast)
|
||||
error[E0382]: use of moved value: `x` (Mir)
|
||||
--> $DIR/borrowck-reinit.rs:18:16
|
||||
|
|
||||
17 | drop(x);
|
||||
LL | drop(x);
|
||||
| - value moved here
|
||||
18 | let _ = (1,x); //~ ERROR use of moved value: `x` (Ast)
|
||||
LL | let _ = (1,x); //~ ERROR use of moved value: `x` (Ast)
|
||||
| ^ value used here after move
|
||||
|
|
||||
= note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
|
||||
|
@ -1,37 +1,37 @@
|
||||
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
|
||||
--> $DIR/borrowck-report-with-custom-diagnostic.rs:17:14
|
||||
|
|
||||
15 | let y = &mut x;
|
||||
LL | let y = &mut x;
|
||||
| - mutable borrow occurs here
|
||||
16 | //~^ mutable borrow occurs here
|
||||
17 | let z = &x; //~ ERROR cannot borrow
|
||||
LL | //~^ mutable borrow occurs here
|
||||
LL | let z = &x; //~ ERROR cannot borrow
|
||||
| ^ immutable borrow occurs here
|
||||
18 | //~^ immutable borrow occurs here
|
||||
19 | }
|
||||
LL | //~^ immutable borrow occurs here
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
|
||||
--> $DIR/borrowck-report-with-custom-diagnostic.rs:28:26
|
||||
|
|
||||
26 | let y = &x;
|
||||
LL | let y = &x;
|
||||
| - immutable borrow occurs here
|
||||
27 | //~^ immutable borrow occurs here
|
||||
28 | let z = &mut x; //~ ERROR cannot borrow
|
||||
LL | //~^ immutable borrow occurs here
|
||||
LL | let z = &mut x; //~ ERROR cannot borrow
|
||||
| ^ mutable borrow occurs here
|
||||
29 | //~^ mutable borrow occurs here
|
||||
30 | }
|
||||
LL | //~^ mutable borrow occurs here
|
||||
LL | }
|
||||
| - immutable borrow ends here
|
||||
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
--> $DIR/borrowck-report-with-custom-diagnostic.rs:41:22
|
||||
|
|
||||
39 | let y = &mut x;
|
||||
LL | let y = &mut x;
|
||||
| - first mutable borrow occurs here
|
||||
40 | //~^ first mutable borrow occurs here
|
||||
41 | let z = &mut x; //~ ERROR cannot borrow
|
||||
LL | //~^ first mutable borrow occurs here
|
||||
LL | let z = &mut x; //~ ERROR cannot borrow
|
||||
| ^ second mutable borrow occurs here
|
||||
42 | //~^ second mutable borrow occurs here
|
||||
43 | };
|
||||
LL | //~^ second mutable borrow occurs here
|
||||
LL | };
|
||||
| - first borrow ends here
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
@ -1,38 +1,38 @@
|
||||
error[E0506]: cannot assign to `vec[..]` because it is borrowed
|
||||
--> $DIR/borrowck-vec-pattern-nesting.rs:21:13
|
||||
|
|
||||
19 | [box ref _a, _, _] => {
|
||||
LL | [box ref _a, _, _] => {
|
||||
| ------ borrow of `vec[..]` occurs here
|
||||
20 | //~^ borrow of `vec[..]` occurs here
|
||||
21 | vec[0] = box 4; //~ ERROR cannot assign
|
||||
LL | //~^ borrow of `vec[..]` occurs here
|
||||
LL | vec[0] = box 4; //~ ERROR cannot assign
|
||||
| ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here
|
||||
|
||||
error[E0506]: cannot assign to `vec[..]` because it is borrowed
|
||||
--> $DIR/borrowck-vec-pattern-nesting.rs:33:13
|
||||
|
|
||||
31 | &mut [ref _b..] => {
|
||||
LL | &mut [ref _b..] => {
|
||||
| ------ borrow of `vec[..]` occurs here
|
||||
32 | //~^ borrow of `vec[..]` occurs here
|
||||
33 | vec[0] = box 4; //~ ERROR cannot assign
|
||||
LL | //~^ borrow of `vec[..]` occurs here
|
||||
LL | vec[0] = box 4; //~ ERROR cannot assign
|
||||
| ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here
|
||||
|
||||
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
||||
--> $DIR/borrowck-vec-pattern-nesting.rs:43:14
|
||||
|
|
||||
43 | &mut [_a, //~ ERROR cannot move out
|
||||
LL | &mut [_a, //~ ERROR cannot move out
|
||||
| ^-- hint: to prevent move, use `ref _a` or `ref mut _a`
|
||||
| ______________|
|
||||
| |
|
||||
44 | | //~| cannot move out
|
||||
45 | | //~| to prevent move
|
||||
46 | | ..
|
||||
47 | | ] => {
|
||||
LL | | //~| cannot move out
|
||||
LL | | //~| to prevent move
|
||||
LL | | ..
|
||||
LL | | ] => {
|
||||
| |_________^ cannot move out of here
|
||||
|
||||
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
||||
--> $DIR/borrowck-vec-pattern-nesting.rs:56:13
|
||||
|
|
||||
56 | let a = vec[0]; //~ ERROR cannot move out
|
||||
LL | let a = vec[0]; //~ ERROR cannot move out
|
||||
| ^^^^^^
|
||||
| |
|
||||
| cannot move out of here
|
||||
@ -41,10 +41,10 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli
|
||||
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
||||
--> $DIR/borrowck-vec-pattern-nesting.rs:64:14
|
||||
|
|
||||
64 | &mut [ //~ ERROR cannot move out
|
||||
LL | &mut [ //~ ERROR cannot move out
|
||||
| ______________^
|
||||
65 | | //~^ cannot move out
|
||||
66 | | _b] => {}
|
||||
LL | | //~^ cannot move out
|
||||
LL | | _b] => {}
|
||||
| |__________--^ cannot move out of here
|
||||
| |
|
||||
| hint: to prevent move, use `ref _b` or `ref mut _b`
|
||||
@ -52,7 +52,7 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli
|
||||
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
||||
--> $DIR/borrowck-vec-pattern-nesting.rs:69:13
|
||||
|
|
||||
69 | let a = vec[0]; //~ ERROR cannot move out
|
||||
LL | let a = vec[0]; //~ ERROR cannot move out
|
||||
| ^^^^^^
|
||||
| |
|
||||
| cannot move out of here
|
||||
@ -61,7 +61,7 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli
|
||||
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
||||
--> $DIR/borrowck-vec-pattern-nesting.rs:77:14
|
||||
|
|
||||
77 | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
|
||||
LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
|
||||
| ^--^^--^^--^
|
||||
| || | |
|
||||
| || | ...and here (use `ref _c` or `ref mut _c`)
|
||||
@ -72,7 +72,7 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli
|
||||
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
||||
--> $DIR/borrowck-vec-pattern-nesting.rs:81:13
|
||||
|
|
||||
81 | let a = vec[0]; //~ ERROR cannot move out
|
||||
LL | let a = vec[0]; //~ ERROR cannot move out
|
||||
| ^^^^^^
|
||||
| |
|
||||
| cannot move out of here
|
||||
|
@ -1,17 +1,17 @@
|
||||
error[E0384]: cannot assign twice to immutable variable `_x` (Ast)
|
||||
--> $DIR/immutable-arg.rs:14:5
|
||||
|
|
||||
13 | fn foo(_x: u32) {
|
||||
LL | fn foo(_x: u32) {
|
||||
| -- first assignment to `_x`
|
||||
14 | _x = 4;
|
||||
LL | _x = 4;
|
||||
| ^^^^^^ cannot assign twice to immutable variable
|
||||
|
||||
error[E0384]: cannot assign to immutable argument `_x` (Mir)
|
||||
--> $DIR/immutable-arg.rs:14:5
|
||||
|
|
||||
13 | fn foo(_x: u32) {
|
||||
LL | fn foo(_x: u32) {
|
||||
| -- argument not declared as `mut`
|
||||
14 | _x = 4;
|
||||
LL | _x = 4;
|
||||
| ^^^^^^ cannot assign to immutable argument
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0382]: use of partially moved value: `maybe` (Ast)
|
||||
--> $DIR/issue-41962.rs:17:30
|
||||
|
|
||||
17 | if let Some(thing) = maybe {
|
||||
LL | if let Some(thing) = maybe {
|
||||
| ----- ^^^^^ value used here after move
|
||||
| |
|
||||
| value moved here
|
||||
@ -11,7 +11,7 @@ error[E0382]: use of partially moved value: `maybe` (Ast)
|
||||
error[E0382]: use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast)
|
||||
--> $DIR/issue-41962.rs:17:21
|
||||
|
|
||||
17 | if let Some(thing) = maybe {
|
||||
LL | if let Some(thing) = maybe {
|
||||
| ^^^^^ value moved here in previous iteration of loop
|
||||
|
|
||||
= note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
|
||||
@ -19,16 +19,16 @@ error[E0382]: use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast)
|
||||
error[E0382]: use of moved value: `maybe` (Mir)
|
||||
--> $DIR/issue-41962.rs:17:9
|
||||
|
|
||||
17 | if let Some(thing) = maybe {
|
||||
LL | if let Some(thing) = maybe {
|
||||
| ^ ----- value moved here
|
||||
| _________|
|
||||
| |
|
||||
18 | | //~^ ERROR use of partially moved value: `maybe` (Ast) [E0382]
|
||||
19 | | //~| ERROR use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast) [E0382]
|
||||
20 | | //~| ERROR use of moved value: `maybe` (Mir) [E0382]
|
||||
21 | | //~| ERROR use of moved value: `maybe` (Mir) [E0382]
|
||||
22 | | //~| ERROR use of moved value: `maybe.0` (Mir) [E0382]
|
||||
23 | | }
|
||||
LL | | //~^ ERROR use of partially moved value: `maybe` (Ast) [E0382]
|
||||
LL | | //~| ERROR use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast) [E0382]
|
||||
LL | | //~| ERROR use of moved value: `maybe` (Mir) [E0382]
|
||||
LL | | //~| ERROR use of moved value: `maybe` (Mir) [E0382]
|
||||
LL | | //~| ERROR use of moved value: `maybe.0` (Mir) [E0382]
|
||||
LL | | }
|
||||
| |_________^ value used here after move
|
||||
|
|
||||
= note: move occurs because `maybe` has type `std::option::Option<std::vec::Vec<bool>>`, which does not implement the `Copy` trait
|
||||
@ -36,7 +36,7 @@ error[E0382]: use of moved value: `maybe` (Mir)
|
||||
error[E0382]: use of moved value: `maybe` (Mir)
|
||||
--> $DIR/issue-41962.rs:17:16
|
||||
|
|
||||
17 | if let Some(thing) = maybe {
|
||||
LL | if let Some(thing) = maybe {
|
||||
| ^^^^^-----^
|
||||
| | |
|
||||
| | value moved here
|
||||
@ -47,7 +47,7 @@ error[E0382]: use of moved value: `maybe` (Mir)
|
||||
error[E0382]: use of moved value: `maybe.0` (Mir)
|
||||
--> $DIR/issue-41962.rs:17:21
|
||||
|
|
||||
17 | if let Some(thing) = maybe {
|
||||
LL | if let Some(thing) = maybe {
|
||||
| ^^^^^ value moved here in previous iteration of loop
|
||||
|
|
||||
= note: move occurs because `maybe.0` has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
|
||||
|
@ -1,9 +1,9 @@
|
||||
error: borrowed data cannot be stored outside of its closure
|
||||
--> $DIR/issue-45983.rs:17:27
|
||||
|
|
||||
16 | let x = None;
|
||||
LL | let x = None;
|
||||
| - borrowed data cannot be stored into here...
|
||||
17 | give_any(|y| x = Some(y));
|
||||
LL | give_any(|y| x = Some(y));
|
||||
| --- ^ cannot be stored outside of its closure
|
||||
| |
|
||||
| ...because it cannot outlive this closure
|
||||
|
@ -1,15 +1,15 @@
|
||||
error: borrowed data cannot be stored outside of its closure
|
||||
--> $DIR/issue-7573.rs:32:27
|
||||
|
|
||||
27 | let mut lines_to_use: Vec<&CrateId> = Vec::new();
|
||||
LL | let mut lines_to_use: Vec<&CrateId> = Vec::new();
|
||||
| - cannot infer an appropriate lifetime...
|
||||
28 | //~^ NOTE cannot infer an appropriate lifetime
|
||||
29 | let push_id = |installed_id: &CrateId| {
|
||||
LL | //~^ NOTE cannot infer an appropriate lifetime
|
||||
LL | let push_id = |installed_id: &CrateId| {
|
||||
| ------- ------------------------ borrowed data cannot outlive this closure
|
||||
| |
|
||||
| ...so that variable is valid at time of its declaration
|
||||
...
|
||||
32 | lines_to_use.push(installed_id);
|
||||
LL | lines_to_use.push(installed_id);
|
||||
| ^^^^^^^^^^^^ cannot be stored outside of its closure
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,28 +1,28 @@
|
||||
error[E0499]: cannot borrow `*arg` as mutable more than once at a time
|
||||
--> $DIR/mut-borrow-in-loop.rs:20:25
|
||||
|
|
||||
20 | (self.func)(arg) //~ ERROR cannot borrow
|
||||
LL | (self.func)(arg) //~ ERROR cannot borrow
|
||||
| ^^^ mutable borrow starts here in previous iteration of loop
|
||||
21 | }
|
||||
22 | }
|
||||
LL | }
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
error[E0499]: cannot borrow `*arg` as mutable more than once at a time
|
||||
--> $DIR/mut-borrow-in-loop.rs:26:25
|
||||
|
|
||||
26 | (self.func)(arg) //~ ERROR cannot borrow
|
||||
LL | (self.func)(arg) //~ ERROR cannot borrow
|
||||
| ^^^ mutable borrow starts here in previous iteration of loop
|
||||
27 | }
|
||||
28 | }
|
||||
LL | }
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
error[E0499]: cannot borrow `*arg` as mutable more than once at a time
|
||||
--> $DIR/mut-borrow-in-loop.rs:33:25
|
||||
|
|
||||
33 | (self.func)(arg) //~ ERROR cannot borrow
|
||||
LL | (self.func)(arg) //~ ERROR cannot borrow
|
||||
| ^^^ mutable borrow starts here in previous iteration of loop
|
||||
34 | }
|
||||
35 | }
|
||||
LL | }
|
||||
LL | }
|
||||
| - mutable borrow ends here
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
@ -1,22 +1,22 @@
|
||||
error[E0499]: cannot borrow `void` as mutable more than once at a time
|
||||
--> $DIR/mut-borrow-outside-loop.rs:17:23
|
||||
|
|
||||
16 | let first = &mut void;
|
||||
LL | let first = &mut void;
|
||||
| ---- first mutable borrow occurs here
|
||||
17 | let second = &mut void; //~ ERROR cannot borrow
|
||||
LL | let second = &mut void; //~ ERROR cannot borrow
|
||||
| ^^^^ second mutable borrow occurs here
|
||||
...
|
||||
25 | }
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
error[E0499]: cannot borrow `inner_void` as mutable more than once at a time
|
||||
--> $DIR/mut-borrow-outside-loop.rs:23:33
|
||||
|
|
||||
22 | let inner_first = &mut inner_void;
|
||||
LL | let inner_first = &mut inner_void;
|
||||
| ---------- first mutable borrow occurs here
|
||||
23 | let inner_second = &mut inner_void; //~ ERROR cannot borrow
|
||||
LL | let inner_second = &mut inner_void; //~ ERROR cannot borrow
|
||||
| ^^^^^^^^^^ second mutable borrow occurs here
|
||||
24 | }
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -1,25 +1,25 @@
|
||||
error[E0195]: lifetime parameters or bounds on method `no_bound` do not match the trait declaration
|
||||
--> $DIR/regions-bound-missing-bound-in-impl.rs:28:5
|
||||
|
|
||||
20 | fn no_bound<'b>(self, b: Inv<'b>);
|
||||
LL | fn no_bound<'b>(self, b: Inv<'b>);
|
||||
| ---------------------------------- lifetimes in impl do not match this method in trait
|
||||
...
|
||||
28 | fn no_bound<'b:'a>(self, b: Inv<'b>) {
|
||||
LL | fn no_bound<'b:'a>(self, b: Inv<'b>) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetimes do not match method in trait
|
||||
|
||||
error[E0195]: lifetime parameters or bounds on method `has_bound` do not match the trait declaration
|
||||
--> $DIR/regions-bound-missing-bound-in-impl.rs:32:5
|
||||
|
|
||||
21 | fn has_bound<'b:'a>(self, b: Inv<'b>);
|
||||
LL | fn has_bound<'b:'a>(self, b: Inv<'b>);
|
||||
| -------------------------------------- lifetimes in impl do not match this method in trait
|
||||
...
|
||||
32 | fn has_bound<'b>(self, b: Inv<'b>) {
|
||||
LL | fn has_bound<'b>(self, b: Inv<'b>) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetimes do not match method in trait
|
||||
|
||||
error[E0308]: method not compatible with trait
|
||||
--> $DIR/regions-bound-missing-bound-in-impl.rs:36:5
|
||||
|
|
||||
36 | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
|
||||
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
||||
|
|
||||
= note: expected type `fn(&'a isize, Inv<'c>, Inv<'c>, Inv<'d>)`
|
||||
@ -27,21 +27,21 @@ error[E0308]: method not compatible with trait
|
||||
note: the lifetime 'c as defined on the method body at 36:5...
|
||||
--> $DIR/regions-bound-missing-bound-in-impl.rs:36:5
|
||||
|
|
||||
36 | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
|
||||
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: ...does not necessarily outlive the lifetime 'c as defined on the method body at 36:5
|
||||
--> $DIR/regions-bound-missing-bound-in-impl.rs:36:5
|
||||
|
|
||||
36 | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
|
||||
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0276]: impl has stricter requirements than trait
|
||||
--> $DIR/regions-bound-missing-bound-in-impl.rs:53:5
|
||||
|
|
||||
24 | fn another_bound<'x: 'a>(self, x: Inv<'x>, y: Inv<'t>);
|
||||
LL | fn another_bound<'x: 'a>(self, x: Inv<'x>, y: Inv<'t>);
|
||||
| ------------------------------------------------------- definition of `another_bound` from trait
|
||||
...
|
||||
53 | fn another_bound<'x: 't>(self, x: Inv<'x>, y: Inv<'t>) {
|
||||
LL | fn another_bound<'x: 't>(self, x: Inv<'x>, y: Inv<'t>) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'x: 't`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
@ -1,9 +1,9 @@
|
||||
error: borrowed data cannot be stored outside of its closure
|
||||
--> $DIR/regions-escape-bound-fn-2.rs:18:27
|
||||
|
|
||||
17 | let mut x = None;
|
||||
LL | let mut x = None;
|
||||
| ----- borrowed data cannot be stored into here...
|
||||
18 | with_int(|y| x = Some(y));
|
||||
LL | with_int(|y| x = Some(y));
|
||||
| --- ^ cannot be stored outside of its closure
|
||||
| |
|
||||
| ...because it cannot outlive this closure
|
||||
|
@ -1,9 +1,9 @@
|
||||
error: borrowed data cannot be stored outside of its closure
|
||||
--> $DIR/regions-escape-bound-fn.rs:18:27
|
||||
|
|
||||
17 | let mut x: Option<&isize> = None;
|
||||
LL | let mut x: Option<&isize> = None;
|
||||
| ----- borrowed data cannot be stored into here...
|
||||
18 | with_int(|y| x = Some(y));
|
||||
LL | with_int(|y| x = Some(y));
|
||||
| --- ^ cannot be stored outside of its closure
|
||||
| |
|
||||
| ...because it cannot outlive this closure
|
||||
|
@ -1,9 +1,9 @@
|
||||
error: borrowed data cannot be stored outside of its closure
|
||||
--> $DIR/regions-escape-unboxed-closure.rs:16:32
|
||||
|
|
||||
15 | let mut x: Option<&isize> = None;
|
||||
LL | let mut x: Option<&isize> = None;
|
||||
| ----- borrowed data cannot be stored into here...
|
||||
16 | with_int(&mut |y| x = Some(y));
|
||||
LL | with_int(&mut |y| x = Some(y));
|
||||
| --- ^ cannot be stored outside of its closure
|
||||
| |
|
||||
| ...because it cannot outlive this closure
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0507]: cannot move out of captured outer variable in an `Fn` closure
|
||||
--> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:21:9
|
||||
|
|
||||
19 | let y = vec![format!("World")];
|
||||
LL | let y = vec![format!("World")];
|
||||
| - captured outer variable
|
||||
20 | call(|| {
|
||||
21 | y.into_iter();
|
||||
LL | call(|| {
|
||||
LL | y.into_iter();
|
||||
| ^ cannot move out of captured outer variable in an `Fn` closure
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0054]: cannot cast as `bool`
|
||||
--> $DIR/cast-as-bool.rs:12:13
|
||||
|
|
||||
12 | let u = 5 as bool;
|
||||
LL | let u = 5 as bool;
|
||||
| ^^^^^^^^^ unsupported cast
|
||||
|
|
||||
= help: compare with zero instead
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0425]: cannot find value `error` in this scope
|
||||
--> $DIR/cast-errors-issue-43825.rs:12:17
|
||||
|
|
||||
12 | let error = error; //~ ERROR cannot find value `error`
|
||||
LL | let error = error; //~ ERROR cannot find value `error`
|
||||
| ^^^^^ not found in this scope
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0054]: cannot cast as `bool`
|
||||
--> $DIR/cast-rfc0401-2.rs:16:13
|
||||
|
|
||||
16 | let _ = 3 as bool;
|
||||
LL | let _ = 3 as bool;
|
||||
| ^^^^^^^^^ unsupported cast
|
||||
|
|
||||
= help: compare with zero instead
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0620]: cast to unsized type: `&{integer}` as `std::marker::Send`
|
||||
--> $DIR/cast-to-unsized-trait-object-suggestion.rs:12:5
|
||||
|
|
||||
12 | &1 as Send; //~ ERROR cast to unsized
|
||||
LL | &1 as Send; //~ ERROR cast to unsized
|
||||
| ^^^^^^----
|
||||
| |
|
||||
| help: try casting to a reference instead: `&Send`
|
||||
@ -9,7 +9,7 @@ error[E0620]: cast to unsized type: `&{integer}` as `std::marker::Send`
|
||||
error[E0620]: cast to unsized type: `std::boxed::Box<{integer}>` as `std::marker::Send`
|
||||
--> $DIR/cast-to-unsized-trait-object-suggestion.rs:13:5
|
||||
|
|
||||
13 | Box::new(1) as Send; //~ ERROR cast to unsized
|
||||
LL | Box::new(1) as Send; //~ ERROR cast to unsized
|
||||
| ^^^^^^^^^^^^^^^----
|
||||
| |
|
||||
| help: try casting to a `Box` instead: `Box<Send>`
|
||||
|
@ -1,19 +1,19 @@
|
||||
error: only u8 can be casted into char
|
||||
--> $DIR/cast_char.rs:14:23
|
||||
|
|
||||
14 | const XYZ: char = 0x1F888 as char;
|
||||
LL | const XYZ: char = 0x1F888 as char;
|
||||
| ^^^^^^^^^^^^^^^ help: use a char literal instead: `'/u{1F888}'`
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/cast_char.rs:11:9
|
||||
|
|
||||
11 | #![deny(overflowing_literals)]
|
||||
LL | #![deny(overflowing_literals)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: only u8 can be casted into char
|
||||
--> $DIR/cast_char.rs:16:22
|
||||
|
|
||||
16 | const XY: char = 129160 as char;
|
||||
LL | const XY: char = 129160 as char;
|
||||
| ^^^^^^^^^^^^^^ help: use a char literal instead: `'/u{1F888}'`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0606]: casting `*mut impl std::fmt::Debug+?Sized` as `*mut impl std::fmt::Debug+?Sized` is invalid
|
||||
--> $DIR/casts-differing-anon.rs:33:13
|
||||
|
|
||||
33 | b_raw = f_raw as *mut _; //~ ERROR is invalid
|
||||
LL | b_raw = f_raw as *mut _; //~ ERROR is invalid
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: vtable kinds may not match
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0412]: cannot find type `Ipsum` in this scope
|
||||
--> $DIR/casts-issue-46365.rs:12:12
|
||||
|
|
||||
12 | ipsum: Ipsum //~ ERROR cannot find type `Ipsum`
|
||||
LL | ipsum: Ipsum //~ ERROR cannot find type `Ipsum`
|
||||
| ^^^^^ not found in this scope
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0460]: found possibly newer version of crate `a` which `b` depends on
|
||||
--> $DIR/changing-crates.rs:20:1
|
||||
|
|
||||
20 | extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
|
||||
LL | extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: perhaps that crate needs to be recompiled?
|
||||
|
@ -1,49 +1,49 @@
|
||||
error[E0004]: non-exhaustive patterns: `(B, _)`, `(C, _)`, `(D, _)` and 2 more not covered
|
||||
--> $DIR/issue-35609.rs:20:11
|
||||
|
|
||||
20 | match (A, ()) { //~ ERROR non-exhaustive
|
||||
LL | match (A, ()) { //~ ERROR non-exhaustive
|
||||
| ^^^^^^^ patterns `(B, _)`, `(C, _)`, `(D, _)` and 2 more not covered
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `(_, B)`, `(_, C)`, `(_, D)` and 2 more not covered
|
||||
--> $DIR/issue-35609.rs:24:11
|
||||
|
|
||||
24 | match (A, A) { //~ ERROR non-exhaustive
|
||||
LL | match (A, A) { //~ ERROR non-exhaustive
|
||||
| ^^^^^^ patterns `(_, B)`, `(_, C)`, `(_, D)` and 2 more not covered
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
|
||||
--> $DIR/issue-35609.rs:28:11
|
||||
|
|
||||
28 | match ((A, ()), ()) { //~ ERROR non-exhaustive
|
||||
LL | match ((A, ()), ()) { //~ ERROR non-exhaustive
|
||||
| ^^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
|
||||
--> $DIR/issue-35609.rs:32:11
|
||||
|
|
||||
32 | match ((A, ()), A) { //~ ERROR non-exhaustive
|
||||
LL | match ((A, ()), A) { //~ ERROR non-exhaustive
|
||||
| ^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
|
||||
--> $DIR/issue-35609.rs:36:11
|
||||
|
|
||||
36 | match ((A, ()), ()) { //~ ERROR non-exhaustive
|
||||
LL | match ((A, ()), ()) { //~ ERROR non-exhaustive
|
||||
| ^^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `S(B, _)`, `S(C, _)`, `S(D, _)` and 2 more not covered
|
||||
--> $DIR/issue-35609.rs:41:11
|
||||
|
|
||||
41 | match S(A, ()) { //~ ERROR non-exhaustive
|
||||
LL | match S(A, ()) { //~ ERROR non-exhaustive
|
||||
| ^^^^^^^^ patterns `S(B, _)`, `S(C, _)`, `S(D, _)` and 2 more not covered
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `Sd { x: B, .. }`, `Sd { x: C, .. }`, `Sd { x: D, .. }` and 2 more not covered
|
||||
--> $DIR/issue-35609.rs:45:11
|
||||
|
|
||||
45 | match (Sd { x: A, y: () }) { //~ ERROR non-exhaustive
|
||||
LL | match (Sd { x: A, y: () }) { //~ ERROR non-exhaustive
|
||||
| ^^^^^^^^^^^^^^^^^^^^ patterns `Sd { x: B, .. }`, `Sd { x: C, .. }`, `Sd { x: D, .. }` and 2 more not covered
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered
|
||||
--> $DIR/issue-35609.rs:49:11
|
||||
|
|
||||
49 | match Some(A) { //~ ERROR non-exhaustive
|
||||
LL | match Some(A) { //~ ERROR non-exhaustive
|
||||
| ^^^^^^^ patterns `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
@ -1,24 +1,24 @@
|
||||
warning: unreachable pattern
|
||||
--> $DIR/issue-43253.rs:39:9
|
||||
|
|
||||
39 | 9 => {},
|
||||
LL | 9 => {},
|
||||
| ^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/issue-43253.rs:14:9
|
||||
|
|
||||
14 | #![warn(unreachable_patterns)]
|
||||
LL | #![warn(unreachable_patterns)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: unreachable pattern
|
||||
--> $DIR/issue-43253.rs:45:9
|
||||
|
|
||||
45 | 8...9 => {},
|
||||
LL | 8...9 => {},
|
||||
| ^^^^^
|
||||
|
||||
warning: unreachable pattern
|
||||
--> $DIR/issue-43253.rs:51:9
|
||||
|
|
||||
51 | 9...9 => {},
|
||||
LL | 9...9 => {},
|
||||
| ^^^^^
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
error: borrowed data cannot be stored outside of its closure
|
||||
--> $DIR/expect-region-supply-region.rs:28:18
|
||||
|
|
||||
26 | let mut f: Option<&u32> = None;
|
||||
LL | let mut f: Option<&u32> = None;
|
||||
| ----- borrowed data cannot be stored into here...
|
||||
27 | closure_expecting_bound(|x| {
|
||||
LL | closure_expecting_bound(|x| {
|
||||
| --- ...because it cannot outlive this closure
|
||||
28 | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
|
||||
LL | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
|
||||
| ^ cannot be stored outside of its closure
|
||||
|
||||
error: borrowed data cannot be stored outside of its closure
|
||||
--> $DIR/expect-region-supply-region.rs:38:18
|
||||
|
|
||||
36 | let mut f: Option<&u32> = None;
|
||||
LL | let mut f: Option<&u32> = None;
|
||||
| ----- borrowed data cannot be stored into here...
|
||||
37 | closure_expecting_bound(|x: &u32| {
|
||||
LL | closure_expecting_bound(|x: &u32| {
|
||||
| --------- ...because it cannot outlive this closure
|
||||
38 | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
|
||||
LL | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
|
||||
| ^ cannot be stored outside of its closure
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/expect-region-supply-region.rs:47:33
|
||||
|
|
||||
47 | closure_expecting_bound(|x: &'x u32| {
|
||||
LL | closure_expecting_bound(|x: &'x u32| {
|
||||
| ^^^^^^^ lifetime mismatch
|
||||
|
|
||||
= note: expected type `&u32`
|
||||
@ -29,25 +29,25 @@ error[E0308]: mismatched types
|
||||
note: the anonymous lifetime #2 defined on the body at 47:29...
|
||||
--> $DIR/expect-region-supply-region.rs:47:29
|
||||
|
|
||||
47 | closure_expecting_bound(|x: &'x u32| {
|
||||
LL | closure_expecting_bound(|x: &'x u32| {
|
||||
| _____________________________^
|
||||
48 | | //~^ ERROR mismatched types
|
||||
49 | | //~| ERROR mismatched types
|
||||
50 | |
|
||||
LL | | //~^ ERROR mismatched types
|
||||
LL | | //~| ERROR mismatched types
|
||||
LL | |
|
||||
... |
|
||||
53 | | //~^ ERROR borrowed data cannot be stored outside of its closure
|
||||
54 | | });
|
||||
LL | | //~^ ERROR borrowed data cannot be stored outside of its closure
|
||||
LL | | });
|
||||
| |_____^
|
||||
note: ...does not necessarily outlive the lifetime 'x as defined on the function body at 42:1
|
||||
--> $DIR/expect-region-supply-region.rs:42:1
|
||||
|
|
||||
42 | fn expect_bound_supply_named<'x>() {
|
||||
LL | fn expect_bound_supply_named<'x>() {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/expect-region-supply-region.rs:47:33
|
||||
|
|
||||
47 | closure_expecting_bound(|x: &'x u32| {
|
||||
LL | closure_expecting_bound(|x: &'x u32| {
|
||||
| ^^^^^^^ lifetime mismatch
|
||||
|
|
||||
= note: expected type `&u32`
|
||||
@ -55,31 +55,31 @@ error[E0308]: mismatched types
|
||||
note: the lifetime 'x as defined on the function body at 42:1...
|
||||
--> $DIR/expect-region-supply-region.rs:42:1
|
||||
|
|
||||
42 | fn expect_bound_supply_named<'x>() {
|
||||
LL | fn expect_bound_supply_named<'x>() {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: ...does not necessarily outlive the anonymous lifetime #2 defined on the body at 47:29
|
||||
--> $DIR/expect-region-supply-region.rs:47:29
|
||||
|
|
||||
47 | closure_expecting_bound(|x: &'x u32| {
|
||||
LL | closure_expecting_bound(|x: &'x u32| {
|
||||
| _____________________________^
|
||||
48 | | //~^ ERROR mismatched types
|
||||
49 | | //~| ERROR mismatched types
|
||||
50 | |
|
||||
LL | | //~^ ERROR mismatched types
|
||||
LL | | //~| ERROR mismatched types
|
||||
LL | |
|
||||
... |
|
||||
53 | | //~^ ERROR borrowed data cannot be stored outside of its closure
|
||||
54 | | });
|
||||
LL | | //~^ ERROR borrowed data cannot be stored outside of its closure
|
||||
LL | | });
|
||||
| |_____^
|
||||
|
||||
error: borrowed data cannot be stored outside of its closure
|
||||
--> $DIR/expect-region-supply-region.rs:52:18
|
||||
|
|
||||
43 | let mut f: Option<&u32> = None;
|
||||
LL | let mut f: Option<&u32> = None;
|
||||
| ----- borrowed data cannot be stored into here...
|
||||
...
|
||||
47 | closure_expecting_bound(|x: &'x u32| {
|
||||
LL | closure_expecting_bound(|x: &'x u32| {
|
||||
| ------------ ...because it cannot outlive this closure
|
||||
...
|
||||
52 | f = Some(x);
|
||||
LL | f = Some(x);
|
||||
| ^ cannot be stored outside of its closure
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
@ -1,12 +1,12 @@
|
||||
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnMut`
|
||||
--> $DIR/issue-26046-fn-mut.rs:14:19
|
||||
|
|
||||
14 | let closure = || { //~ ERROR expected a closure that
|
||||
LL | let closure = || { //~ ERROR expected a closure that
|
||||
| ^^ this closure implements `FnMut`, not `Fn`
|
||||
15 | num += 1;
|
||||
LL | num += 1;
|
||||
| --- closure is `FnMut` because it mutates the variable `num` here
|
||||
...
|
||||
18 | Box::new(closure)
|
||||
LL | Box::new(closure)
|
||||
| ----------------- the requirement to implement `Fn` derives from here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,12 +1,12 @@
|
||||
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
|
||||
--> $DIR/issue-26046-fn-once.rs:14:19
|
||||
|
|
||||
14 | let closure = move || { //~ ERROR expected a closure
|
||||
LL | let closure = move || { //~ ERROR expected a closure
|
||||
| ^^^^^^^ this closure implements `FnOnce`, not `Fn`
|
||||
15 | vec
|
||||
LL | vec
|
||||
| --- closure is `FnOnce` because it moves the variable `vec` out of its environment
|
||||
...
|
||||
18 | Box::new(closure)
|
||||
LL | Box::new(closure)
|
||||
| ----------------- the requirement to implement `Fn` derives from here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,15 +1,15 @@
|
||||
error[E0382]: use of moved value: `debug_dump_dict`
|
||||
--> $DIR/issue-42065.rs:21:5
|
||||
|
|
||||
20 | debug_dump_dict();
|
||||
LL | debug_dump_dict();
|
||||
| --------------- value moved here
|
||||
21 | debug_dump_dict();
|
||||
LL | debug_dump_dict();
|
||||
| ^^^^^^^^^^^^^^^ value used here after move
|
||||
|
|
||||
note: closure cannot be invoked more than once because it moves the variable `dict` out of its environment
|
||||
--> $DIR/issue-42065.rs:16:29
|
||||
|
|
||||
16 | for (key, value) in dict {
|
||||
LL | for (key, value) in dict {
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error: requires at least a format string argument
|
||||
--> $DIR/bad-format-args.rs:12:5
|
||||
|
|
||||
12 | format!();
|
||||
LL | format!();
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
@ -9,7 +9,7 @@ error: requires at least a format string argument
|
||||
error: expected token: `,`
|
||||
--> $DIR/bad-format-args.rs:13:5
|
||||
|
|
||||
13 | format!("" 1);
|
||||
LL | format!("" 1);
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
@ -17,7 +17,7 @@ error: expected token: `,`
|
||||
error: expected token: `,`
|
||||
--> $DIR/bad-format-args.rs:14:5
|
||||
|
|
||||
14 | format!("", 1 1);
|
||||
LL | format!("", 1 1);
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
@ -1,9 +1,9 @@
|
||||
error[E0592]: duplicate definitions with name `f`
|
||||
--> $DIR/coherence-overlapping-inherent-impl-trait.rs:14:10
|
||||
|
|
||||
14 | impl C { fn f() {} } //~ ERROR duplicate
|
||||
LL | impl C { fn f() {} } //~ ERROR duplicate
|
||||
| ^^^^^^^^^ duplicate definitions for `f`
|
||||
15 | impl C { fn f() {} }
|
||||
LL | impl C { fn f() {} }
|
||||
| --------- other definition for `f`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `&'static main::Foo`
|
||||
--> $DIR/empty_span.rs:17:5
|
||||
|
|
||||
17 | unsafe impl Send for &'static Foo { } //~ ERROR cross-crate traits with a default impl
|
||||
LL | unsafe impl Send for &'static Foo { } //~ ERROR cross-crate traits with a default impl
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,11 +1,11 @@
|
||||
error[E0596]: cannot borrow immutable local variable `x` as mutable
|
||||
--> $DIR/huge_multispan_highlight.rs:100:18
|
||||
|
|
||||
12 | let x = "foo";
|
||||
| - consider changing this to `mut x`
|
||||
--> $DIR/huge_multispan_highlight.rs:100:18
|
||||
|
|
||||
LL | let x = "foo";
|
||||
| - consider changing this to `mut x`
|
||||
...
|
||||
100 | let y = &mut x; //~ ERROR cannot borrow
|
||||
| ^ cannot borrow mutably
|
||||
LL | let y = &mut x; //~ ERROR cannot borrow
|
||||
| ^ cannot borrow mutably
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
--> $DIR/issue-11715.rs:100:18
|
||||
|
|
||||
99 | let y = &mut x;
|
||||
| - first mutable borrow occurs here
|
||||
100 | let z = &mut x; //~ ERROR cannot borrow
|
||||
| ^ second mutable borrow occurs here
|
||||
101 | }
|
||||
| - first borrow ends here
|
||||
--> $DIR/issue-11715.rs:100:18
|
||||
|
|
||||
LL | let y = &mut x;
|
||||
| - first mutable borrow occurs here
|
||||
LL | let z = &mut x; //~ ERROR cannot borrow
|
||||
| ^ second mutable borrow occurs here
|
||||
LL | }
|
||||
| - first borrow ends here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0600]: cannot apply unary operator `!` to type `&'static str`
|
||||
--> $DIR/issue-28308.rs:12:5
|
||||
|
|
||||
12 | assert!("foo");
|
||||
LL | assert!("foo");
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0499]: cannot borrow `v` as mutable more than once at a time
|
||||
--> $DIR/one_line.rs:13:12
|
||||
|
|
||||
13 | v.push(v.pop().unwrap()); //~ ERROR cannot borrow
|
||||
LL | v.push(v.pop().unwrap()); //~ ERROR cannot borrow
|
||||
| - ^ - first borrow ends here
|
||||
| | |
|
||||
| | second mutable borrow occurs here
|
||||
|
@ -1,28 +1,28 @@
|
||||
error[E0592]: duplicate definitions with name `id`
|
||||
--> $DIR/overlapping_inherent_impls.rs:19:5
|
||||
|
|
||||
19 | fn id() {} //~ ERROR duplicate definitions
|
||||
LL | fn id() {} //~ ERROR duplicate definitions
|
||||
| ^^^^^^^^^^ duplicate definitions for `id`
|
||||
...
|
||||
23 | fn id() {}
|
||||
LL | fn id() {}
|
||||
| ---------- other definition for `id`
|
||||
|
||||
error[E0592]: duplicate definitions with name `bar`
|
||||
--> $DIR/overlapping_inherent_impls.rs:29:5
|
||||
|
|
||||
29 | fn bar(&self) {} //~ ERROR duplicate definitions
|
||||
LL | fn bar(&self) {} //~ ERROR duplicate definitions
|
||||
| ^^^^^^^^^^^^^^^^ duplicate definitions for `bar`
|
||||
...
|
||||
33 | fn bar(&self) {}
|
||||
LL | fn bar(&self) {}
|
||||
| ---------------- other definition for `bar`
|
||||
|
||||
error[E0592]: duplicate definitions with name `baz`
|
||||
--> $DIR/overlapping_inherent_impls.rs:39:5
|
||||
|
|
||||
39 | fn baz(&self) {} //~ ERROR duplicate definitions
|
||||
LL | fn baz(&self) {} //~ ERROR duplicate definitions
|
||||
| ^^^^^^^^^^^^^^^^ duplicate definitions for `baz`
|
||||
...
|
||||
43 | fn baz(&self) {}
|
||||
LL | fn baz(&self) {}
|
||||
| ---------------- other definition for `baz`
|
||||
|
|
||||
= note: upstream crates may add new impl of trait `std::marker::Copy` for type `std::vec::Vec<_>` in future versions
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
|
||||
--> $DIR/overlapping_spans.rs:21:9
|
||||
|
|
||||
21 | S {f:_s} => {} //~ ERROR cannot move out
|
||||
LL | S {f:_s} => {} //~ ERROR cannot move out
|
||||
| ^^^^^--^
|
||||
| | |
|
||||
| | hint: to prevent move, use `ref _s` or `ref mut _s`
|
||||
|
@ -1,15 +1,15 @@
|
||||
error[E0425]: cannot find value `bar` in this scope
|
||||
--> $DIR/tab.rs:14:2
|
||||
|
|
||||
14 | bar; //~ ERROR cannot find value `bar`
|
||||
LL | bar; //~ ERROR cannot find value `bar`
|
||||
| ^^^ not found in this scope
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/tab.rs:18:2
|
||||
|
|
||||
17 | fn foo() {
|
||||
LL | fn foo() {
|
||||
| - help: try adding a return type: `-> &'static str`
|
||||
18 | "bar boo" //~ ERROR mismatched types
|
||||
LL | "bar boo" //~ ERROR mismatched types
|
||||
| ^^^^^^^^^^^^^^^^^^^^ expected (), found reference
|
||||
|
|
||||
= note: expected type `()`
|
||||
|
@ -1,9 +1,9 @@
|
||||
error: unterminated double quote string
|
||||
--> $DIR/tab_2.rs:14:7
|
||||
|
|
||||
14 | """; //~ ERROR unterminated double quote
|
||||
LL | """; //~ ERROR unterminated double quote
|
||||
| ___________________^
|
||||
15 | | }
|
||||
LL | | }
|
||||
| |__^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0382]: use of moved value: `some_vec`
|
||||
--> $DIR/tab_3.rs:17:20
|
||||
|
|
||||
15 | some_vec.into_iter();
|
||||
LL | some_vec.into_iter();
|
||||
| -------- value moved here
|
||||
16 | {
|
||||
17 | println!("{:?}", some_vec); //~ ERROR use of moved
|
||||
LL | {
|
||||
LL | println!("{:?}", some_vec); //~ ERROR use of moved
|
||||
| ^^^^^^^^ value used here after move
|
||||
|
|
||||
= note: move occurs because `some_vec` has type `std::vec::Vec<&str>`, which does not implement the `Copy` trait
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0404]: expected trait, found type alias `Bar`
|
||||
--> $DIR/two_files.rs:15:6
|
||||
|
|
||||
15 | impl Bar for Baz { } //~ ERROR expected trait, found type alias
|
||||
LL | impl Bar for Baz { } //~ ERROR expected trait, found type alias
|
||||
| ^^^ type aliases cannot be used for traits
|
||||
|
||||
error: cannot continue compilation due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error: invalid ABI: expected one of [cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted], found `路濫狼á́́`
|
||||
--> $DIR/unicode.rs:11:8
|
||||
|
|
||||
11 | extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI
|
||||
LL | extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,7 +1,7 @@
|
||||
error: invalid width `7` for integer literal
|
||||
--> $DIR/unicode_2.rs:14:25
|
||||
|
|
||||
14 | let _ = ("a̐éö̲", 0u7); //~ ERROR invalid width
|
||||
LL | let _ = ("a̐éö̲", 0u7); //~ ERROR invalid width
|
||||
| ^^^
|
||||
|
|
||||
= help: valid widths are 8, 16, 32, 64 and 128
|
||||
@ -9,7 +9,7 @@ error: invalid width `7` for integer literal
|
||||
error: invalid width `42` for integer literal
|
||||
--> $DIR/unicode_2.rs:15:20
|
||||
|
|
||||
15 | let _ = ("아あ", 1i42); //~ ERROR invalid width
|
||||
LL | let _ = ("아あ", 1i42); //~ ERROR invalid width
|
||||
| ^^^^
|
||||
|
|
||||
= help: valid widths are 8, 16, 32, 64 and 128
|
||||
@ -17,7 +17,7 @@ error: invalid width `42` for integer literal
|
||||
error[E0425]: cannot find value `a̐é` in this scope
|
||||
--> $DIR/unicode_2.rs:16:13
|
||||
|
|
||||
16 | let _ = a̐é; //~ ERROR cannot find
|
||||
LL | let _ = a̐é; //~ ERROR cannot find
|
||||
| ^^ not found in this scope
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
@ -1,7 +1,7 @@
|
||||
warning: denote infinite loops with `loop { ... }`
|
||||
--> $DIR/unicode_3.rs:14:45
|
||||
|
|
||||
14 | let s = "ZͨA͑ͦ͒͋ͤ͑̚L̄͑͋Ĝͨͥ̿͒̽̈́Oͥ͛ͭ!̏"; while true { break; }
|
||||
LL | let s = "ZͨA͑ͦ͒͋ͤ͑̚L̄͑͋Ĝͨͥ̿͒̽̈́Oͥ͛ͭ!̏"; while true { break; }
|
||||
| ^^^^^^^^^^ help: use `loop`
|
||||
|
|
||||
= note: #[warn(while_true)] on by default
|
||||
|
@ -1,11 +1,11 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/coercion-missing-tail-expected-type.rs:13:28
|
||||
|
|
||||
13 | fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types
|
||||
LL | fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types
|
||||
| ____________________________^
|
||||
14 | | x + 1;
|
||||
LL | | x + 1;
|
||||
| | - help: consider removing this semicolon
|
||||
15 | | }
|
||||
LL | | }
|
||||
| |_^ expected i32, found ()
|
||||
|
|
||||
= note: expected type `i32`
|
||||
@ -14,11 +14,11 @@ error[E0308]: mismatched types
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/coercion-missing-tail-expected-type.rs:17:29
|
||||
|
|
||||
17 | fn foo() -> Result<u8, u64> { //~ ERROR mismatched types
|
||||
LL | fn foo() -> Result<u8, u64> { //~ ERROR mismatched types
|
||||
| _____________________________^
|
||||
18 | | Ok(1);
|
||||
LL | | Ok(1);
|
||||
| | - help: consider removing this semicolon
|
||||
19 | | }
|
||||
LL | | }
|
||||
| |_^ expected enum `std::result::Result`, found ()
|
||||
|
|
||||
= note: expected type `std::result::Result<u8, u64>`
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0412]: cannot find type `DoesNotExist` in this scope
|
||||
--> $DIR/coherence-error-suppression.rs:19:14
|
||||
|
|
||||
19 | impl Foo for DoesNotExist {} //~ ERROR cannot find type `DoesNotExist` in this scope
|
||||
LL | impl Foo for DoesNotExist {} //~ ERROR cannot find type `DoesNotExist` in this scope
|
||||
| ^^^^^^^^^^^^ not found in this scope
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,37 +1,37 @@
|
||||
error[E0206]: the trait `Copy` may not be implemented for this type
|
||||
--> $DIR/coherence-impls-copy.rs:29:15
|
||||
|
|
||||
29 | impl Copy for &'static mut MyType {}
|
||||
LL | impl Copy for &'static mut MyType {}
|
||||
| ^^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
|
||||
|
||||
error[E0206]: the trait `Copy` may not be implemented for this type
|
||||
--> $DIR/coherence-impls-copy.rs:33:15
|
||||
|
|
||||
33 | impl Copy for (MyType, MyType) {}
|
||||
LL | impl Copy for (MyType, MyType) {}
|
||||
| ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
|
||||
|
||||
error[E0206]: the trait `Copy` may not be implemented for this type
|
||||
--> $DIR/coherence-impls-copy.rs:37:15
|
||||
|
|
||||
37 | impl Copy for &'static NotSync {}
|
||||
LL | impl Copy for &'static NotSync {}
|
||||
| ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
|
||||
|
||||
error[E0206]: the trait `Copy` may not be implemented for this type
|
||||
--> $DIR/coherence-impls-copy.rs:40:15
|
||||
|
|
||||
40 | impl Copy for [MyType] {}
|
||||
LL | impl Copy for [MyType] {}
|
||||
| ^^^^^^^^ type is not a structure or enumeration
|
||||
|
||||
error[E0206]: the trait `Copy` may not be implemented for this type
|
||||
--> $DIR/coherence-impls-copy.rs:44:15
|
||||
|
|
||||
44 | impl Copy for &'static [NotSync] {}
|
||||
LL | impl Copy for &'static [NotSync] {}
|
||||
| ^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
|
||||
|
||||
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
|
||||
--> $DIR/coherence-impls-copy.rs:33:1
|
||||
|
|
||||
33 | impl Copy for (MyType, MyType) {}
|
||||
LL | impl Copy for (MyType, MyType) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
||||
|
|
||||
= note: the impl does not reference any types defined in this crate
|
||||
@ -40,7 +40,7 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
|
||||
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
|
||||
--> $DIR/coherence-impls-copy.rs:40:1
|
||||
|
|
||||
40 | impl Copy for [MyType] {}
|
||||
LL | impl Copy for [MyType] {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
||||
|
|
||||
= note: the impl does not reference any types defined in this crate
|
||||
@ -49,7 +49,7 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
|
||||
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
|
||||
--> $DIR/coherence-impls-copy.rs:44:1
|
||||
|
|
||||
44 | impl Copy for &'static [NotSync] {}
|
||||
LL | impl Copy for &'static [NotSync] {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
||||
|
|
||||
= note: the impl does not reference any types defined in this crate
|
||||
|
@ -1,19 +1,19 @@
|
||||
error[E0592]: duplicate definitions with name `dummy`
|
||||
--> $DIR/coherence-overlap-downstream-inherent.rs:17:26
|
||||
|
|
||||
17 | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
|
||||
LL | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
|
||||
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
||||
18 | //~^ ERROR E0592
|
||||
19 | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
|
||||
LL | //~^ ERROR E0592
|
||||
LL | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
|
||||
| ------------------- other definition for `dummy`
|
||||
|
||||
error[E0592]: duplicate definitions with name `f`
|
||||
--> $DIR/coherence-overlap-downstream-inherent.rs:23:38
|
||||
|
|
||||
23 | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
|
||||
LL | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
|
||||
| ^^^^^^^^^^^^^^ duplicate definitions for `f`
|
||||
24 | //~^ ERROR E0592
|
||||
25 | impl<X> A<i32, X> { fn f(&self) {} }
|
||||
LL | //~^ ERROR E0592
|
||||
LL | impl<X> A<i32, X> { fn f(&self) {} }
|
||||
| -------------- other definition for `f`
|
||||
|
|
||||
= note: downstream crates may implement trait `Bar<_>` for type `i32`
|
||||
|
@ -1,17 +1,17 @@
|
||||
error[E0119]: conflicting implementations of trait `Sweet`:
|
||||
--> $DIR/coherence-overlap-downstream.rs:18:1
|
||||
|
|
||||
17 | impl<T:Sugar> Sweet for T { }
|
||||
LL | impl<T:Sugar> Sweet for T { }
|
||||
| ------------------------- first implementation here
|
||||
18 | impl<T:Fruit> Sweet for T { }
|
||||
LL | impl<T:Fruit> Sweet for T { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`:
|
||||
--> $DIR/coherence-overlap-downstream.rs:24:1
|
||||
|
|
||||
23 | impl<X, T> Foo<X> for T where T: Bar<X> {}
|
||||
LL | impl<X, T> Foo<X> for T where T: Bar<X> {}
|
||||
| --------------------------------------- first implementation here
|
||||
24 | impl<X> Foo<X> for i32 {}
|
||||
LL | impl<X> Foo<X> for i32 {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
|
||||
|
|
||||
= note: downstream crates may implement trait `Bar<_>` for type `i32`
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0592]: duplicate definitions with name `dummy`
|
||||
--> $DIR/coherence-overlap-issue-23516-inherent.rs:19:25
|
||||
|
|
||||
19 | impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
|
||||
LL | impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
|
||||
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
||||
20 | //~^ ERROR E0592
|
||||
21 | impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
|
||||
LL | //~^ ERROR E0592
|
||||
LL | impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
|
||||
| ------------------- other definition for `dummy`
|
||||
|
|
||||
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
|
||||
|
@ -1,9 +1,9 @@
|
||||
error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>`:
|
||||
--> $DIR/coherence-overlap-issue-23516.rs:18:1
|
||||
|
|
||||
17 | impl<T:Sugar> Sweet for T { }
|
||||
LL | impl<T:Sugar> Sweet for T { }
|
||||
| ------------------------- first implementation here
|
||||
18 | impl<U:Sugar> Sweet for Box<U> { }
|
||||
LL | impl<U:Sugar> Sweet for Box<U> { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::boxed::Box<_>`
|
||||
|
|
||||
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0592]: duplicate definitions with name `dummy`
|
||||
--> $DIR/coherence-overlap-upstream-inherent.rs:21:32
|
||||
|
|
||||
21 | impl<T> A<T> where T: Remote { fn dummy(&self) { } }
|
||||
LL | impl<T> A<T> where T: Remote { fn dummy(&self) { } }
|
||||
| ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
|
||||
22 | //~^ ERROR E0592
|
||||
23 | impl A<i16> { fn dummy(&self) { } }
|
||||
LL | //~^ ERROR E0592
|
||||
LL | impl A<i16> { fn dummy(&self) { } }
|
||||
| ------------------- other definition for `dummy`
|
||||
|
|
||||
= note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user