Skip to content

Commit

Permalink
Auto merge of #13939 - tbu-:pr_template_no_usize, r=weihanglo
Browse files Browse the repository at this point in the history
Use `i32` rather than `usize` as "default integer" in library template

`usize` was renamed from `uint` in order to convey that it's not the "default integer type". Guide new users to use `i32` instead of `usize`.
  • Loading branch information
bors committed May 22, 2024
2 parents 99075f2 + a29742a commit 048e804
Show file tree
Hide file tree
Showing 31 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/cargo/ops/cargo_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ fn main() {
"
} else {
b"\
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/cargo_init/auto_git/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/cargo_init/formats_source/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/cargo_init/git_autodetect/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/cargo_init/pijul_autodetect/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/cargo_init/simple_git/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/cargo_init/simple_hg/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/cargo_init/simple_lib/out/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn simple_lib() {
let contents = fs::read_to_string(&lib).unwrap();
assert_eq!(
contents,
r#"pub fn add(left: usize, right: usize) -> usize {
r#"pub fn add(left: u64, right: u64) -> u64 {
left + right
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5085,7 +5085,7 @@ fn cargo_test_set_out_dir_env_var() {
.file(
"src/lib.rs",
r#"
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
"#,
Expand Down

0 comments on commit 048e804

Please sign in to comment.