Commit Graph

19721 Commits

Author SHA1 Message Date
Chris Morgan
121ae82be0 Do indentation properly in Vim.
The cases that this improves are clearly documented inside the
committed file, so this commit message is comparatively brief.
2013-07-10 01:33:30 +10:00
Chris Morgan
cf65870962 Add a Vim filetype plugin with useful tweaks.
This improves things like doc comment handling when you press Enter and
making using `gf` or `<C-W>f` work on a `use x;` statement in the
current directory.
2013-07-10 01:30:32 +10:00
Chris Morgan
3fa4cef876 A few slight tweaks to the Vim syntax file.
- Add fold support (NOT turned on by default)
- Highlight `::` by default
- Support the common `NOTE` as an important note
- Highlight `assert!` and `fail!` differently
- Don't highlight `deriving(...)` except in `#[...]`
2013-07-10 01:27:35 +10:00
bors
62bb843e32 auto merge of #7641 : lucab/rust/lucab/po4a, r=catamorphism
As per https://mail.mozilla.org/pipermail/rust-dev/2013-July/004685.html 

This is the initial machinery to setup the l10n infrastructure for markdown documentation.
A new "docs-l10n" target will take care of generating, updating and then building .pot and .po files, and later on the final .md.

This commit includes the .pot for all current .md docs; they can be feed directly to Mozilla Verbatim if wanted.
Please note that po4a only provides the orig.md -> .pot -> l10n.po -> l10n.md flow. The l10n.md -> l10n.html generation is not currently built in the makefile, as no language has been enabled.
2013-07-09 03:25:29 -07:00
bors
ee102468fa auto merge of #7614 : MarkJr94/rust/smallintmap_enum, r=huonw
Added external iterators as well as tests to SmallIntMap and SmallIntSet. Fixes #7366
2013-07-09 01:22:35 -07:00
bors
ac026e2e69 auto merge of #7578 : alexcrichton/rust/overflow, r=thestinger
This should never cause a segfault, but rather fail somehow. Possibly a condition could be used here, but for now there's not much else to do.
2013-07-08 23:10:35 -07:00
bors
a48ca3290d auto merge of #7262 : nikomatsakis/rust/ref-bindings-in-irrefut-patterns, r=catamorphism
Correct treatment of irrefutable patterns. The old code was wrong in many, many ways. `ref` bindings didn't work, it sometimes copied when it should have moved, the borrow checker didn't even look at such patterns at all, we weren't consistent about preventing values with destructors from being pulled apart, etc.

Fixes #3224.
Fixes #3225.
Fixes #3255.
Fixes #6225.
Fixes #6386.

r? @catamorphism
2013-07-08 18:49:46 -07:00
bors
30c8aac677 auto merge of #7612 : thestinger/rust/utf8, r=huonw 2013-07-08 16:10:53 -07:00
bors
f503e539bf auto merge of #7608 : glinscott/rust/json_perf, r=pcwalton
Avoids the overhead of read_char for every character.

Benchmark reading example.json 10 times from
https://code.google.com/p/rapidjson/wiki/Performance

Before: 2.55s
After:  0.16s

