Commit Graph

30321 Commits

Author SHA1 Message Date
Alex Crichton
812637e683 test: Fix tests for crate_id removal
This involved removing some tests whose functionality was removed such as many
of the crateresolve tests
2014-07-05 12:46:42 -07:00
Alex Crichton
cc3c8bbfaf rustc: Add a flag for specifying dependencies
This comit implements a new flag, --extern, which is used to specify where a
crate is located. The purpose of this flag is to bypass the normal crate
loading/matching of the compiler to point it directly at the right file.

This flag takes the form `--extern foo=bar` where `foo` is the name of a crate
and `bar` is the location at which to find the crate. Multiple `--extern`
directives are allowed with the same crate name to specify the rlib/dylib pair
for a crate. It is invalid to specify more than one rlib or more than one dylib,
and it's required that the crates are valid rust crates.

I have also added some extensive documentation to metadata::loader about how
crate loading should work.

RFC: 0035-remove-crate-id
2014-07-05 12:45:42 -07:00
Alex Crichton
df4ea9c39a rustc: Stop putting hashes in filenames by default
The compiler will no longer insert a hash or version into a filename by default.
Instead, all output is simply based off the crate name being compiled. For
example, a crate name of `foo` would produce the following outputs:

* bin => foo
* rlib => libfoo.rlib
* dylib => libfoo.{so,dylib} or foo.dll
* staticlib => libfoo.a

The old behavior has been moved behind a new codegen flag,
`-C extra-filename=<hash>`. For example, with the "extra filename" of `bar` and
a crate name of `foo`, the following outputs would be generated:

* bin => foo (same old behavior)
* rlib => libfoobar.rlib
* dylib => libfoobar.{so,dylib} or foobar.dll
* staticlib => libfoobar.a

The makefiles have been altered to pass a hash by default to invocations of
`rustc` so all installed rust libraries will have a hash in their filename. This
is done because the standard libraries are intended to be installed into
privileged directories such as /usr/local. Additionally, it involves very few
build system changes!

RFC: 0035-remove-crate-id
[breaking-change]
2014-07-05 12:45:42 -07:00
Alex Crichton
e44c2b9bbc Add #[crate_name] attributes as necessary 2014-07-05 12:45:42 -07:00
Alex Crichton
c956b70d7b rustc: Modify crate loading to ignore versions
This commit modifies crate loading to purely work off a `crate_name` and nothing
else. This commit also changes the patterns recognized from `lib<foo>-*` to
`lib<foo>*` to accomodate the future renamings of output files.

RFC: 0035-remove-crate-id
2014-07-05 12:38:42 -07:00
Alex Crichton
1007739b20 rustc: Add a new codegen flag, -C metadata=foo
This metadata is used to drive the hash of all symbols in a crate. The flag can
be specified a multiple number of times

RFC: 0035-remove-crate-id
2014-07-05 12:38:42 -07:00
Alex Crichton
50ee1ec1b4 rustc: Remove CrateId and all related support
This commit removes all support in the compiler for the #[crate_id] attribute
and all of its derivative infrastructure. A list of the functionality removed is:

* The #[crate_id] attribute no longer exists
* There is no longer the concept of a version of a crate
* Version numbers are no longer appended to symbol names
* The --crate-id command line option has been removed

To migrate forward, rename #[crate_id] to #[crate_name] and only the name of the
crate itself should be mentioned. The version/path of the old crate id should be
removed.

For a transitionary state, the #[crate_id] attribute is still accepted if
the #[crate_name] is not present, but it is warned about if it is the only
identifier present.

RFC: 0035-remove-crate-id
[breaking-change]
2014-07-05 12:38:42 -07:00
bors
aaff4e05e1 auto merge of #15429 : kballard/rust/vim_tab_conventions, r=pcwalton 2014-07-05 16:26:44 +00:00
bors
98eb5f7498 auto merge of #15428 : phildawes/rust/master, r=huonw
Fix small bug introduced in e38cb972dc: PatIdent span was incorrect
because self.last_span was being used before the ident token was
parsed.
2014-07-05 14:41:44 +00:00
bors
c8bbba9a4b auto merge of #15427 : aochagavia/rust/parse, r=pcwalton 2014-07-05 12:56:44 +00:00
bors
342321def6 auto merge of #15442 : luqmana/rust/odp, r=pnkfelix
Inadvertently changed the order in which destructors ran in certain cases with #15076.

