Skip to content

Commit a36b960

Browse files
committedJan 2, 2019
Auto merge of #57250 - codeworm96:tyerr_msg, r=varkor
Improve type mismatch error messages Closes #56115. Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing. TODO the book and clippy needs to be changed accordingly later. r? @varkor
·
1.88.01.33.0
2 parents d370493 + 710dcbd commit a36b960

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.