Commit Graph

48694 Commits

Author SHA1 Message Date
bors
8e9a97529d Auto merge of #29530 - jseyfried:resolve, r=nikomatsakis
Replace `TypeNsDef` and `ValueNsDef` with a more general type `NsDef`.

Define a newtype `NameBinding` for `Rc<RefCell<Option<NsDef>>>` and refactor `NameBindings` to be a `NameBinding` for each namespace.

Replace uses of `NameBindings` with `NameBinding` where only one binding is being used (in `NamespaceResult`, `Target,` etc).

Refactor away `resolve_definition_of_name_in_module` and `NameDefinition`, fixing issue #4952.
2015-11-23 17:31:19 +00:00
Michael Woerister
3be1d8ca7d Avoid some code duplication around getting names of numeric types. 2015-11-23 15:59:36 +01:00
Antti Keränen
428e790d8c Add a note when trying to call a non-function
The note added tells the definition location of the non-function
that is being called. Fixes #10969
2015-11-23 16:57:09 +02:00
bors
69b8e74c31 Auto merge of #29998 - fiveop:patch-1, r=steveklabnik 2015-11-23 14:37:35 +00:00
Philipp Matthias Schäfer
e4e03bc74a wording: results don't fail 2015-11-23 09:39:58 +01:00
bors
4891c00634 Auto merge of #29984 - Manishearth:slice-assert, r=alexcrichton
I'd like to have the message print out the index and length values like it does elsewhere, but I'm not sure how to do that without affecting perf here. Will `assert!(cond, "index out of bounds got {} but len is ", idx, len)` make things slower? It calls `panic_fmt` which is marked as cold but also calls `format_args!`, and I don't know if that allocates or does any heavy lifting.

cc @alexcrichton @Gankro
2015-11-23 06:27:49 +00:00
Manish Goregaokar
5c873be9c3 Improve slice indexing assertion 2015-11-23 09:39:46 +05:30
Manish Goregaokar
c0f9a39e5c Mark slice_error_fail as a cold path 2015-11-23 09:34:58 +05:30
bors
2ba44607fe Auto merge of #28907 - SingingTree:rustfmt_libterm, r=nrc
Hey hey,

This is the result of running rustfmt over the libterm module. The first commit reflects the unaltered changes from rustfmt, and the commit message contains some notes on areas where I thought rustfmt had behaved strangely. The second commit attempts to fix the strange areas from the first commit.

Clarification edit: there are still some areas where I think rustfmt has made changes which may merit discussion (one is noted in the comments below). My second commit only undoes the changes that I figured would not warrant discussion (based on my opinion of the style, which is of course subjective).

r? @nrc
2015-11-22 23:01:56 +00:00
bors
a2847a9999 Auto merge of #29964 - alexcrichton:update-libc, r=brson
Includes rust-lang-nursery/libc#66 which should:

Closes #29818
Closes #29956
2015-11-22 21:17:57 +00:00
Alex Crichton
911cdbc519 libc: Update to master
Includes rust-lang-nursery/libc#66 which should:

Closes #29956
2015-11-22 11:29:12 -08:00
bors
d125ddd52f Auto merge of #29983 - tbu-:pr_env_windows_hidden_variables, r=alexcrichton
Fixes #29972.
2015-11-22 18:34:13 +00:00
Tobias Bucher
dd162d77d4 test_inherit_env: Don't look for hidden environment variables on Windows
Fixes #29972.
2015-11-22 11:12:49 +00:00
bors
e24fffef8a Auto merge of #29716 - Manishearth:repr-error, r=Gankro
r? @Gankro
2015-11-22 08:43:22 +00:00
bors
f04653250b Auto merge of #29980 - Manishearth:missing-diag, r=eddyb
None
2015-11-22 06:42:56 +00:00
Manish Goregaokar
bef93557e5 Improve transmute diagnostics with a note about destructors
fixes #29922
2015-11-22 10:26:50 +05:30
Manish Goregaokar
352853c18b Register diagnostics for rustc_privacy and rustc_trans properly
fixes #29665
2015-11-22 10:26:22 +05:30
bors
ced9ad3064 Auto merge of #29968 - Manishearth:bang-macro-diag, r=eddyb
r? @eddyb

