Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 710dcbd

Browse files
committedJan 1, 2019
Improve type mismatch error messages
Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing.
1 parent 6efaef6 commit 710dcbd

File tree

54 files changed

+105
-105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+105
-105
lines changed
 

‎src/librustc/ty/error.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ impl<'a, 'gcx, 'lcx, 'tcx> ty::TyS<'tcx> {
200200
ty::GeneratorWitness(..) => "generator witness".into(),
201201
ty::Tuple(..) => "tuple".into(),
202202
ty::Infer(ty::TyVar(_)) => "inferred type".into(),
203-
ty::Infer(ty::IntVar(_)) => "integral variable".into(),
204-
ty::Infer(ty::FloatVar(_)) => "floating-point variable".into(),
203+
ty::Infer(ty::IntVar(_)) => "integer".into(),
204+
ty::Infer(ty::FloatVar(_)) => "floating-point number".into(),
205205
ty::Placeholder(..) => "placeholder type".into(),
206206
ty::Bound(..) => "bound type".into(),
207207
ty::Infer(ty::FreshTy(_)) => "fresh type".into(),

‎src/test/ui/bad/bad-const-type.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ static i: String = 10;
22
//~^ ERROR mismatched types
33
//~| expected type `std::string::String`
44
//~| found type `{integer}`
5-
//~| expected struct `std::string::String`, found integral variable
5+
//~| expected struct `std::string::String`, found integer
66
fn main() { println!("{}", i); }

0 commit comments

Comments
 (0)
Please sign in to comment.