Commit Graph

10 Commits

Author SHA1 Message Date
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
Patrick Walton 090040bf40 librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, except
for `~str`/`~[]`.

Note that `~self` still remains, since I forgot to add support for
`Box<self>` before the snapshot.

How to update your code:

* Instead of `~EXPR`, you should write `box EXPR`.

* Instead of `~TYPE`, you should write `Box<Type>`.

* Instead of `~PATTERN`, you should write `box PATTERN`.

[breaking-change]
2014-05-06 23:12:54 -07:00
Manish Goregaokar 713e87526e Use new attribute syntax in python files in src/etc too (#13478) 2014-04-14 21:00:31 +05:30
Huon Wilson 6d778ff610 Remove outdated and unnecessary std::vec_ng::Vec imports.
(And fix some tests.)
2014-03-22 01:08:57 +11:00
Patrick Walton af79a5aa7d test: Make manual changes to deal with the fallout from removal of
`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.
2014-03-21 23:37:21 +11:00
Patrick Walton 579eb2400b test: Automatically remove all `~[T]` from tests. 2014-03-21 23:37:21 +11:00
Niko Matsakis b520c2f280 Adjust comments in test case 2014-01-17 10:47:29 -05:00
Niko Matsakis 483ae32189 Update years on more license headers 2014-01-17 10:18:39 -05:00
Niko Matsakis 419ac4a1b8 Issue #3511 - Rationalize temporary lifetimes.
Major changes:

- Define temporary scopes in a syntax-based way that basically defaults
  to the innermost statement or conditional block, except for in
  a `let` initializer, where we default to the innermost block. Rules
  are documented in the code, but not in the manual (yet).
  See new test run-pass/cleanup-value-scopes.rs for examples.
- Refactors Datum to better define cleanup roles.
- Refactor cleanup scopes to not be tied to basic blocks, permitting
  us to have a very large number of scopes (one per AST node).
- Introduce nascent documentation in trans/doc.rs covering datums and
  cleanup in a more comprehensive way.
2014-01-15 18:34:38 -05:00