Fixes #15438.
2014-07-05 11:11:47 +00:00
bors
e0d3cf6b2a auto merge of #15418 : pnkfelix/rust/fsk-revise-VecPerParamSpace, r=pcwalton
In my informal measurements, this brings the peak memory usage when
building librustc from 1662M down to 1502M.  Since 1662 - 1502 = 160,
this may not recover the entirety of the observed memory regression
(250M) from PR #14604.  (However, according to my local measurements,
the regression when building librustc was more like 209M, so perhaps
this will still recover the lions share of the lost memory.)
2014-07-05 08:31:48 +00:00
bors
b00f4ec8f1 auto merge of #15414 : zsiciarz/rust/patch-1, r=alexcrichton 2014-07-05 06:46:47 +00:00
bors
d611800a70 auto merge of #15284 : apoelstra/rust/bitv-methods, r=cmr
The types `Bitv` and `BitvSet` are badly out of date. This PR:
- cleans up the code (primarily, simplifies `Bitv` and implements `BitvSet` in terms of `Bitv`)
- implements several new traits for `Bitv`
- adds new functionality to `Bitv` and `BitvSet`
- replaces internal iterators with external ones
- updates documentation
- minor bug fixes

This is a significantly souped-up version of PR #15139 and is the result of the discussion there.
2014-07-05 05:01:49 +00:00
Felix S. Klock II
4459fe3e5e Revise VecPerParamSpace to use a one Vec rather than three.
In my informal measurements, this brings the peak memory usage when
building librustc from 1662M down to 1502M.  Since 1662 - 1502 = 160,
this may not recover the entirety of the observed memory regression
(250M) from PR #14604.  (However, according to my local measurements,
the regression when building librustc was more like 209M, so perhaps
this will still recover the lions share of the lost memory.)
2014-07-05 06:29:27 +02:00
Felix S. Klock II
952dded81a Refactored VecPerParamSpace to hide exposure of Vec representation.
This basically meant changing the interface so that no borrowed `&Vec`
is exposed, by hiding `fn get_vec` and `fn get_mut_vec` and revising
`fn all_vecs`.

Instead, clients should use one of the other methods; `get_slice`,
`pop`, `truncate`, `replace`, `push_all`, or `is_empty_in`, which
should work for any case currently used in rustc.
2014-07-05 06:29:06 +02:00
bors
29d6a8ecc6 auto merge of #15425 : jbclements/rust/hygiene-for-3-kinds-of-args, r=cmr
This pull request adds hygiene for 3 kinds of argument bindings:
- arguments to item fns,
- arguments to `ExprFnBlock`s, and
- arguments to `ExprProc`s

It also adds a bunch of unit tests, fixes a few macro uses to be non-capturing, and has a few cleanup items.

local `make check` succeeds.
2014-07-05 03:16:50 +00:00
bors
9f2a43c1b5 auto merge of #15419 : erickt/rust/json, r=pcwalton
This speeds up json serialization by removing most of the allocations.
2014-07-05 01:31:52 +00:00
Luqman Aden
1af8663579 librustc: Make sure to run destructors in the right order when matching on moved value. 2014-07-04 18:05:09 -07:00
Erick Tryzelaar
67c8a8d5dd serialize: speed up json pretty printing by batch writing spaces 2014-07-04 16:56:23 -07:00
bors
459f155f81 auto merge of #15415 : dgoon/rust/master, r=alexcrichton 2014-07-04 23:46:44 +00:00
Erick Tryzelaar
717de500ee serialize: escaping json strings should write in batches.
This significantly speeds up encoding json strings.
2014-07-04 16:36:49 -07:00
Kevin Ballard
4c1fdd065b vim: set Rust tab conventions 2014-07-04 14:09:47 -07:00
Phil Dawes
9deeaefdbb Parser: fix PatIdent span bug
Fix small bug introduced in e38cb972dc: PatIdent span was incorrect
because self.last_span was being used before the ident token was
parsed.
2014-07-04 21:54:42 +01:00
bors
9897160523 auto merge of #15412 : dotdash/rust/builder, r=alexcrichton 2014-07-04 20:46:38 +00:00
Adolfo Ochagavía
45e52a13e8 Removed unnecessary method in test 2014-07-04 22:39:50 +02:00
John Clements
cc13f9bae8 implement hygiene for ExprFnBlock and ExprProc 2014-07-04 13:20:14 -07:00
John Clements
ff9995e089 added test cases for closure arg hygiene 2014-07-04 13:20:14 -07:00
John Clements
63fb7c6f40 comments only 2014-07-04 13:20:14 -07:00
John Clements
3e99309bfc make any_pat! and u64_from_be_bytes_bench_impl! macros hygienic 2014-07-04 13:20:14 -07:00
John Clements
0ba15c99f3 hygiene for item fn args
also, introduce fn_decl_arg_bindings and expand_and_rename abstractions
2014-07-04 13:20:14 -07:00
John Clements
92708322fd comments & test cases for IdentRenamers 2014-07-04 13:20:14 -07:00
John Clements
6bee3c87c9 use PatIdentRenamer for match bindings 2014-07-04 13:20:13 -07:00
John Clements
35175f015f comments only 2014-07-04 13:20:13 -07:00
John Clements
aa91ef0cf8 new_mark -> apply_mark, new_rename -> apply_rename 2014-07-04 13:20:06 -07:00
John Clements
b8cd7f7c6d add PatIdentRenamer 2014-07-04 12:08:04 -07:00
John Clements
9fdaa948c0 move RenameList to mtwt, add new_renames abstraction 2014-07-04 12:07:51 -07:00
John Clements
f126eacd11 comments, whitespace, rename NameFinderContext to PatIdentFinder 2014-07-04 12:05:43 -07:00
bors
935da0739e auto merge of #15405 : pcwalton/rust/delifetime, r=nick29581
This was parsed by the parser but completely ignored; not even stored in
the AST!

