Commit Graph

914 Commits

Author SHA1 Message Date
bors
c23a9d42ea Auto merge of #25387 - eddyb:syn-file-loader, r=nikomatsakis
This allows compiling entire crates from memory or preprocessing source files before they are tokenized.

Minor API refactoring included, which is a [breaking-change] for libsyntax users:
* `ParseSess::{next_node_id, reserve_node_ids}` moved to rustc's `Session`
* `new_parse_sess` -> `ParseSess::new`
* `new_parse_sess_special_handler` -> `ParseSess::with_span_handler`
* `mk_span_handler` -> `SpanHandler::new`
* `default_handler` -> `Handler::new`
* `mk_handler` -> `Handler::with_emitter`
* `string_to_filemap(sess source, path)` -> `sess.codemap().new_filemap(path, source)`
2015-05-17 00:05:34 +00:00
bors
d332aead90 Auto merge of #25434 - dotdash:gep, r=alexcrichton
Using regular pointer arithmetic to iterate collections of zero-sized types
doesn't work, because we'd get the same pointer all the time. Our
current solution is to convert the pointer to an integer, add an offset
and then convert back, but this inhibits certain optimizations.

What we should do instead is to convert the pointer to one that points
to an i8\*, and then use a LLVM GEP instructions without the inbounds
flag to perform the pointer arithmetic. This allows to generate pointers
that point outside allocated objects without causing UB (as long as you
don't dereference them), and it wraps around using two's complement,
i.e. it behaves exactly like the wrapping_* operations we're currently
using, with the added benefit of LLVM being able to better optimize the
resulting IR.
2015-05-16 19:17:30 +00:00
Alex Crichton
0e21beb761 libs: Move favicon URLs to HTTPS
Helps prevent mixed content warnings if accessing docs over HTTPS.

Closes #25459
2015-05-15 16:04:01 -07:00
Björn Steinbrink
eeeb2cc0df Allow for better optimizations of iterators for zero-sized types
Using regular pointer arithmetic to iterate collections of zero-sized types
doesn't work, because we'd get the same pointer all the time. Our
current solution is to convert the pointer to an integer, add an offset
and then convert back, but this inhibits certain optimizations.

What we should do instead is to convert the pointer to one that points
to an i8*, and then use a LLVM GEP instructions without the inbounds
flag to perform the pointer arithmetic. This allows to generate pointers
that point outside allocated objects without causing UB (as long as you
don't dereference them), and it wraps around using two's complement,
i.e. it behaves exactly like the wrapping_* operations we're currently
using, with the added benefit of LLVM being able to better optimize the
resulting IR.
2015-05-15 15:30:22 +02:00
Nick Cameron
7555e7081d comments 2015-05-15 19:06:56 +12:00
Nick Cameron
7ca560d6ab save-analysis: fix a bracket counting bug 2015-05-14 22:05:52 +12:00
Nick Cameron
83c6a12a54 save-analysis: start factoring out an API 2015-05-14 22:05:52 +12:00
Nick Cameron
c8ddb0f070 Extract PathCollector 2015-05-14 15:28:17 +12:00
Nick Cameron
cea73bfb15 move out function data 2015-05-14 15:28:01 +12:00
Nick Cameron
b248ee8746 Use the new-style API for external crate listings 2015-05-14 15:28:01 +12:00
Nick Cameron
4f9b04bf9e save-analysis: move csv dumping stuff to its own module and rename 2015-05-14 15:27:32 +12:00
Eduard Burtescu
f786437bd2 syntax: refactor (Span)Handler and ParseSess constructors to be methods. 2015-05-14 01:47:56 +03:00
bors
af41097b49 Auto merge of #25333 - GSam:master, r=nrc
As it is, save-analysis appears to return the span for the 'mut' in a declaration 'static mut identifier...' instead of the identifier. This minor change appears to fix the problem, by skipping the mut when it is present.
2015-05-13 13:54:48 +00:00
Nick Cameron
5d4cce6cec Rebasing 2015-05-13 14:35:53 +12:00
Nick Cameron
03d4d5f80e Fix a bunch of bugs
* segfault due to not copying drop flag when coercing
* fat pointer casts
* segfault due to not checking drop flag properly
* debuginfo for DST smart pointers
* unreachable code in drop glue
2015-05-13 14:19:51 +12:00
Nick Cameron
843db01bd9 eddyb's changes for DST coercions
+ lots of rebasing
2015-05-13 14:19:51 +12:00
Garming Sam
46753dacb1 Record correct span for static mut items 2015-05-13 01:32:12 +12:00
bors
7334518579 Auto merge of #25085 - carols10cents:remove-old-tilde, r=steveklabnik
There were still some mentions of `~[T]` and `~T`, mostly in comments and debugging statements. I tried to do my best to preserve meaning, but I might have gotten some wrong-- I'm happy to fix anything :)
2015-05-11 04:46:41 +00:00
Barosl Lee
ff332b6467 Squeeze the last bits of tasks in documentation in favor of thread
An automated script was run against the `.rs` and `.md` files,
subsituting every occurrence of `task` with `thread`. In the `.rs`
files, only the texts in the comment blocks were affected.
2015-05-09 02:24:18 +09:00
Steve Klabnik
0084ba934d Rollup merge of #25160 - michaelwu:remove-schedule_free_slice, r=cmr
Nothing uses it anymore.
2015-05-07 12:21:05 +02:00
bors
347ee73ef7 Auto merge of #24964 - tamird:cleanup-bitflags, r=alexcrichton
Depends on #24921. r? @alexcrichton
2015-05-07 02:14:30 +00:00
Michael Wu
bfdbda24d9 Remove schedule_free_slice
Nothing uses it anymore.
2015-05-06 17:09:55 -04:00
Tamir Duberstein
e95241bf28 Don't repeat Attribute in the const names 2015-05-05 22:03:45 -04:00
Tamir Duberstein
5cfa713a1c Use empty() instead of a special const 2015-05-05 22:03:45 -04:00
bors
7bd71637ca Auto merge of #25134 - alexcrichton:fix-issue-25072-for-realsies, r=brson
Turns out that a verbatim path was leaking through to gcc via the PATH
environment variable (pointing to the bundled gcc provided by the main
distribution) which was wreaking havoc when gcc itself was run. The fix here is
to just stop passing verbatim paths down by adding more liberal uses of
`fix_windows_verbatim_for_gcc`.

Closes #25072
2015-05-06 00:54:55 +00:00
Alex Crichton
2dc0e56163 rustc: Fix more verbatim paths leaking to gcc
Turns out that a verbatim path was leaking through to gcc via the PATH
environment variable (pointing to the bundled gcc provided by the main
distribution) which was wreaking havoc when gcc itself was run. The fix here is
to just stop passing verbatim paths down by adding more liberal uses of
`fix_windows_verbatim_for_gcc`.

Closes #25072
2015-05-05 15:21:52 -07:00
Carol Nichols
abc0017f3b Remove an obsolete example in a comment 2015-05-04 21:44:22 -04:00
Carol Nichols
77acf7b4ee Use the lowercase version of the box syntax 2015-05-04 21:43:11 -04:00
Alex Crichton
e6c23bb893 rustc_trans: Fix another windows verbatim path
This was one last spot where directories were being leaked through with
arguments of the form `\\?\` which neither `ld.exe` nor `gcc.exe` does
understands so the prefix needed to be stripped.

Closes #25072
2015-05-04 13:18:00 -07:00
Carol Nichols
232b2022b5 Update debuginfo metadata to use Box instead of ~
Also remove comments that reference the unique_type_id HEAP_VEC_BOX
metadata, which was removed in 3e62637 and the unique_type_id GC_BOX
metadata, which was removed in 8a91d33.
2015-05-03 20:16:03 -04:00
Carol Nichols
7ec8172225 Update old uses of ~ in comments and debugging statements 2015-05-03 20:16:02 -04:00
Luqman Aden
715605faf9 librustc_trans: Handle DST structs in trans::_match. 2015-05-03 05:36:04 -04:00
bors
f3345cb0a7 Auto merge of #24778 - nagisa:managed-removal, r=huonw
Leftovers from @-pointer times, I guess.
2015-05-01 19:17:45 +00:00
Simonas Kazlauskas
a23d7e10c7 Remove Managed
Leftovers from @-pointer times.
2015-05-01 10:58:42 +03:00
Ariel Ben-Yehuda
bd1f73420a Stop using Rc in TraitRef and TraitDef
The former stopped making sense when we started interning substs and made
TraitRef a 2-word copy type, and I'm moving the latter into an arena as
they live as long as the type context.
2015-04-30 15:09:11 +03:00
Alex Crichton
2edb6438cb rollup merge of #24921: tamird/bitflags-associated-const
Conflicts:
	src/librustc/lib.rs
2015-04-29 15:49:07 -07:00
Alex Crichton
416e4127e9 rollup merge of #24930: nrc/save-fn 2015-04-29 15:45:50 -07:00
Alex Crichton
7510bfebb6 rollup merge of #24917: zecozephyr/nullptropt 2015-04-29 15:45:47 -07:00
Alex Crichton
91dfc38979 rollup merge of #24903: pnkfelix/fsk-enum-swapindrop
rename `schedule_drop_{enum,adt}_contents`.

addresses review nit from #24765 (it was my mistake for not doing this earlier before it landed).
2015-04-29 15:45:44 -07:00
Alex Crichton
783b4bbf69 rollup merge of #24886: GBGamer/master
These are useful when you want to catch the signals, like when you're making a kernel, or if you just don't want the overhead. (I don't know if there are any of the second kind of people, I don't think it's a good idea, but hey, choice is good).
2015-04-29 15:45:42 -07:00
Alex Crichton
dfb60802c5 rollup merge of #24833: tari/rfc888
Closes #24118, implementing RFC 888.
2015-04-29 15:45:36 -07:00
Alex Crichton
3434469b51 rollup merge of #24762: nrc/mod-debug-2
Closes #20780

r? @michaelwoerister

I'm sure this could be done better with deeper knowledge of debuginfo, but this seems like a good start.
2015-04-29 15:45:35 -07:00
Alex Crichton
e14af089a4 rollup merge of #24711: alexcrichton/fs2.1
This commit is an implementation of [RFC 1044][rfc] which adds additional
surface area to the `std::fs` module. All new APIs are `#[unstable]` behind
assorted feature names for each one.

[rfc]: https://github.com/rust-lang/rfcs/pull/1044

The new APIs added are:

* `fs::canonicalize` - bindings to `realpath` on unix and
  `GetFinalPathNameByHandle` on windows.
* `fs::symlink_metadata` - similar to `lstat` on unix
* `fs::FileType` and accessor methods as `is_{file,dir,symlink}`
* `fs::Metadata::file_type` - accessor for the raw file type
* `fs::DirEntry::metadata` - acquisition of metadata which is free on Windows
  but requires a syscall on unix.
* `fs::DirEntry::file_type` - access the file type which may not require a
  syscall on most platforms.
* `fs::DirEntry::file_name` - access just the file name without leading
  components.
* `fs::PathExt::symlink_metadata` - convenience method for the top-level
  function.
* `fs::PathExt::canonicalize` - convenience method for the top-level
  function.
* `fs::PathExt::read_link` - convenience method for the top-level
  function.
* `fs::PathExt::read_dir` - convenience method for the top-level
  function.
* `std::os::raw` - type definitions for raw OS/C types available on all
  platforms.
* `std::os::$platform` - new modules have been added for all currently supported
  platforms (e.g. those more specific than just `unix`).
* `std::os::$platform::raw` - platform-specific type definitions. These modules
  are populated with the bare essentials necessary for lowing I/O types into
  their raw representations, and currently largely consist of the `stat`
  definition for unix platforms.

This commit also deprecates `Metadata::{modified, accessed}` in favor of
inspecting the raw representations via the lowering methods of `Metadata`.

Closes https://github.com/rust-lang/rust/issues/24796
2015-04-29 15:45:34 -07:00
Tamir Duberstein
8c58fe1739 Fallout 2015-04-29 08:55:31 -07:00
Nick Cameron
de2a4c0113 save-analysis: fix impl functions 2015-04-29 19:21:18 +12:00
Nick Cameron
7bfb5ed826 Reviewer changes 2015-04-29 18:56:13 +12:00
Nick Cameron
bb26aadaf3 Tidy up 2015-04-29 17:26:22 +12:00
Nick Cameron
88f840bdea debuginfo: extract adt.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
9756349d11 debuginfo: extract metadata.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
024e86fad5 debuginfo: extract types.rs 2015-04-29 17:26:22 +12:00