Commit Graph

56647 Commits

Author SHA1 Message Date
Niko Matsakis
c6363b8013 ignore dep-graph when loading inlined HIR
We touch the krate to adjust the maps, but we don't expose that data
widely.
2016-09-06 11:17:03 -04:00
Niko Matsakis
5415b34ca6 write to inherent_impls during the visitor
The goal here is to avoid writing to the `inherent_impls` map from
within the general `Coherence` task, and instead write to it as we
visit. Writing to it from the Coherence task is actually an information
leak; it happened to be safe because Coherence read from
`DepNode::Krate`, but that was very coarse.

I removed the `Rc` here because, upon manual inspection, nobody clones
the data in this table, and it meant that we can accumulate the data in
place. That said, the pattern that is used for the inherent impls map
is *generally* an anti-pattern (that is, holding the borrow lock for the
duration of using the contents), so it'd probably be better to
clone (and I doubt that would be expensive -- how many inherent impls
does a typical type have?).
2016-09-06 11:17:03 -04:00
bors
5114f8a29b Auto merge of #36276 - jseyfried:fix_unused, r=nrc
resolve: Fix unused import false positive with `item_like_imports`

Fixes #36249.
r? @nrc
2016-09-06 01:44:13 -07:00
bors
1d04201565 Auto merge of #36078 - ollie27:rustdoc_search_assocconst, r=alexcrichton
rustdoc: Fix associated consts in search results

Associated consts can appear in none trait impls so need to be treated
like methods when generating the search index.

Fixes #36031
2016-09-05 22:32:36 -07:00
Jeffrey Seyfried
ff3a644951 Add struct AmbiguityError. 2016-09-06 03:52:36 +00:00
Jeffrey Seyfried
888a968139 Add field used: Cell<bool> to variant NameBindingKind::Import. 2016-09-06 03:43:46 +00:00
Jeffrey Seyfried
07f8cb28dc Add regression test. 2016-09-06 03:43:21 +00:00
Jeffrey Seyfried
32674b3f1a Avoid false positive unused import warnings. 2016-09-06 03:43:20 +00:00
bors
e1d0de82cc Auto merge of #36274 - Manishearth:rollup, r=Manishearth
Rollup of 6 pull requests

- Successful merges: #35845, #35983, #36065, #36102, #36242, #36245
- Failed merges:
2016-09-05 17:55:45 -07:00
bors
cbe4de78e2 Auto merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez
Indicate where `core::result::IntoIter` is created.

None
2016-09-05 14:41:16 -07:00
bors
38824d1061 Auto merge of #36281 - pnkfelix:fix-issue-36036, r=eddyb
Fix issue #36036.

Fix #36036.

We were treating an associated type as unsized even when the concrete instantiation was actually sized. Fix is to normalize before checking if it is sized.
2016-09-05 11:28:36 -07:00
bors
3f50b6342d Auto merge of #36200 - mattico:fix-llvm-linkage, r=arielb1
Fix incorrect LLVM Linkage enum

Followup of #33994 to actually work.

The `Linkage` enum in librustc_llvm got out of sync with the version in LLVM and it caused two variants of the `#[linkage=""]` attribute to break.

This adds the functions `LLVMRustGetLinkage` and `LLVMRustSetLinkage` which convert between the Rust Linkage enum and the LLVM one, which should stop this from breaking every time LLVM changes it.

Possible remaining concerns:

