Skip to content

Commit 9f0e379

Browse files
committed
Update seq project to paste using ~ instead of #
1 parent a7a8658 commit 9f0e379

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

seq/tests/04-paste-ident.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// One of the big things callers will want to do with the sequential indices N
22
// is use them as part of an identifier, like f0 f1 f2 etc.
33
//
4-
// Implement some logic to paste together any Ident followed by `#` followed by
4+
// Implement some logic to paste together any Ident followed by `~` followed by
55
// our loop variable into a single concatenated identifier.
66
//
77
// The invocation below will expand to:
@@ -10,8 +10,8 @@
1010
// fn f2() -> u64 { 2 * 2 }
1111
// fn f3() -> u64 { 3 * 2 }
1212
//
13-
// Optionally, also support more flexible arrangements like `f#N#_suffix` ->
14-
// f0_suffix f1_suffix etc, though the test suite only requires `prefix#N` so
13+
// Optionally, also support more flexible arrangements like `f~N~_suffix` ->
14+
// f0_suffix f1_suffix etc, though the test suite only requires `prefix~N` so
1515
// you will need to add your own tests for this feature.
1616
//
1717
//
@@ -23,7 +23,7 @@
2323
use seq::seq;
2424

2525
seq!(N in 1..4 {
26-
fn f#N () -> u64 {
26+
fn f~N () -> u64 {
2727
N * 2
2828
}
2929
});

seq/tests/05-repeat-section.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
// enum Interrupt {
77
// seq!(N in 0..16 {
8-
// Irq#N,
8+
// Irq~N,
99
// });
1010
// }
1111
//
@@ -34,7 +34,7 @@ seq!(N in 0..16 {
3434
#[derive(Copy, Clone, PartialEq, Debug)]
3535
enum Interrupt {
3636
#(
37-
Irq#N,
37+
Irq~N,
3838
)*
3939
}
4040
});

seq/tests/07-inclusive-range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use seq::seq;
66
seq!(N in 16..=20 {
77
enum E {
88
#(
9-
Variant#N,
9+
Variant~N,
1010
)*
1111
}
1212
});

seq/tests/08-ident-span.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,31 @@
66
// The invocation below expands to code that mentions a value Missing0 which
77
// does not exist. When the compiler reports that it "cannot find value
88
// Missing0", we would like for the error to point directly to where the user
9-
// wrote `Missing#N` in their macro input.
9+
// wrote `Missing~N` in their macro input.
1010
//
1111
// error[E0425]: cannot find value `Missing0` in this scope
1212
// |
13-
// | let _ = Missing#N;
13+
// | let _ = Missing~N;
1414
// | ^^^^^^^ not found in this scope
1515
//
1616
// For this test to pass, ensure that the pasted-together identifier is created
1717
// using the Span of the identifier written by the caller.
1818
//
1919
// If you are using a nightly toolchain, there is a nightly-only method called
20-
// Span::join which would allow joining the three spans of `Missing`, `#`, `N`
20+
// Span::join which would allow joining the three spans of `Missing`, `~`, `N`
2121
// so that the resulting error is as follows, but I would recommend not
2222
// bothering with this for the purpose of this project while it is unstable.
2323
//
2424
// error[E0425]: cannot find value `Missing0` in this scope
2525
// |
26-
// | let _ = Missing#N;
26+
// | let _ = Missing~N;
2727
// | ^^^^^^^^^ not found in this scope
2828
//
2929

3030
use seq::seq;
3131

3232
seq!(N in 0..1 {
3333
fn main() {
34-
let _ = Missing#N;
34+
let _ = Missing~N;
3535
}
3636
});

seq/tests/08-ident-span.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0425]: cannot find value `Missing0` in this scope
22
--> tests/08-ident-span.rs:34:17
33
|
4-
34 | let _ = Missing#N;
4+
34 | let _ = Missing~N;
55
| ^^^^^^^ not found in this scope

0 commit comments

Comments
 (0)