Skip to content

Commit 9eda807

Browse files
authored
Merge pull request #239 from shepmaster/no-more-int-float
Remove `float`, `int`, and `uint` as built-in types.
2 parents c8280ae + 0e832ec commit 9eda807

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

rust-mode-tests.el

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,11 @@ very very very long string
316316
(ert-deftest indent-struct-fields-aligned ()
317317
(test-indent
318318
"
319-
struct Foo { bar: int,
320-
baz: int }
319+
struct Foo { bar: i32,
320+
baz: i32 }
321321
322-
struct Blah {x:int,
323-
y:int,
322+
struct Blah {x:i32,
323+
y:i32,
324324
z:String"))
325325

326326
(ert-deftest indent-doc-comments ()
@@ -345,12 +345,12 @@ fn foo() {
345345
"
346346
// struct fields out one level:
347347
struct foo {
348-
a:int,
348+
a:i32,
349349
// comments too
350350
b:char
351351
}
352352
353-
fn bar(x:Box<int>) { // comment here should not affect the next indent
353+
fn bar(x:Box<i32>) { // comment here should not affect the next indent
354354
bla();
355355
bla();
356356
}"))
@@ -397,11 +397,11 @@ not_a_string();
397397
"
398398
// Indent out one level because no params appear on the first line
399399
fn xyzzy(
400-
a:int,
400+
a:i32,
401401
b:char) { }
402402
403403
fn abcdef(
404-
a:int,
404+
a:i32,
405405
b:char)
406406
-> char
407407
{ }"))
@@ -410,42 +410,42 @@ fn abcdef(
410410
(test-indent
411411
"
412412
// Align the second line of params to the first
413-
fn foo(a:int,
413+
fn foo(a:i32,
414414
b:char) { }
415415
416-
fn bar( a:int,
416+
fn bar( a:i32,
417417
b:char)
418-
-> int
418+
-> i32
419419
{ }
420420
421-
fn baz( a:int, // should work with a comment here
421+
fn baz( a:i32, // should work with a comment here
422422
b:char)
423-
-> int
423+
-> i32
424424
{ }
425425
"))
426426

427427
(ert-deftest indent-open-after-arrow ()
428428
(test-indent
429429
"
430430
// Indent function body only one level after `-> {`
431-
fn foo1(a:int, b:char) -> int {
431+
fn foo1(a:i32, b:char) -> i32 {
432432
let body;
433433
}
434434
435-
fn foo2(a:int,
436-
b:char) -> int {
435+
fn foo2(a:i32,
436+
b:char) -> i32 {
437437
let body;
438438
}
439439
440-
fn foo3(a:int,
440+
fn foo3(a:i32,
441441
b:char)
442-
-> int {
442+
-> i32 {
443443
let body;
444444
}
445445
446-
fn foo4(a:int,
446+
fn foo4(a:i32,
447447
b:char)
448-
-> int where int:A {
448+
-> i32 where i32:A {
449449
let body;
450450
}
451451
"))
@@ -657,7 +657,7 @@ pub struct Region { // <-- this should be flush with left margin!
657657
(test-indent
658658
"
659659
fn args_on_the_next_line( // with a comment
660-
a:int,
660+
a:i32,
661661
b:String) {
662662
let aaaaaa = [
663663
1,
@@ -692,11 +692,11 @@ fn args_on_the_next_line( // with a comment
692692
(ert-deftest indent-nested-fns ()
693693
(test-indent
694694
"
695-
fn nexted_fns(a: fn(b:int,
695+
fn nexted_fns(a: fn(b:i32,
696696
c:char)
697-
-> int,
698-
d: int)
699-
-> uint
697+
-> i32,
698+
d: i32)
699+
-> u128
700700
{
701701
0
702702
}
@@ -849,32 +849,32 @@ struct A {
849849

850850
(setq rust-test-motion-string
851851
"
852-
fn fn1(arg: int) -> bool {
852+
fn fn1(arg: i32) -> bool {
853853
let x = 5;
854854
let y = b();
855855
true
856856
}
857857
858-
fn fn2(arg: int) -> bool {
858+
fn fn2(arg: i32) -> bool {
859859
let x = 5;
860860
let y = b();
861861
true
862862
}
863863
864-
pub fn fn3(arg: int) -> bool {
864+
pub fn fn3(arg: i32) -> bool {
865865
let x = 5;
866866
let y = b();
867867
true
868868
}
869869
870870
struct Foo {
871-
x: int
871+
x: i32
872872
}
873873
"
874874
rust-test-region-string rust-test-motion-string
875875
rust-test-indent-motion-string
876876
"
877-
fn blank_line(arg:int) -> bool {
877+
fn blank_line(arg:i32) -> bool {
878878
879879
}
880880
@@ -1820,7 +1820,7 @@ pattern to what did and did not trip it."
18201820
;; would make the failure go away.
18211821
(with-temp-buffer
18221822
(rust-mode)
1823-
(insert "fn blank_line(arg:int) -> bool {
1823+
(insert "fn blank_line(arg:i32) -> bool {
18241824
18251825
}
18261826
@@ -2774,7 +2774,7 @@ fn foo() -> Box<i32> {
27742774

27752775
(ert-deftest rust-test-paren-matching-lt-operator-after-special-type ()
27762776
(rust-test-matching-parens
2777-
"fn foo() { low as uint <= c }"
2777+
"fn foo() { low as u128 <= c }"
27782778
'((10 29))
27792779
'(24)))
27802780

@@ -2887,16 +2887,16 @@ fn f() {
28872887
(rust-test-matching-parens
28882888
"
28892889
fn rfc803() {
2890-
let z = a < b:FunnkyThing<int>;
2890+
let z = a < b:FunnkyThing<i32>;
28912891
let s = Foo {
28922892
a: b < 3,
2893-
b: d:CrazyStuff<int> < 3,
2894-
c: 2 < x:CrazyStuff<uint>
2893+
b: d:CrazyStuff<i32> < 3,
2894+
c: 2 < x:CrazyStuff<u128>
28952895
}
28962896
}"
2897-
'((45 49) ;; FunkyThing<int>
2898-
(111 115) ;; CrazyStuff<int>
2899-
(149 154) ;; CrazyStuff<uint>
2897+
'((45 49) ;; FunkyThing<i32>
2898+
(111 115) ;; CrazyStuff<i32>
2899+
(149 154) ;; CrazyStuff<u128>
29002900
)
29012901
'(30 ;; a < b
29022902
83 ;; b < 3

rust-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ buffer."
547547
"u128" "i128"
548548

549549
"f32" "f64"
550-
"float" "int" "uint" "isize" "usize"
550+
"isize" "usize"
551551
"bool"
552552
"str" "char"))
553553

0 commit comments

Comments
 (0)