about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-05-13 17:07:38 +0000
committerbors <bors@rust-lang.org>2018-05-13 17:07:38 +0000
commit9fae1537462bb10fd17d07816efc17cfe4786806 (patch)
tree27b8125e37ecd34720f6cee3286e821c6a6df96d /src/rustllvm/RustWrapper.cpp
parent3e955a058108fcadf0a8222de5868b0c905534d5 (diff)
parent37ed2ab91038567bafe3fd2e545c7d1631ff2ab0 (diff)
downloadrust-9fae1537462bb10fd17d07816efc17cfe4786806.tar.gz
rust-9fae1537462bb10fd17d07816efc17cfe4786806.zip
Auto merge of #49835 - da-x:literal-fragment-pr, r=petrochenkov
Macros: Add a 'literal' fragment specifier

See: https://github.com/rust-lang/rust/issues/35625

```rust

macro_rules! test_literal {
    ($l:literal) => {
        println!("literal: {}", $l);
    };
    ($e:expr) => {
        println!("expr: {}", $e);
    };
}

fn main() {
    let a = 1;
    test_literal!(a);
    test_literal!(2);
    test_literal!(-3);
}
```

Output:

```
expr: 1
literal: 2
literal: -3
```

ToDo:

* [x] Feature gate
* [x] Basic tests
* [x] Tests for range patterns
* [x] Tests for attributes
* [x] Documentation
* [x] Fix for `true`/`false`
* [x] Fix for negative number literals
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions