diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2023-02-18 00:34:41 +0000 |
|---|---|---|
| committer | Jacob Pratt <jacob@jhpratt.dev> | 2023-02-19 03:46:03 +0000 |
| commit | c2f2a3cff2392b8c9898cdfff347770d8e8c05b2 (patch) | |
| tree | 9a9841c35a9f8248718125daf8fa1357ad708e2f | |
| parent | ff052eec8057748bf21e247432e6490c3d2375f7 (diff) | |
| download | rust-c2f2a3cff2392b8c9898cdfff347770d8e8c05b2.tar.gz rust-c2f2a3cff2392b8c9898cdfff347770d8e8c05b2.zip | |
Add test for `println!` typo
| -rw-r--r-- | tests/ui/did_you_mean/println-typo.rs | 6 | ||||
| -rw-r--r-- | tests/ui/did_you_mean/println-typo.stderr | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/did_you_mean/println-typo.rs b/tests/ui/did_you_mean/println-typo.rs new file mode 100644 index 00000000000..685b5e1f284 --- /dev/null +++ b/tests/ui/did_you_mean/println-typo.rs @@ -0,0 +1,6 @@ +// https://internals.rust-lang.org/t/18227 + +fn main() { + prinltn!(); //~ ERROR cannot find macro `prinltn` in this scope + //^ a macro with a similar name exists: `println` +} diff --git a/tests/ui/did_you_mean/println-typo.stderr b/tests/ui/did_you_mean/println-typo.stderr new file mode 100644 index 00000000000..43b7b1894e2 --- /dev/null +++ b/tests/ui/did_you_mean/println-typo.stderr @@ -0,0 +1,11 @@ +error: cannot find macro `prinltn` in this scope + --> $DIR/println-typo.rs:4:5 + | +LL | prinltn!(); + | ^^^^^^^ help: a macro with a similar name exists: `println` + --> $SRC_DIR/std/src/macros.rs:LL:COL + | + = note: similarly named macro `println` defined here + +error: aborting due to previous error + |
