summary refs log tree commit diff
path: root/src/test/run-make/graphviz-flowgraph/f07.dot-expected.dot
AgeCommit message (Collapse)AuthorLines
2015-10-31Remove PatWildMultiVadim Petrochenkov-1/+1
2015-02-22revise handling of match expressions so that arms branch to next arm.James Miller-3/+3
Update the graphviz tests accordingly. Fixes #22073. (Includes regression test for the issue.) (Factoring of aatch CFG code, Part 4.)
2015-01-31Kill more `isize`sTobias Bucher-8/+8
2015-01-06test fallout from isize/usizeCorey Richardson-8/+8
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-2/+4
2014-07-29syntax: add support for quoting armsErick Tryzelaar-2/+2
2014-07-25librustc: Disallow mutation and assignment in pattern guards, and modifyPatrick Walton-11/+13
the CFG for match statements. There were two bugs in issue #14684. One was simply that the borrow check didn't know about the correct CFG for match statements: the pattern must be a predecessor of the guard. This disallows the bad behavior if there are bindings in the pattern. But it isn't enough to prevent the memory safety problem, because of wildcards; thus, this patch introduces a more restrictive rule, which disallows assignments and mutable borrows inside guards outright. I discussed this with Niko and we decided this was the best plan of action. This breaks code that performs mutable borrows in pattern guards. Most commonly, the code looks like this: impl Foo { fn f(&mut self, ...) {} fn g(&mut self, ...) { match bar { Baz if self.f(...) => { ... } _ => { ... } } } } Change this code to not use a guard. For example: impl Foo { fn f(&mut self, ...) {} fn g(&mut self, ...) { match bar { Baz => { if self.f(...) { ... } else { ... } } _ => { ... } } } } Sometimes this can result in code duplication, but often it illustrates a hidden memory safety problem. Closes #14684. [breaking-change]
2014-06-29librustc: Remove the fallback to `int` for integers and `f64` forPatrick Walton-7/+7
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-05-15Unit tests for flowgraph pretty printing.Felix S. Klock II-0/+33
Each test works by rendering the flowgraph for the last identified block we see in expanded pretty-printed output, and comparing it (via `diff`) against a checked in "foo.dot-expected.dot" file. Each test post-processes the output to remove NodeIds ` (id=NUM)` so that the expected output is somewhat stable (or at least independent of how we assign NodeIds) and easier for a human to interpret when looking at the expected output file itself. ---- Test writing style notes: I usually tried to write the tests in a way that would avoid duplicate labels in the output rendered flow graph, when possible. The tests that have string literals "unreachable" in the program text are deliberately written that way to remind the reader that the unreachable nodes in the resulting graph are not an error in the control flow computation, but rather a natural consequence of its construction.