Skip to content

Commit e918879

Browse files
committed
collect now triggers E0283 instad of E0282
1 parent af13f34 commit e918879

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_error_codes/src/error_codes/E0282.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ The compiler could not infer a type and asked for a type annotation.
33
Erroneous code example:
44

55
```compile_fail,E0282
6-
let x = "hello".chars().rev().collect();
6+
let x = None;
77
```
88

99
This error indicates that type inference did not result in one unique possible

compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fn closure_args(fn_sig: &ty::PolyFnSig<'_>) -> String {
182182

183183
pub enum TypeAnnotationNeeded {
184184
/// ```compile_fail,E0282
185-
/// let x = "hello".chars().rev().collect();
185+
/// let _ = None;
186186
/// ```
187187
E0282,
188188
/// An implementation cannot be chosen unambiguously because of lack of information.

0 commit comments

Comments
 (0)