1. There could be a codegen test to make sure that the attributes are applied correctly (I don't know how to do this).
2. ~~The test does not exercise the `appending` linkage. I can't figure out how to make a global static raw pointer to an array. This might not even be possible? If not we should probably remove appending linkage as its unusable in rust.~~ Appending linkage is not 'emittable' anyway.
3. The test only runs on Linux.

Fixes #33992

r? @alexcrichton
2016-09-05 08:13:32 -07:00
bors
58dc448f8c Auto merge of #35787 - canndrew:bang_type_refactor_check, r=eddyb
Typecheck refactor for `!`

Ping @nikomatsakis @eddyb. This is the PR for the typeck refactor for `!`. Is this what you guys had in mind? Is there anything else that needs doing on it?
2016-09-05 04:29:47 -07:00
Felix S. Klock II
09e6a98380 Fix issue #36036.
We were treating an associated type as unsized even when the concrete
instantiation was actually sized. Fix is to normalize before checking
if it is sized.
2016-09-05 12:57:00 +02:00
Manish Goregaokar
20ec61e043 Rollup merge of #36245 - alexcrichton:add-back-accident, r=arielb1
Add back feature accidentally removed

This feature was accidentally removed in
https://github.com/rust-lang/rust/pull/35957.
2016-09-05 14:53:09 +08:00
Manish Goregaokar
e19a564191 Rollup merge of #36242 - semarie:local-rebuild, r=alexcrichton
Use libraries from local-rust-root directory in configure when using …

…--enable-local-rebuild

When using --enable-local-rebuild configure options, the configure
script will test rustc version. But when running it, it will not use the
libraries in the local-rust-root directory.

So use `LD_LIBRARY_PATH` environment variable to correct it.

Under OpenBSD, we use `--enable-local-rebuild` for rebuilding rustc-1.11.0 using rustc-1.11.0. But as it is in use in -current (the developpment branch of OpenBSD), system libraries could easily have ABI/API changes. The (unofficial) bootstrap (rustc-1.11.0 used for building rustc-1.11.0) include several system libraries to permit it to run. The build system use libraries in stage0/lib directory. But the configure script doesn't.

Due to my special use of `--enable-local-rebuild`, I dunno if this PR is suitable for inclusion. But it corrects a difference between build and configure use of the binary.

r? @alexcrichton
2016-09-05 14:53:09 +08:00
Manish Goregaokar
b16fbeb8c1 Rollup merge of #36065 - acrrd:new_format_E0496, r=GuillaumeGomez
Update E0496 to new format

Fixes #36000.
Part of #35233.

r? @GuillaumeGomez
2016-09-05 14:53:08 +08:00
Manish Goregaokar
75e3bc3bd8 Rollup merge of #35983 - GuillaumeGomez:e0060_bonus, r=jonathandturner
E0060 and E0061 improvement

Fixes #35290.

r? @jonathandturner
2016-09-05 14:53:08 +08:00
Manish Goregaokar
acf98d99f9 Rollup merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez
Indicate where `core::result::IntoIter` is created.

None
2016-09-05 14:53:08 +08:00
bors
2dbf600d15 Auto merge of #36242 - semarie:local-rebuild, r=alexcrichton
Use libraries from local-rust-root directory in configure when using …

…--enable-local-rebuild

When using --enable-local-rebuild configure options, the configure
script will test rustc version. But when running it, it will not use the
libraries in the local-rust-root directory.

So use `LD_LIBRARY_PATH` environment variable to correct it.

Under OpenBSD, we use `--enable-local-rebuild` for rebuilding rustc-1.11.0 using rustc-1.11.0. But as it is in use in -current (the developpment branch of OpenBSD), system libraries could easily have ABI/API changes. The (unofficial) bootstrap (rustc-1.11.0 used for building rustc-1.11.0) include several system libraries to permit it to run. The build system use libraries in stage0/lib directory. But the configure script doesn't.

Due to my special use of `--enable-local-rebuild`, I dunno if this PR is suitable for inclusion. But it corrects a difference between build and configure use of the binary.

r? @alexcrichton
2016-09-04 23:50:04 -07:00
Andrew Cann
c9a340e546 Remove expr_ty method completely 2016-09-05 12:28:52 +08:00
Andrew Cann
7c8f5457d2 Undo unnecessary bookkeeping from last commit 2016-09-05 12:28:52 +08:00
Andrew Cann
180534f398 Remove use of expr_ty from coercions code 2016-09-05 12:28:52 +08:00
Andrew Cann
bd661481e7 Move write_ty to the bottom of check_pat 2016-09-05 12:28:52 +08:00
Andrew Cann
1749fda9c0 Factor write_ty out of more pattern-checking functions 2016-09-05 12:28:52 +08:00
Andrew Cann
c5ff28cd14 Factor write_ty out of pattern-matching functions 2016-09-05 12:26:41 +08:00
Andrew Cann
8c6086a0a3 check_block_with_expected returns the checked type 2016-09-05 12:26:41 +08:00
Andrew Cann
f54c47d34b Move check_expr match block into its own method 2016-09-05 12:26:41 +08:00
Andrew Cann
f120c71775 Tidy. Rename variables. 2016-09-05 12:26:41 +08:00
Andrew Cann
1c3e8b0a1c Tidy 2016-09-05 12:26:41 +08:00
Andrew Cann
adb19ff277 Add AdjustNeverToAny in check_expr 2016-09-05 12:26:41 +08:00
Andrew Cann
9cd8d7a24f Factor write_ty out of function checking functions 2016-09-05 12:26:41 +08:00
Andrew Cann
21720641dc Factor write_ty out of check_expr_closure 2016-09-05 12:26:41 +08:00
Andrew Cann
144b8cf5db Factor write_ty out of check_struct_expr 2016-09-05 12:26:41 +08:00
Andrew Cann
f22dd2e2d9 Factor write_ty out of field/indexing methods 2016-09-05 12:26:41 +08:00
Andrew Cann
91b39b5e65 Factor write_ty out of more checking functions 2016-09-05 12:19:07 +08:00
Andrew Cann
06ad8fe261 Factor write_ty out of check_binop* 2016-09-05 12:19:07 +08:00
Andrew Cann
c7ea3e8d13 Remove redundant error checking around ExprMethodCall 2016-09-05 12:19:07 +08:00
Andrew Cann
b93435fd79 Remove most uses of expr_ty 2016-09-05 12:19:07 +08:00
Andrew Cann
0ddf060b6d Make write_ty and friends return adjusted type 2016-09-05 12:19:07 +08:00
bors
86995dc8c5 Auto merge of #36240 - leeopop:master, r=jseyfried
Allow CompilerControllers to access rustc_plugin::registry::Registry

fixes #36064

I chose to put ructc_plugin::registry::Registry structure
into CompilerState structure, instead of Session structure.
This will preserve dependencies among librustc, libructc_driver, and libructc_plugin.

@jseyfried @sanxiyn
2016-09-04 18:36:42 -07:00
Matt Ickstadt
b9a8c1a063 Fix incorrect LLVM Linkage enum
The `Linkage` enum in librustc_llvm got out of sync with the version in LLVM and it caused two variants of the #[linkage=""] attribute to break.

This adds the functions `LLVMRustGetLinkage` and `LLVMRustSetLinkage` which convert between the Rust Linkage enum and the LLVM one, which should stop this from breaking every time LLVM changes it.

Fixes #33992
2016-09-04 16:12:01 -05:00
bors
91f057de35 Auto merge of #36203 - petrochenkov:uvsdot, r=nrc
Replace `_, _` with `..` in patterns

This is how https://github.com/rust-lang/rust/issues/33627 looks in action.

Looks especially nice in leftmost/rightmost positions `(first, ..)`/`(.., last)`.
I haven't touched libsyntax intentionally because the feature is still unstable.
2016-09-04 14:03:01 -07:00
bors
9cc430d2cf Auto merge of #36144 - japaric:rustbuild-musl, r=alexcrichton
rustbuild: fix building std for musl targets

closes #36143

r? @alexcrichton
2016-09-04 10:22:26 -07:00
bors
987b47549e Auto merge of #36255 - Manishearth:rollup, r=Manishearth
Rollup of 7 pull requests

- Successful merges: #36070, #36132, #36200, #36212, #36225, #36231, #36234
- Failed merges:
2016-09-04 06:06:37 -07:00
Manish Goregaokar
55893f0da7 Rollup merge of #36234 - durka:disable-codegen-config, r=alexcrichton
rustbuild: add config.toml option to disable codegen tests

Fixes #36232.

I think it worked? Here's a build log where I tried to bootstrap, it crashed, then I added the setting to config.toml and it continued: https://gist.github.com/durka/cbf97cf04b8e065f1a2cfda4c1b6bf95

r? @alexcrichton
2016-09-04 21:01:00 +08:00
Manish Goregaokar
8ee0b6b6c1 Rollup merge of #36231 - durka:patch-29, r=alexcrichton
indicate where to copy config.toml.example

r? @alexcrichton
2016-09-04 21:01:00 +08:00
Manish Goregaokar
eac0ebe35a Rollup merge of #36225 - johnthagen:fix-nightly-docs, r=steveklabnik
Update nightly docs supported Windows versions to match Getting Started page

https://doc.rust-lang.org/book/getting-started.html#tier-1 shows that Windows 7+ is officially supported (implying, for example Windows 10), but the nightly page only listed 7, 8, and Server 2008 R2).
2016-09-04 21:01:00 +08:00
Manish Goregaokar
43440a4a6e Rollup merge of #36212 - razielgn:updated-e0493-to-new-format, r=jonathandturner
Updated e0493 to new format (+ bonus).

Part of #35233.
Fixes #35999.

r? @jonathandturner

I'm not satisfied with the bonus part, there has to be an easier way to reach into the `Drop`'s span implementation. I'm all ears. :)
2016-09-04 21:00:59 +08:00
Manish Goregaokar
8d64649982 Rollup merge of #36132 - nrc:save-std, r=@eddyb
Add --Zsave-analysis-api

This is a save-analysis variation which can be used with libraries distributed without their source (e.g., libstd). It will allow IDEs and other tools to get info about types and create URLs to docs and source, without the unnecessary clutter of internal-only save-analysis info. I'm sure we'll iterate somewhat on the design, but this is a first draft.
2016-09-04 18:02:53 +08:00