fixes #5780
2015-11-22 04:13:49 +00:00
Manish Goregaokar
99925fb562 Look up macro names as well when suggesting replacements for function resolve errors
fixes #5780
2015-11-22 06:48:46 +05:30
Bryce Van Dyk
7d54c32c94 Rustfmt libterm, skip long static in compiled.rs 2015-11-22 13:24:56 +13:00
bors
eb19d024a9 Auto merge of #29963 - dotdash:fat_copy, r=eddyb
Since fat pointers do not qualify as structural types, they got copied
using load_ty and store_ty, which means that we load an FCA and use
extractvalue to get the components of the fat pointer. This breaks
certain optimizations in LLVM.

Found via apasel422/ref_count#13
2015-11-21 22:08:26 +00:00
bors
685e098561 Auto merge of #29966 - MatthiasKauer:master, r=steveklabnik
This commit changes the location of the rust docs.
024aa9a345
Clicking the contribution link on the front page therefore becomes a 'not found' error.
2015-11-21 06:06:16 +00:00
bors
ef5ee7d895 Auto merge of #29948 - devonhollowood:fromstr-parse, r=steveklabnik
Implement #29919
2015-11-21 04:22:15 +00:00
bors
d1c7a93eff Auto merge of #29913 - tbu-:pr_windows_path_error_on_nul, r=alexcrichton
On Windows: Previously these paths were silently truncated at these NUL
characters, now they fail with `ErrorKind::InvalidInput`.
2015-11-21 02:38:18 +00:00
Tobias Bucher
71dccf8706 Also check for NULs in environment variables
This check is necessary, because the underlying API only reads strings
until the first NUL.
2015-11-21 01:11:15 +00:00
bors
79b7a9efa9 Auto merge of #29916 - Manishearth:diag-401, r=steveklabnik
None
2015-11-21 00:54:16 +00:00
Matthias Kauer
e37cd6d5fd change link on book front page trpl -> book 2015-11-21 07:49:38 +08:00
bors
731c0ce4c9 Auto merge of #29961 - alexcrichton:order-dependent, r=brson
This commit fixes a bug where a crate could fail to compile depending on the
order of `extern crate` directives at the top of the crate. Specifically, if the
same crate is found at two locations, then if it's loaded first via `--extern`
it will not emit a duplicate warning, but if it's first loaded transitively
via a dep and *then* via `--extern` an error will be emitted.

The loader was tweaked to catch this scenario and coalesce the loading of these
two crates to prevent errors from being emitted.
2015-11-20 22:08:19 +00:00
Björn Steinbrink
6741f3315a Avoid FCA loads and extractvalue when copying fat pointers
Since fat pointers do not qualify as structural types, they got copied
using load_ty and store_ty, which means that we load an FCA and use
extractvalue to get the components of the fat pointer. This breaks
certain optimizations in LLVM.

Found via apasel422/ref_count#13
2015-11-20 21:42:13 +01:00
bors
20cbba71d4 Auto merge of #29945 - nrc:save-crate-name, r=alexcrichton
r? @alexcrichton

This prevents outputting csv files with the same name and thus overwriting each other when indexing Cargo projects with a bin crate (and some other cases).
2015-11-20 20:03:16 +00:00
Alex Crichton
24311d0762 rustc: Fix extern crate being order dependent
This commit fixes a bug where a crate could fail to compile depending on the
order of `extern crate` directives at the top of the crate. Specifically, if the
same crate is found at two locations, then if it's loaded first via `--extern`
it will not emit a duplicate warning, but if it's first loaded transitively
via a dep and *then* via `--extern` an error will be emitted.

The loader was tweaked to catch this scenario and coalesce the loading of these
two crates to prevent errors from being emitted.
2015-11-20 10:58:38 -08:00
bors
6a6b97cf02 Auto merge of #29822 - petrochenkov:pubexport, r=alexcrichton
This patch implements the plan described in https://internals.rust-lang.org/t/privacy-and-its-interaction-with-docs-lints-and-stability/2880 with one deviation.

It turns out, that rustdoc needs the "directly public" set for its docs inlining logic, so the privacy pass have to produce three sets and not two. Three is arguably too many, so I merged them in one map:
`public_items/exported_items/reachable_items: NodeSet => access_levels: NodeMap<AccessLevel>`

r? @alexcrichton
2015-11-20 18:13:10 +00:00
Aaron Turon
612d001d74 Change TraitRef subtyping checks to equality
Trait references are always invariant, so all uses of subtyping between
them are equivalent to using equality.

Moreover, the overlap check was previously performed twice per impl
pair, once in each direction. It is now performed only once, and
internally uses the equality check.