Regression testing is already done by isrustfastyet.
2013-07-08 14:34:54 -07:00
bors
f7b293bc75 auto merge of #7577 : brson/rust/vers, r=cmr 2013-07-08 12:59:21 -07:00
Niko Matsakis
0c6d02f391 Correct merge errors 2013-07-08 13:55:11 -04:00
Niko Matsakis
b5fc4ae918 Correct match-drop-strs-issue-4541 when used in check-fast 2013-07-08 13:55:11 -04:00
Niko Matsakis
a6d64df672 Correct illegal pattern in windows-only code 2013-07-08 13:55:11 -04:00
Niko Matsakis
979d3a54f9 Correct merge failures 2013-07-08 13:55:11 -04:00
Niko Matsakis
ce602c66b8 Add llvm instrumentation 2013-07-08 13:55:11 -04:00
Niko Matsakis
0e81072ded Move stats into an @mut stats 2013-07-08 13:55:11 -04:00
Niko Matsakis
50e95ea481 Fix pretty printer, which was ignoring ref in irrefutable patterns 2013-07-08 13:55:10 -04:00
Niko Matsakis
682e7467dd Patch up some new errors from rustpkg 2013-07-08 13:55:10 -04:00
Niko Matsakis
59083d2c6a Address nits by @catamorphism 2013-07-08 13:55:10 -04:00
Niko Matsakis
af453a33cc This assert does not necessarily hold; sometimes we temporarily increase ref-count 2013-07-08 13:55:10 -04:00
Niko Matsakis
541c45b0b7 Miscellaneous fixes and cleanup 2013-07-08 13:55:10 -04:00
Niko Matsakis
729b07f83c Modify borrow checker to visit irrefutable patterns that appear in
let and function arguments; modify type checker to store type
information for all patterns and handles some missing cases.
2013-07-08 13:55:10 -04:00
Niko Matsakis
2d3262ca7b Update trans to use type to decide when to move, not the moves table (simpler
for cases where it's hard to decide what id to use for the lookup); modify
irrefutable bindings code to move or copy depending on the type, rather than
threading through a flag. Also updates how local variables and arguments are
registered. These changes were hard to isolate.
2013-07-08 13:55:10 -04:00
Niko Matsakis
41efcdf299 Make all allocas named so we can see where they originate
in the generated LLVM code.
2013-07-08 13:55:10 -04:00
Niko Matsakis
90843b6f58 extra: Patch up code that was using irrefutable patterns incorrectly. 2013-07-08 13:53:44 -04:00
Niko Matsakis
366a233dbd syntax: Patch up code that was using irrefutable patterns incorrectly 2013-07-08 13:53:44 -04:00
Niko Matsakis
9999622e44 Patch up some code that was using irrefutable patterns incorrectly. 2013-07-08 13:53:44 -04:00
Niko Matsakis
ba13482dfa update ptr intrinsics and rewrite vec routines to be more correct.
In particular, it is not valid to go around passing uninitialized or zero'd
memory as arguments. Rust should generally be free to assume that the arguments
it gets are valid input values, but the output of intrinsics::uninit() and
intrinsics::init() are not (e.g., an @T is just null, leading to an error
if we should try to increment the ref count).
2013-07-08 13:53:44 -04:00
Niko Matsakis
1670a8cfb1 Add new tests for irrefutable patterns used in various tricky ways 2013-07-08 13:53:44 -04:00
Niko Matsakis
17b3712487 Update existing tests to account for stricter, more correct handling of irrefutable patterns 2013-07-08 13:53:44 -04:00
Brian Anderson
b0a9d8193f Bump version numbers to 0.8-pre 2013-07-08 10:25:45 -07:00
bors
2a8ae0eb4a auto merge of #7604 : apasel422/rust/peek, r=huonw
This can be useful for inserting debugging code at different steps in an iterator pipeline.
2013-07-08 10:22:57 -07:00
bors
ed69ef0b66 auto merge of #7645 : dotdash/rust/immediate_retvals, r=cmr
There are lots of unneeded allocas and Store/Load cycles for calls with
immediate return values. This is a first step towards removing that, allowing
immediate return values to be directly returned from trans_call_inner and
trans_lang_call (for now), instead of always stuffing them into an alloca.

For now, only a few things take advantage of the new behaviour, but this
already saves 16k allocas and 43k lines in total in the unoptimized IR
for librustc. Running "make check" under time shows that CPU time for
the unoptimized test suite is reduced by about 7%.
2013-07-08 06:04:51 -07:00
Björn Steinbrink
00ba8b3ac0 Improve handling of immediate return values
We currently still handle immediate return values a lot like
non-immediate ones. We provide a slot for them and store them into
memory, often just to immediately load them again. To improve this
situation, trans_call_inner has to return a Result which contains the
immediate return value.

Also, it also needs to accept "No destination" in addition to just
SaveIn and Ignore. Since "No destination" isn't something that fits
well into the Dest type, I've chosen to simply use Option<Dest>
instead, paired with an assertion that checks that "None" is only
allowed for immediate return values.
2013-07-08 13:34:13 +02:00
bors
65ed80339b auto merge of #7568 : alexcrichton/rust/check-lite, r=huonw
A lot of cross-platform issues stem from rusti/rustpkg, so include these two test suites in the 'check-lite' target which is run on the cross-compile bots. It shouldn't be much of a performance hit because these suites are pretty fast to run.

Hopefully this will make snapshot/tarball creation easier in the future.
2013-07-08 04:28:53 -07:00
Björn Steinbrink
4a485f8cec Avoid unused allocas for immediate return values
There's no need to allocate a return slot for anykind of immediate
return value, not just not for nils. Also, when the return value is
ignored, we only have to copy it to a temporary alloca if it's actually
required to call drop_ty on it.
2013-07-08 13:17:46 +02:00
bors
48ad726f2a auto merge of #7605 : thestinger/rust/vec, r=Aatch
This is work continued from the now landed #7495 and #7521 pulls.

Removing the headers from unique vectors is another project, so I've separated the allocator.
2013-07-08 02:52:56 -07:00
Daniel Micay
90f1db10fa remove headers from exchange allocations 2013-07-08 04:54:41 -04:00
Daniel Micay
44770ae3a8 Merge pull request #7595 from thestinger/iterator
remove some method resolve workarounds
2013-07-08 01:42:07 -07:00
Daniel Micay
0aedecf96b add a temporary vector_exchange_malloc lang item 2013-07-08 03:41:21 -04:00
Daniel Micay
7bf34c3437 vec: make vec_reserve_shared_actual private 2013-07-08 03:41:21 -04:00
bors
96ae000812 auto merge of #7497 : alexcrichton/rust/issue-7394, r=huonw 2013-07-07 21:34:51 -07:00
bors
e07ae9e6f9 auto merge of #7591 : alexcrichton/rust/fix-warnings, r=huonw
Closes #7589
2013-07-07 19:35:00 -07:00
Alex Crichton
d49acef07b Add rusti/rustpkg to check-lite
Ironically also disable rusti tests for now, but mainly because they're awaiting
LLVM upgrades before proceeding
2013-07-07 19:13:21 -07:00
Alex Crichton
a02e37c397 Fix a warning when generating tests 2013-07-07 19:03:57 -07:00
bors
6d6b1a8bfa auto merge of #7586 : g5pw/rust/master, r=cmr
This updates the script in src/etc/local_stage0.sh to copy the correct libraries
to stage0.
2013-07-07 17:59:03 -07:00
Daniel Micay
641aec7407 remove some method resolve workarounds 2013-07-07 19:51:13 -04:00
Andrew Paseltiner
7bb4ff6267 iterator: Add IteratorUtil::peek_ method 2013-07-07 19:29:37 -04:00
bors
ddf8247d7f auto merge of #7629 : thestinger/rust/rope, r=graydon
It's broken/unmaintained and needs to be rewritten to avoid managed
pointers and needless copies. A full rewrite is necessary and the API
will need to be redone so it's not worth keeping this around (#7628).

Closes #2236, #2744
2013-07-07 15:20:01 -07:00
bors
28643d4135 auto merge of #7456 : graydon/rust/better-trans-stats, r=cmr
This way when you compile with -Z trans-stats you'll get a per-function cost breakdown, sorted with the most expensive functions first. Should help highlight pathological code.
2013-07-07 12:53:06 -07:00