Avoid rendering empty annotations

This commit is contained in:
Oli Scherer 2022-12-12 15:25:04 +00:00
parent 2e2a4797a2
commit 59554a2b54
43 changed files with 94 additions and 195 deletions

View File

@ -1408,51 +1408,58 @@ impl EmitterWriter {
if !sm.ensure_source_file_source_present(annotated_file.file.clone()) {
if !self.short_message {
// We'll just print an unannotated message.
for (annotation_id, line) in annotated_file.lines.into_iter().enumerate() {
for (annotation_id, line) in annotated_file.lines.iter().enumerate() {
let mut annotations = line.annotations.clone();
annotations.sort_by_key(|a| Reverse(a.start_col));
let mut line_idx = buffer.num_lines();
buffer.append(
line_idx,
&format!(
"{}:{}:{}",
sm.filename_for_diagnostics(&annotated_file.file.name),
sm.doctest_offset_line(&annotated_file.file.name, line.line_index),
annotations[0].start_col + 1,
),
Style::LineAndColumn,
);
if annotation_id == 0 {
buffer.prepend(line_idx, "--> ", Style::LineNumber);
let labels: Vec<_> = annotations
.iter()
.filter_map(|a| Some((a.label.as_ref()?, a.is_primary)))
.filter(|(l, _)| !l.is_empty())
.collect();
if annotation_id == 0 || !labels.is_empty() {
buffer.append(
line_idx,
&format!(
"{}:{}:{}",
sm.filename_for_diagnostics(&annotated_file.file.name),
sm.doctest_offset_line(
&annotated_file.file.name,
line.line_index
),
annotations[0].start_col + 1,
),
Style::LineAndColumn,
);
if annotation_id == 0 {
buffer.prepend(line_idx, "--> ", Style::LineNumber);
} else {
buffer.prepend(line_idx, "::: ", Style::LineNumber);
}
for _ in 0..max_line_num_len {
buffer.prepend(line_idx, " ", Style::NoStyle);
}
line_idx += 1;
};
for (i, annotation) in annotations.into_iter().enumerate() {
if let Some(label) = &annotation.label {
if !label.is_empty() {
let style = if annotation.is_primary {
Style::LabelPrimary
} else {
Style::LabelSecondary
};
if annotation_id == 0 {
buffer.prepend(line_idx, " |", Style::LineNumber);
for _ in 0..max_line_num_len {
buffer.prepend(line_idx, " ", Style::NoStyle);
}
line_idx += 1;
buffer.append(line_idx + i, " = note: ", style);
for _ in 0..max_line_num_len {
buffer.prepend(line_idx, " ", Style::NoStyle);
}
} else {
buffer.append(line_idx + i, ": ", style);
}
buffer.append(line_idx + i, label, style);
}
}
for (label, is_primary) in labels.into_iter() {
let style = if is_primary {
Style::LabelPrimary
} else {
Style::LabelSecondary
};
buffer.prepend(line_idx, " |", Style::LineNumber);
for _ in 0..max_line_num_len {
buffer.prepend(line_idx, " ", Style::NoStyle);
}
line_idx += 1;
buffer.append(line_idx, " = note: ", style);
for _ in 0..max_line_num_len {
buffer.prepend(line_idx, " ", Style::NoStyle);
}
buffer.append(line_idx, label, style);
line_idx += 1;
}
}
}

View File

@ -10,9 +10,6 @@ LL | let y = x.or_else(4);
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `Option::<T>::or_else`
--> $SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
error: aborting due to previous error

View File

@ -19,10 +19,6 @@ LL | let t = thread::spawn(|| {
| ^^
note: required by a bound in `spawn`
--> $SRC_DIR/std/src/thread/mod.rs:LL:COL
$SRC_DIR/std/src/thread/mod.rs:LL:COL
$SRC_DIR/std/src/thread/mod.rs:LL:COL
$SRC_DIR/std/src/thread/mod.rs:LL:COL
$SRC_DIR/std/src/thread/mod.rs:LL:COL
error[E0277]: `Sender<()>` cannot be shared between threads safely
--> $DIR/closure-move-sync.rs:18:19
@ -41,10 +37,6 @@ LL | thread::spawn(|| tx.send(()).unwrap());
| ^^
note: required by a bound in `spawn`
--> $SRC_DIR/std/src/thread/mod.rs:LL:COL
$SRC_DIR/std/src/thread/mod.rs:LL:COL
$SRC_DIR/std/src/thread/mod.rs:LL:COL
$SRC_DIR/std/src/thread/mod.rs:LL:COL
$SRC_DIR/std/src/thread/mod.rs:LL:COL
error: aborting due to 2 previous errors

View File

@ -10,9 +10,6 @@ LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute);
= note: unsafe function cannot be called generically without an unsafe block
note: required by a bound in `Option::<T>::map`
--> $SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
error: aborting due to previous error

View File

@ -6,8 +6,12 @@ LL | match x { }
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL: not covered
$SRC_DIR/core/src/option.rs:LL:COL: not covered
::: $SRC_DIR/core/src/option.rs:LL:COL
|
= note: not covered
::: $SRC_DIR/core/src/option.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|

View File

@ -8,7 +8,9 @@ LL | let Some(y) = x;
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL: not covered
::: $SRC_DIR/core/src/option.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Option<i32>`
help: you might want to use `if let` to ignore the variant that isn't matched
|

View File

@ -6,7 +6,9 @@ LL | for Some(x) in xs {}
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL: not covered
::: $SRC_DIR/core/src/option.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Option<i32>`
error: aborting due to previous error

View File

@ -22,9 +22,6 @@ LL | | });
= help: the trait `FnOnce<({integer},)>` is not implemented for `Option<_>`
note: required by a bound in `Option::<T>::and_then`
--> $SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
error: aborting due to 2 previous errors

View File

@ -8,7 +8,9 @@ LL | let Ok(_x) = foo();
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Result<u32, !>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
$SRC_DIR/core/src/result.rs:LL:COL: not covered
::: $SRC_DIR/core/src/result.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Result<u32, !>`
help: you might want to use `if let` to ignore the variant that isn't matched
|

View File

@ -12,9 +12,6 @@ LL | .get(&"key".into())
where T: ?Sized;
note: required by a bound in `HashMap::<K, V, S>::get`
--> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
$SRC_DIR/std/src/collections/hash/map.rs:LL:COL
$SRC_DIR/std/src/collections/hash/map.rs:LL:COL
$SRC_DIR/std/src/collections/hash/map.rs:LL:COL
help: consider specifying the generic argument
|
LL | .get::<Q>(&"key".into())

View File

@ -37,10 +37,6 @@ LL | const_eval_select((), 42, 0xDEADBEEF);
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `const_eval_select`
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
error: this argument must be a function item
--> $DIR/const-eval-select-bad.rs:10:31
@ -63,10 +59,6 @@ LL | const_eval_select((), 42, 0xDEADBEEF);
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `const_eval_select`
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
error[E0271]: expected `fn(i32) -> bool {bar}` to be a fn item that returns `i32`, but it returns `bool`
--> $DIR/const-eval-select-bad.rs:32:34
@ -78,10 +70,6 @@ LL | const_eval_select((1,), foo, bar);
|
note: required by a bound in `const_eval_select`
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
error[E0631]: type mismatch in function arguments
--> $DIR/const-eval-select-bad.rs:37:32
@ -98,10 +86,6 @@ LL | const_eval_select((true,), foo, baz);
found function signature `fn(i32) -> _`
note: required by a bound in `const_eval_select`
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
$SRC_DIR/core/src/intrinsics.rs:LL:COL
error: this argument must be a `const fn`
--> $DIR/const-eval-select-bad.rs:42:29

View File

@ -6,8 +6,6 @@ LL | b.sort();
|
note: required by a bound in `slice::<impl [T]>::sort`
--> $SRC_DIR/alloc/src/slice.rs:LL:COL
$SRC_DIR/alloc/src/slice.rs:LL:COL
$SRC_DIR/alloc/src/slice.rs:LL:COL
help: consider annotating `X` with `#[derive(Ord)]`
|
LL | #[derive(Ord)]

View File

@ -9,9 +9,6 @@ LL | "".chars().fold(|_, _| (), ());
= help: the trait `FnMut<(_, char)>` is not implemented for `()`
note: required by a bound in `fold`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error: aborting due to previous error

View File

@ -8,9 +8,6 @@ LL | .cloned()
found type `u8`
note: required by a bound in `cloned`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:7:21: 7:25]>>`, but its trait bounds were not satisfied
--> $DIR/issue-31173.rs:12:10

View File

@ -8,9 +8,6 @@ LL | for _ in HashMap::new().iter().cloned() {}
found tuple `(&_, &_)`
note: required by a bound in `cloned`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0271]: expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
--> $DIR/issue-33941.rs:6:14

View File

@ -32,8 +32,6 @@ LL | let sr2: Vec<(u32, _, _)> = sr.iter().map(|(faction, th_sender, th_rece
| `Iterator::Item` is `&(_, _, _)` here
note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error: aborting due to 2 previous errors

View File

@ -15,8 +15,6 @@ LL | let x2: Vec<f64> = x1.into_iter().collect();
| ^^^^^^^^^^^ `Iterator::Item` is `&f64` here
note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a value of type `Vec<f64>` cannot be built from an iterator over elements of type `&f64`
--> $DIR/issue-66923-show-error-for-correct-call.rs:12:29
@ -36,8 +34,6 @@ LL | let x3 = x1.into_iter().collect::<Vec<f64>>();
| ^^^^^^^^^^^ `Iterator::Item` is `&f64` here
note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error: aborting due to 2 previous errors

View File

@ -7,8 +7,6 @@ LL | let whatever: [u32; 10] = (0..10).collect();
= help: the trait `FromIterator<{integer}>` is not implemented for `[u32; 10]`
note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error: aborting due to previous error

View File

@ -17,8 +17,6 @@ LL | let some_generated_vec = (0..10).collect();
= help: the trait `Sized` is not implemented for `[i32]`
note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a slice of type `[i32]` cannot be built since `[i32]` has no definite size
--> $DIR/collect-into-slice.rs:6:38
@ -29,8 +27,6 @@ LL | let some_generated_vec = (0..10).collect();
= help: the trait `FromIterator<{integer}>` is not implemented for `[i32]`
note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error: aborting due to 3 previous errors

View File

@ -22,9 +22,6 @@ LL | | });
| |__________^ `Iterator::Item` changed to `()` here
note: required by a bound in `std::iter::Iterator::sum`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `()`
--> $DIR/invalid-iterator-chain.rs:18:14
@ -57,9 +54,6 @@ LL | .map(|x| { x; })
| ^^^^^^^^^^^^^^^ `Iterator::Item` changed to `()` here
note: required by a bound in `std::iter::Iterator::sum`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `f64`
--> $DIR/invalid-iterator-chain.rs:28:14
@ -88,9 +82,6 @@ LL | .map(|x| { x + 1.0 })
| -------------------- `Iterator::Item` remains `f64` here
note: required by a bound in `std::iter::Iterator::sum`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `()`
--> $DIR/invalid-iterator-chain.rs:30:54
@ -112,9 +103,6 @@ LL | println!("{}", vec![0, 1].iter().map(|x| { x; }).sum::<i32>());
| this expression has type `Vec<{integer}>`
note: required by a bound in `std::iter::Iterator::sum`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a value of type `i32` cannot be made by summing an iterator over elements of type `&()`
--> $DIR/invalid-iterator-chain.rs:31:40
@ -135,9 +123,6 @@ LL | println!("{}", vec![(), ()].iter().sum::<i32>());
| this expression has type `Vec<()>`
note: required by a bound in `std::iter::Iterator::sum`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a value of type `Vec<i32>` cannot be built from an iterator over elements of type `()`
--> $DIR/invalid-iterator-chain.rs:40:25
@ -167,8 +152,6 @@ LL | let f = e.filter(|_| false);
| ----------------- `Iterator::Item` remains `()` here
note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error: aborting due to 6 previous errors

View File

@ -7,8 +7,6 @@ LL | std::iter::empty().collect()
= help: the trait `FromIterator<_>` is not implemented for `Bar`
note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error: aborting due to previous error

View File

@ -7,8 +7,6 @@ LL | x = std::iter::empty().collect();
= help: the trait `FromIterator<_>` is not implemented for `Foo`
note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a value of type `impl Debug` cannot be built from an iterator over elements of type `_`
--> $DIR/recursion4.rs:19:28
@ -19,8 +17,6 @@ LL | x = std::iter::empty().collect();
= help: the trait `FromIterator<_>` is not implemented for `impl Debug`
note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error: aborting due to 2 previous errors

View File

@ -128,9 +128,6 @@ LL | fn foo() {}
|
note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
--> $DIR/closure-arg-count.rs:27:57
@ -144,9 +141,6 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar);
|
note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
--> $DIR/closure-arg-count.rs:29:57
@ -161,9 +155,6 @@ LL | fn qux(x: usize, y: usize) {}
|
note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0593]: function is expected to take 1 argument, but it takes 2 arguments
--> $DIR/closure-arg-count.rs:32:45
@ -175,9 +166,6 @@ LL | let _it = vec![1, 2, 3].into_iter().map(usize::checked_add);
|
note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0593]: function is expected to take 0 arguments, but it takes 1 argument
--> $DIR/closure-arg-count.rs:35:10

View File

@ -10,9 +10,6 @@ LL | a.iter().map(|_: (u32, u32)| 45);
found closure signature `fn((u32, u32)) -> _`
note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0631]: type mismatch in closure arguments
--> $DIR/closure-arg-type-mismatch.rs:4:14
@ -26,9 +23,6 @@ LL | a.iter().map(|_: &(u16, u16)| 45);
found closure signature `for<'a> fn(&'a (u16, u16)) -> _`
note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0631]: type mismatch in closure arguments
--> $DIR/closure-arg-type-mismatch.rs:5:14
@ -42,9 +36,6 @@ LL | a.iter().map(|_: (u16, u16)| 45);
found closure signature `fn((u16, u16)) -> _`
note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error: aborting due to 3 previous errors

View File

@ -10,9 +10,6 @@ LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
found closure signature `for<'a> fn(&'a str) -> _`
note: required by a bound in `filter`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0599]: the method `count` exists for struct `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>`, but its trait bounds were not satisfied
--> $DIR/issue-36053-2.rs:7:55

View File

@ -10,9 +10,6 @@ LL | None::<()>.map(Self::f);
|
note: required by a bound in `Option::<T>::map`
--> $SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
error: aborting due to previous error

View File

@ -11,9 +11,6 @@ LL | self.foo.map(Foo::new)
|
note: required by a bound in `Option::<T>::map`
--> $SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL
error[E0593]: function is expected to take 0 arguments, but it takes 1 argument
--> $DIR/issue-47706.rs:27:9

View File

@ -8,8 +8,6 @@ LL | a.unwrap();
= note: add `#[derive(Debug)]` to `Foo` or manually `impl Debug for Foo`
note: required by a bound in `Result::<T, E>::unwrap`
--> $SRC_DIR/core/src/result.rs:LL:COL
$SRC_DIR/core/src/result.rs:LL:COL
$SRC_DIR/core/src/result.rs:LL:COL
help: consider annotating `Foo` with `#[derive(Debug)]`
|
LL | #[derive(Debug)]

View File

@ -31,10 +31,6 @@ LL | thread::spawn(move|| {
| ^^^^^^
note: required by a bound in `spawn`
--> $SRC_DIR/std/src/thread/mod.rs:LL:COL
$SRC_DIR/std/src/thread/mod.rs:LL:COL
$SRC_DIR/std/src/thread/mod.rs:LL:COL
$SRC_DIR/std/src/thread/mod.rs:LL:COL
$SRC_DIR/std/src/thread/mod.rs:LL:COL
error: aborting due to previous error

View File

@ -17,9 +17,6 @@ LL | vec![(), ()].iter().sum::<i32>();
| this expression has type `Vec<()>`
note: required by a bound in `std::iter::Iterator::sum`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error[E0277]: a value of type `i32` cannot be made by multiplying all elements of type `&()` from an iterator
--> $DIR/sum.rs:7:25
@ -40,9 +37,6 @@ LL | vec![(), ()].iter().product::<i32>();
| this expression has type `Vec<()>`
note: required by a bound in `std::iter::Iterator::product`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
$SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error: aborting due to 2 previous errors

View File

@ -6,7 +6,9 @@ LL | match Some(1) {
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL: not covered
::: $SRC_DIR/core/src/option.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|

View File

@ -66,7 +66,9 @@ LL | match None {
|
note: `Option<HiddenEnum>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL: not covered
::: $SRC_DIR/core/src/option.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Option<HiddenEnum>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|

View File

@ -6,9 +6,6 @@ LL | box NodeKind::Element(ed) => match ed.kind {
|
note: `Box<ElementKind>` defined here
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL
= note: the matched value is of type `Box<ElementKind>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|

View File

@ -19,8 +19,11 @@ LL | match Some(Some(North)) {
|
note: `Option<Option<Direction>>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL: not covered
: not covered
::: $SRC_DIR/core/src/option.rs:LL:COL
|
= note: not covered
|
= note: not covered
= note: the matched value is of type `Option<Option<Direction>>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|

View File

@ -6,7 +6,9 @@ LL | match private::DATA {
|
note: `Option<Private>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL: not covered
::: $SRC_DIR/core/src/option.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Option<Private>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|

View File

@ -36,7 +36,9 @@ LL | match Some(10) {
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
$SRC_DIR/core/src/option.rs:LL:COL: not covered
::: $SRC_DIR/core/src/option.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|

View File

@ -14,10 +14,6 @@ LL | | }
= note: unsafe function cannot be called generically without an unsafe block
note: required by a bound in `ProcMacro::custom_derive`
--> $SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL
$SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL
$SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL
$SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL
$SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL
error: aborting due to previous error

View File

@ -8,7 +8,9 @@ LL | let Ok(x) = res;
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Result<u32, &R<'_>>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
$SRC_DIR/core/src/result.rs:LL:COL: not covered
::: $SRC_DIR/core/src/result.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Result<u32, &R<'_>>`
help: you might want to use `if let` to ignore the variant that isn't matched
|

View File

@ -63,9 +63,6 @@ LL | s.get_unchecked_mut(1);
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
note: required by a bound in `core::str::<impl str>::get_unchecked_mut`
--> $SRC_DIR/core/src/str/mod.rs:LL:COL
$SRC_DIR/core/src/str/mod.rs:LL:COL
$SRC_DIR/core/src/str/mod.rs:LL:COL
$SRC_DIR/core/src/str/mod.rs:LL:COL
error[E0277]: the type `str` cannot be indexed by `char`
--> $DIR/str-mut-idx.rs:13:7

View File

@ -12,9 +12,6 @@ LL | opts.get(opt.as_ref());
where T: ?Sized;
note: required by a bound in `HashMap::<K, V, S>::get`
--> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
$SRC_DIR/std/src/collections/hash/map.rs:LL:COL
$SRC_DIR/std/src/collections/hash/map.rs:LL:COL
$SRC_DIR/std/src/collections/hash/map.rs:LL:COL
help: consider specifying the generic argument
|
LL | opts.get::<Q>(opt.as_ref());

View File

@ -6,7 +6,9 @@ LL | let _ = match x {
|
note: `Result<u32, &Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
$SRC_DIR/core/src/result.rs:LL:COL: not covered
::: $SRC_DIR/core/src/result.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Result<u32, &Void>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
@ -83,7 +85,9 @@ LL | let _ = match x {
|
note: `Result<u32, Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
$SRC_DIR/core/src/result.rs:LL:COL: not covered
::: $SRC_DIR/core/src/result.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Result<u32, Void>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
@ -101,7 +105,9 @@ LL | let Ok(x) = x;
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Result<u32, Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
$SRC_DIR/core/src/result.rs:LL:COL: not covered
::: $SRC_DIR/core/src/result.rs:LL:COL
|
= note: not covered
= note: the matched value is of type `Result<u32, Void>`
help: you might want to use `if let` to ignore the variant that isn't matched
|

View File

@ -10,9 +10,9 @@ LL | trait Foo {
LL | let _z = y.clone();
| ^^^^^ method cannot be called on `Box<dyn Foo>` due to unsatisfied trait bounds
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL: doesn't satisfy `Box<dyn Foo>: Clone`
::: $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
= note: doesn't satisfy `Box<dyn Foo>: Clone`
|
= note: the following trait bounds were not satisfied:
`dyn Foo: Sized`

View File

@ -7,9 +7,9 @@ LL | struct R {
LL | let _j = i.clone();
| ^^^^^ method cannot be called on `Box<R>` due to unsatisfied trait bounds
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL: doesn't satisfy `Box<R>: Clone`
::: $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
= note: doesn't satisfy `Box<R>: Clone`
|
= note: the following trait bounds were not satisfied:
`R: Clone`