On glium, a crate that spends some time in coherence, this change sped
up coherence checking by a few percent (not very significant).
2015-11-20 09:34:33 -08:00
Manish Goregaokar
92df8a9a99 Add E0517, E0518 for repr() errors 2015-11-20 21:23:58 +05:30
bors
68276619b5 Auto merge of #29951 - fhahn:fix-plugin-compiler-example, r=steveklabnik
PR for #29930. Adds missing #![feature(slice_patterns)] to make compiler plugin example compile again.
2015-11-20 15:26:35 +00:00
Angus Lees
07b7f2fbc9 Set CFLAGS/LDFLAGS/etc according to Debian policy
Debian wants to build all binaries with particular hardening flags.
The Rust makefiles are inconsistent in which architectures they
correctly include CFLAGS/etc from the enivoronment (see mk/cfg/*).

This patch adds LDFLAGS, and then unconditionally prepends
CFLAGS/LDFLAGS/etc to the build commands.
2015-11-20 12:51:10 -02:00
Florian Hahn
c53722daae Remove slice pattern from compiler plugin example
closes #29930
2015-11-20 14:31:04 +01:00
Vadim Petrochenkov
a613059e3f Rename #[deprecated] to #[rustc_deprecated] 2015-11-20 16:11:20 +03:00
bors
e5f8a3dd02 Auto merge of #29950 - fhahn:small-doc-fix-rename-var, r=bluss
This tiny PR renames the result variable in HashSet's `intersection` example from `diff` to `intersection` and the same for `union`, which seem more appropriate.
2015-11-20 12:30:00 +00:00
Florian Hahn
755caf9ff7 Rename result variable in HashSet's intersection and union examples 2015-11-20 11:40:05 +01:00
bors
f8827f5275 Auto merge of #29534 - oli-obk:fix/const_fn_eval, r=dotdash 2015-11-20 09:48:11 +00:00
Oliver Schneider
64051221b6 add feature gate const_indexing
tracking issue is #29947
2015-11-20 10:43:04 +01:00
Devon Hollowood
da5dd298d4 Add information about str::parse() in FromStr docs 2015-11-20 00:41:10 -08:00
bors
2228bacd62 Auto merge of #29943 - brson:inline-threshold, r=nrc
Corresponds directly to llvm's inline-threshold.

I want this so I can experiment out-of-tree with tweaking optimization settings, and this is the most important value that isn't exposed. I can't get it to work either via `-C llvm-args`.

cc @rust-lang/compiler
2015-11-20 05:09:24 +00:00
bors
e5c69b10c3 Auto merge of #29942 - brson:rmsegstack, r=alexcrichton 2015-11-20 03:26:19 +00:00
Nick Cameron
de8467cf42 save-analysis: make the dump file's name closer to the crate file's name 2015-11-20 15:44:53 +13:00
bors
bce743ca0a Auto merge of #29939 - mitaa:doc_const_fn, r=alexcrichton
fixes #27362
2015-11-20 01:40:03 +00:00
Brian Anderson
5c88a1cd54 Add -C inline-threshold
Corresponds directly to llvm's inline-threshold
2015-11-19 17:01:07 -08:00
Brian Anderson
99741700e5 Remove segmented stack option from LLVMRustCreateTargetMachine. Unused. 2015-11-19 16:58:23 -08:00
bors
b289892b5d Auto merge of #29894 - alexcrichton:stdtime, r=brson
This commit is an implementation of [RFC 1288][rfc] which adds two new unstable
types to the `std::time` module. The `Instant` type is used to represent
measurements of a monotonically increasing clock suitable for measuring time
withing a process for operations such as benchmarks or just the elapsed time to
do something. An `Instant` favors panicking when bugs are found as the bugs are
programmer errors rather than typical errors that can be encountered.

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

The `SystemTime` type is used to represent a system timestamp and is not
monotonic. Very few guarantees are provided about this measurement of the system
clock, but a fixed point in time (`UNIX_EPOCH`) is provided to learn about the
relative distance from this point for any particular time stamp.

This PR takes the same implementation strategy as the `time` crate on crates.io,
namely:

|  Platform  |  Instant                 |  SystemTime              |
|------------|--------------------------|--------------------------|
| Windows    | QueryPerformanceCounter  | GetSystemTimeAsFileTime  |
| OSX        | mach_absolute_time       | gettimeofday             |
| Unix       | CLOCK_MONOTONIC          | CLOCK_REALTIME           |

These implementations can perhaps be refined over time, but they currently
satisfy the requirements of the `Instant` and `SystemTime` types while also
being portable across implementations and revisions of each platform.

cc #29866
2015-11-19 23:57:07 +00:00