This breaks code that looks like:

    static X: &'static [u8] = &'static [1, 2, 3];

Change this code to the shorter:

    static X: &'static [u8] = &[1, 2, 3];

Closes #15312.

[breaking-change]

r? @nick29581
2014-07-04 19:01:33 +00:00
Erick Tryzelaar
83f9f07ec4 serialize: Remove allocations from escaping strs and indenting spaces 2014-07-04 11:08:38 -07:00
bors
25e8b6ed9c auto merge of #15404 : vhbit/rust/ios-ptr-fixes, r=pcwalton 2014-07-04 17:16:29 +00:00
bors
c9e2ca0dfa auto merge of #15051 : retep998/rust/master, r=alexcrichton
This implementation does have the minor issue of not handling things correctly when a codepoint is split across multiple writes or reads, but its better than not having unicode support at all.

Adds a Windows specific struct `WindowsTTY` in `libnative` and make `tty_open` create that struct on Windows. Adds needed functions and constants to `c_win32.rs`.

Libuv still needs to be updated before #15028 can be closed.
2014-07-04 15:31:27 +00:00
Peter Atashian
a34fd5a1bb windows: Unicode console support.
Adds a WindowsTTY for libnative that converts between UTF-8 and UTF-16.

Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-07-04 10:45:28 -04:00
dgoon
4c9cca41a8 add a missing closing parens 2014-07-04 23:43:16 +09:00
bors
04ac2b087e auto merge of #15403 : vhbit/rust/ios-llvm-fixme, r=pcwalton
It was required to get iOS compilable but since
that time a couple of changes were introduced
which cause the same bug to re-appear and broke 
build anyway. Fixing all of them doesn’t look a 
viable alternative to me as it will pollute the 
code too much.

So it should be fixed from LLVM side and I hope 
LLVM will upstream corresponding changes in a 
month.

Meanwhile, who wants to play with Rust on iOS is 
better to use a fork which uses patched LLVM:
https://github.com/vhbit/rust/tree/ios . It may 
lag behind master a bit, but it is Travis-checked 
to compile successfully.
2014-07-04 13:46:25 +00:00
Zbigniew Siciarz
a4b1361a01 Fixed Result type parameters in doc comment. 2014-07-04 15:23:17 +02:00
Björn Steinbrink
db44468de0 trans::foreign: Simplify some code by using our builder impl 2014-07-04 14:50:36 +02:00
bors
c0b76abf91 auto merge of #15388 : jakub-/rust/issue-12285, r=pcwalton
Unit-like struct patterns are irrefutable, no need for a branch.

And some cleanup while I'm at it.
2014-07-04 12:01:22 +00:00
bors
36d7d746c8 auto merge of #15387 : huonw/rust/toc-space, r=alexcrichton
A margin for the top level list was leaking into nested ones.

before; after:

![screenshot from 2014-07-04 08 18 32](https://cloud.githubusercontent.com/assets/1203825/3476459/0b7f8ea8-0300-11e4-8b67-0c47b7931d56.png)
2014-07-04 10:16:21 +00:00
bors
5012b858ed auto merge of #15378 : mdinger/rust/Issue_15333, r=alexcrichton
Here's the issue: https://github.com/rust-lang/rust/issues/15333

Tested it. It works. FYI, in case anyone doesn't know: keyboard shortcut `'` restricts text search to only links on Firefox allowing this to be checked easily.
2014-07-04 08:31:20 +00:00