Skip to content

Commit b348012

Browse files
committed
Incorporated suggested changes
1 parent 03cce1d commit b348012

5 files changed

+8
-5
lines changed

src/librustc/error_codes.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ For example:
12171217
```compile_fail,E0284
12181218
fn foo() -> Result<bool, ()> {
12191219
let results = [Ok(true), Ok(false), Err(())].iter().cloned();
1220-
let v : Vec<bool> = results.collect()?;
1220+
let v: Vec<bool> = results.collect()?;
12211221
// Do things with v...
12221222
Ok(true)
12231223
}
@@ -1228,7 +1228,7 @@ Hence, `results.collect()` can return any type implementing
12281228
`FromIterator<Result<bool, ()>>`. On the other hand, the
12291229
`?` operator can accept any type implementing `Try`.
12301230
1231-
The user of this code probably wants `collect()` to return a
1231+
The author of this code probably wants `collect()` to return a
12321232
`Result<Vec<bool>, ()>`, but the compiler can't be sure
12331233
that there isn't another type `T` implementing both `Try` and
12341234
`FromIterator<Result<bool, ()>>` in scope such that
@@ -1241,16 +1241,15 @@ To resolve this error, use a concrete type for the intermediate expression:
12411241
fn foo() -> Result<bool, ()> {
12421242
let results = [Ok(true), Ok(false), Err(())].iter().cloned();
12431243
let v = {
1244-
let temp : Result<Vec<bool>, ()> = results.collect();
1244+
let temp: Result<Vec<bool>, ()> = results.collect();
12451245
temp?
12461246
};
12471247
// Do things with v...
12481248
Ok(true)
12491249
}
12501250
```
1251-
Note that the type of `v` can now be inferred from the type of `temp`
1252-
12531251
1252+
Note that the type of `v` can now be inferred from the type of `temp`.
12541253
"##,
12551254

12561255
E0308: r##"

src/test/ui/associated-types/associated-types-overridden-binding.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ LL | trait Foo: Iterator<Item = i32> {}
1212

1313
error: aborting due to previous error
1414

15+
For more information about this error, try `rustc --explain E0284`.

src/test/ui/associated-types/associated-types-unconstrained.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ LL | let x: isize = Foo::bar();
66

77
error: aborting due to previous error
88

9+
For more information about this error, try `rustc --explain E0284`.

src/test/ui/issues/issue-12028.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ LL | self.input_stream(&mut stream);
66

77
error: aborting due to previous error
88

9+
For more information about this error, try `rustc --explain E0284`.

src/test/ui/question-mark-type-infer.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ LL | l.iter().map(f).collect()?
66

77
error: aborting due to previous error
88

9+
For more information about this error, try `rustc --explain E0284`.

0 commit comments

Comments
 (0)