Commit Graph

10 Commits

Author SHA1 Message Date
Eduard Burtescu
78884b7659 mir: qualify and promote constants. 2016-05-07 19:14:28 +03:00
Eduard Burtescu
e64670888a Remove integer suffixes where the types in compiled code are identical. 2015-03-05 12:38:33 +05:30
Niko Matsakis
72eb214ee4 Update suffixes en masse in tests using perl -p -i -e 2015-02-18 09:10:10 -05:00
Eduard Burtescu
08967c7a7f tests: fix fallout from changed error messages. 2015-02-16 17:13:47 +02:00
Huon Wilson
441044f071 Update compile-fail tests to use is/us, not i/u. 2015-01-08 11:02:24 -05:00
Huon Wilson
85f961e2cc Update compile fail tests to use usize. 2015-01-08 11:02:24 -05:00
Keegan McAllister
c2e26972e3 Un-gate macro_rules 2015-01-05 18:21:14 -08:00
Patrick Walton
ddb2466f6a librustc: Always parse macro!()/macro![] as expressions if not
followed by a semicolon.

This allows code like `vec![1i, 2, 3].len();` to work.

This breaks code that uses macros as statements without putting
semicolons after them, such as:

    fn main() {
        ...
        assert!(a == b)
        assert!(c == d)
        println(...);
    }

It also breaks code that uses macros as items without semicolons:

    local_data_key!(foo)

    fn main() {
        println("hello world")
    }

Add semicolons to fix this code. Those two examples can be fixed as
follows:

    fn main() {
        ...
        assert!(a == b);
        assert!(c == d);
        println(...);
    }

    local_data_key!(foo);

    fn main() {
        println("hello world")
    }

RFC #378.

Closes #18635.

[breaking-change]
2014-12-18 12:09:07 -05:00
Patrick Walton
a5bb0a3a45 librustc: Remove the fallback to int for integers and f64 for
floating point numbers for real.

This will break code that looks like:

    let mut x = 0;
    while ... {
        x += 1;
    }
    println!("{}", x);

Change that code to:

    let mut x = 0i;
    while ... {
        x += 1;
    }
    println!("{}", x);

Closes #15201.

[breaking-change]
2014-06-29 11:47:58 -07:00
Marvin Löbel
24ece07cec Allow blocks in const expressions
Only blocks with tail expressions that are const expressions
and items are allowed.
2014-05-13 17:24:07 -07:00