about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2014-02-21auto merge of #12419 : huonw/rust/compiler-unsafe, r=alexcrichtonbors-0/+17
Previously an `unsafe` block created by the compiler (like those in the formatting macros) would be "ignored" if surrounded by `unsafe`, that is, the internal unsafety would be being legitimised by the external block: unsafe { println!("...") } =(expansion)=> unsafe { ... unsafe { ... } } And the code in the inner block would be using the outer block, making it considered used (and the inner one considered unused). This patch forces the compiler to create a new unsafe context for compiler generated blocks, so that their internal unsafety doesn't escape to external blocks. Fixes #12418.
2014-02-21Changed NonCamelCaseTypes lint to warn by defaultmr.Shu-0/+3
Added allow(non_camel_case_types) to librustc where necesary Tried to fix problems with non_camel_case_types outside rustc fixed failing tests Docs updated Moved #[allow(non_camel_case_types)] a level higher. markdown.rs reverted Fixed timer that was failing tests Fixed another timer
2014-02-20Re-work loading crates with nicer errorsAlex Crichton-0/+45
This commit rewrites crate loading internally in attempt to look at less metadata and provide nicer errors. The loading is now split up into a few stages: 1. Collect a mapping of (hash => ~[Path]) for a set of candidate libraries for a given search. The hash is the hash in the filename and the Path is the location of the library in question. All candidates are filtered based on their prefix/suffix (dylib/rlib appropriate) and then the hash/version are split up and are compared (if necessary). This means that if you're looking for an exact hash of library you don't have to open up the metadata of all libraries named the same, but also in your path. 2. Once this mapping is constructed, each (hash, ~[Path]) pair is filtered down to just a Path. This is necessary because the same rlib could show up twice in the path in multiple locations. Right now the filenames are based on just the crate id, so this could be indicative of multiple version of a crate during one crate_id lifetime in the path. If multiple duplicate crates are found, an error is generated. 3. Now that we have a mapping of (hash => Path), we error on multiple versions saying that multiple versions were found. Only if there's one (hash => Path) pair do we actually return that Path and its metadata. With this restructuring, it restructures code so errors which were assertions previously are now first-class errors. Additionally, this should read much less metadata with lots of crates of the same name or same version in a path. Closes #11908
2014-02-20auto merge of #12405 : kud1ing/rust/backticks, r=huonwbors-6/+6
2014-02-20auto merge of #12398 : alexcrichton/rust/rlibs-and-dylibs-2, r=cmrbors-0/+59
The new methodology can be found in the re-worded comment, but the gist of it is that -C prefer-dynamic doesn't turn off static linkage. The error messages should also be a little more sane now. Closes #12133
2014-02-20rustc: avoid compiler generated `unsafe` blocks leaking.Huon Wilson-0/+17
Previously an `unsafe` block created by the compiler (like those in the formatting macros) would be "ignored" if surrounded by `unsafe`, that is, the internal unsafety would be being legitimised by the external block: unsafe { println!("...") } =(expansion)=> unsafe { ... unsafe { ... } } And the code in the inner block would be using the outer block, making it considered used (and the inner one considered unused). This patch forces the compiler to create a new unsafe context for compiler generated blocks, so that their internal unsafety doesn't escape to external blocks. Fixes #12418.
2014-02-19librustc: Remove unique vector patterns from the language.Patrick Walton-18/+42
Preparatory work for removing unique vectors from the language, which is itself preparatory work for dynamically sized types.
2014-02-19adjust to currently used stylekud1ing-6/+6
2014-02-19Tweak how preference factors into linkageAlex Crichton-0/+59
The new methodology can be found in the re-worded comment, but the gist of it is that -C prefer-dynamic doesn't turn off static linkage. The error messages should also be a little more sane now. Closes #12133
2014-02-19auto merge of #12370 : rcxdude/rust/macro_fix, r=alexcrichtonbors-0/+19
Closes #11692. Instead of returning the original expression, a dummy expression (with identical span) is returned. This prevents infinite loops of failed expansions as well as odd double error messages in certain situations. This is a slightly better fix than #12197, because it does not produce a double error and also fixes a few other cases where an infinite loop could happen. This does not fix the other issue in #11692 (non-builtin macros not being recognised when expanded inside macros), which I think should be moved into a separate issue.
2014-02-18auto merge of #12245 : nick29581/rust/priv2, r=alexcrichtonbors-0/+157
closes #4110
2014-02-19Make priavcy checking aware that a `use` directive can point to two ↵Nick Cameron-0/+157
defintions (namespaces) with different privacy. Closes #4110
2014-02-18auto merge of #12336 : kballard/rust/mutexarc-no-freeze, r=alexcrichtonbors-26/+0
With Rc no longer trying to statically prevent cycles (and thus no longer using the Freeze bound), it seems appropriate to remove that restriction from MutexArc as well. Closes #9251.
2014-02-18Avoid returning original macro if expansion fails.Douglas Young-0/+19
Closes #11692. Instead of returning the original expression, a dummy expression (with identical span) is returned. This prevents infinite loops of failed expansions as well as odd double error messages in certain situations.
2014-02-18auto merge of #12351 : kud1ing/rust/backticks, r=alexcrichtonbors-3/+3
2014-02-17backticks for syntax elementskud1ing-3/+3
2014-02-17Remove the compile-fail test that's now obsoleteKevin Ballard-26/+0
2014-02-17Forbid use of generics with foreign functions. Closes #10353.Nick Cameron-0/+15
2014-02-15auto merge of #12301 : FlaPer87/rust/issue-8893, r=alexcrichtonbors-0/+19
2014-02-16Add test and close #8893Flavio Percoco-0/+19
2014-02-15auto merge of #12272 : alexcrichton/rust/snapshot, r=kballardbors-116/+116
This notably contains the `extern mod` => `extern crate` change. Closes #9880
2014-02-15std: clean up ptr a bitCorey Richardson-3/+1
2014-02-14extern mod => extern crateAlex Crichton-116/+116
This was previously implemented, and it just needed a snapshot to go through
2014-02-14Test fixes and rebase conflicts from rollupsAlex Crichton-1/+5
PRs closed as part of this: Closes #12212 r=alexcrichton Closes #12215 r=brson Closes #12246 r=pcwalton Closes #12247 r=cmr Closes #12251 r=brson Closes #12255 r=alexcrichton Closes #12257 r=alexcrichton Closes #12258 r=huonw Closes #12259 r=huonw Closes #12263 r=kballard Closes #12269 r=alexcrichton
2014-02-14Ensure an error is raised on infinite recursionFlavio Percoco-0/+24
2014-02-14Refactored ast_map and friends, mainly to have Paths without storing them.Eduard Burtescu-4/+4
2014-02-13Remove obsolete warnings for `extern mod`Flavio Percoco-5/+0
This patch gets rid of ObsoleteExternModAttributesInParens and ObsoleteNamedExternModule since the replacement of `extern mod` with `extern crate` avoids those cases and raises different errors. Both have been around for at least a version which makes this a good moment to get rid of them.
2014-02-13Replace `extern mod` with `extern crate`Flavio Percoco-0/+28
This patch adds a new keyword `crate` which is intended to replace mod in the context of `extern mod` as part of the issue #9880. The patch doesn't replace all `extern mod` cases since it is necessary to first push a new snapshot 0. The implementation could've been less invasive than this. However I preferred to take this chance to split the `parse_item_foreign_mod` method and pull the `extern crate` part out of there, hence the new method `parse_item_foreign_crate`.
2014-02-12auto merge of #12165 : fhahn/rust/change-some-tests, r=alexcrichtonbors-44/+13
While working on #11363 I stumbled over a couple of ignored tests, that seem to be fixed or invalid. * src/test/run-pass/issue-3559.rs was fixed in #4726 * src/test/compile-fail/borrowck-call-sendfn.rs was fixed in #2978 * update src/test/compile-fail/issue-5500-1.rs to work with current Rust (I'm not 100% sure if the original condition is tested as mentioned in #5500, but I think so) * removed src/test/compile-fail/issue-5500.rs because it is tested in src/test/run-fail/issue-5500.rs (they are the same test cases, I just renamed src/test/run-fail/addr-of-bot.rs to be consistent with the other issue name
2014-02-12Reenable some ignored test casesFlorian Hahn-44/+13
* src/test/run-pass/issue-3559.rs was fixed in #4726 * src/test/compile-fail/borrowck-call-sendfn.rs was fixed in #2978 * update src/test/compile-fail/issue-5500-1.rs to work with current Rust * removed src/test/compile-fail/issue-5500.rs because it is tested in src/test/run-fail/issue-5500.rs * src/test/compile-fail/view-items-at-top.rs fixed * #897 fixed * compile-fail/issue-6762.rs issue was closed as dup of #6801 * deleted compile-fail/issue-2074.rs because it became irelevant and is irrelevant #2074, a test covering this was added in 4f92f452bd701fb39156d66d4756cc48cc396a8a
2014-02-12auto merge of #12190 : alexcrichton/rust/fix-snap-again, r=brsonbors-5/+5
Loadable syntax extensions don't work when cross compiling (see #12102), so the fourcc tests all need to be ignored. They're valuable tests, so they shouldn't be outright ignored, so they're now flagged with ignore-cross-compile
2014-02-11Rewrite channels yet again for upgradeabilityAlex Crichton-1/+1
This, the Nth rewrite of channels, is not a rewrite of the core logic behind channels, but rather their API usage. In the past, we had the distinction between oneshot, stream, and shared channels, but the most recent rewrite dropped oneshots in favor of streams and shared channels. This distinction of stream vs shared has shown that it's not quite what we'd like either, and this moves the `std::comm` module in the direction of "one channel to rule them all". There now remains only one Chan and one Port. This new channel is actually a hybrid oneshot/stream/shared channel under the hood in order to optimize for the use cases in question. Additionally, this also reduces the cognitive burden of having to choose between a Chan or a SharedChan in an API. My simple benchmarks show no reduction in efficiency over the existing channels today, and a 3x improvement in the oneshot case. I sadly don't have a pre-last-rewrite compiler to test out the old old oneshots, but I would imagine that the performance is comparable, but slightly slower (due to atomic reference counting). This commit also brings the bonus bugfix to channels that the pending queue of messages are all dropped when a Port disappears rather then when both the Port and the Chan disappear.
2014-02-11test -- add new tests specifically examining closure borrowsNiko Matsakis-0/+247
2014-02-11test -- update tests with new error messagesNiko Matsakis-82/+85
2014-02-11Add ignore-cross-compile directive for compiletestAlex Crichton-5/+5
Loadable syntax extensions don't work when cross compiling (see #12102), so the fourcc tests all need to be ignored. They're valuable tests, so they shouldn't be outright ignored, so they're now flagged with ignore-cross-compile
2014-02-11Change `xfail` directives in compiletests to `ignore`, closes #11363Florian Hahn-155/+170
2014-02-11auto merge of #12170 : aepsil0n/rust/feature/reserve_do_keyword, r=brsonbors-0/+13
This resolves issue #12157. Does that do it already or is there something else that needs taking care of? As a side note, there seems to be some documentation, in which the old existence of the do keyword is explained. The list of keywords is not up-to-date either. But these are certainly separate issues.
2014-02-11Reserve `do` as a keywordEduard Bopp-0/+13
Resolves issue #12157. `do` is hereby reinstated as a keyword; no syntax is associated with it though. Along the way, a unit test had to be adapted, since it was using `do` as a method identifier. Breaking changes: - Any code using `do` as an identifier will no longer work.
2014-02-11Move replace and swap to std::mem. Get rid of std::utilEdward Wang-13/+6
Also move Void to std::any, move drop to std::mem and reexport in prelude.
2014-02-10Update comment in contravariant testJake Kerr-2/+2
The previous definition was actually describing covariance. Fixing to describe contravariance while keeping 'static in the definition was tricky so just changed to use 'short and 'long.
2014-02-10Consolidate codegen-related compiler flagsAlex Crichton-2/+2
Move them all behind a new -C switch. This migrates some -Z flags and some top-level flags behind this -C codegen option. The -C flag takes values of the form "-C name=value" where the "=value" is optional for some flags. Flags affected: * --llvm-args => -C llvm-args * --passes => -C passes * --ar => -C ar * --linker => -C linker * --link-args => -C link-args * --target-cpu => -C target-cpu * --target-feature => -C target-fature * --android-cross-path => -C android-cross-path * --save-temps => -C save-temps * --no-rpath => -C no-rpath * -Z no-prepopulate => -C no-prepopulate-passes * -Z no-vectorize-loops => -C no-vectorize-loops * -Z no-vectorize-slp => -C no-vectorize-slp * -Z soft-float => -C soft-float * -Z gen-crate-map => -C gen-crate-map * -Z prefer-dynamic => -C prefer-dynamic * -Z no-integrated-as => -C no-integrated-as As a bonus, this also promotes the -Z extra-debug-info flag to a first class -g or --debuginfo flag. * -Z debug-info => removed * -Z extra-debug-info => -g or --debuginfo Closes #9770 Closes #12000
2014-02-09auto merge of #12117 : ↵bors-0/+5
nikomatsakis/rust/issue-11913-borrow-in-aliasable-loc, r=pcwalton Repair a rather embarassingly obvious hole that I created as part of #9629. In particular, prevent `&mut` borrows of data in an aliasable location. This used to be prevented through the restrictions mechanism, but in #9629 I modified those rules incorrectly. r? @pcwalton Fixes #11913
2014-02-08Allow codepoints 128-255 in fourc!!Yuri Kunde Schlesner-1/+1
Codepoints with those values will be interpreted as bytes with their raw codepoint value. ('\xAB' -> 0xABu8, etc.) Codepoints > 255 remain forbidden.
2014-02-08Converted fourcc! to loadable syntax extensionDerek Guenther-4/+49
2014-02-08Add new syntax extension fourcc!()Kevin Ballard-0/+66
fourcc!() allows you to embed FourCC (or OSType) values that are evaluated as u32 literals. It takes a 4-byte ASCII string and produces the u32 resulting in interpreting those 4 bytes as a u32, using either the platform-native endianness, or explicitly as big or little endian.
2014-02-08Make &mut borrows restrict aliasingNiko Matsakis-0/+5
Fixes #11913
2014-02-08Fixed error starting with uppercasemr.Shu-19/+19
Error messages cleaned in librustc/middle Error messages cleaned in libsyntax Error messages cleaned in libsyntax more agressively Error messages cleaned in librustc more aggressively Fixed affected tests Fixed other failing tests Last failing tests fixed
2014-02-08Update docs and tests for #[deriving(Show)].Huon Wilson-0/+100
2014-02-07Added tests to make tidyDerek Guenther-67/+948
2014-02-07Removed @self and @Trait.Eduard Burtescu-106/+20