Commit Graph

76255 Commits

Author SHA1 Message Date
csmoe
20703b3d09 introduce trait engine mod 2018-03-23 09:21:29 +08:00
David Wood
447ae7612a
Added flag to disable user type assertion. 2018-03-22 22:48:39 +00:00
Niko Matsakis
04aeef8d45
Debug logs for replace_bound_regions_with_nll_infer_vars 2018-03-22 22:40:51 +00:00
Nick Cameron
aa238a3780 Update RLS and Rustfmt
Fixes broken RLS tests/build
2018-03-23 10:34:47 +13:00
David Wood
fc5c4daa88
Temporarily only adding UserAssertTy on binding patterns. 2018-03-22 21:11:03 +00:00
David Wood
e1648bde17
Switched from canonicalize_query to canonicalize_response 2018-03-22 21:11:03 +00:00
David Wood
692a931887
UserAssertTy can handle inference variables.
This commit modifies the UserAssertTy statement to take a canonicalized
type rather than a regular type so that we can handle the case where the
user provided type contains a inference variable.
2018-03-22 21:11:02 +00:00
David Wood
5d2a60c57e
No longer visiting user_assert_ty statements in constraint generation. 2018-03-22 21:11:02 +00:00
David Wood
d4b9a7874b
Added comment in renumberer about UserAssertTy. 2018-03-22 21:11:02 +00:00
David Wood
c8d81b1a2e
Updated test with expected error message. 2018-03-22 21:11:01 +00:00
David Wood
ee4c7ac154
Added override in renumberer for UserAssertTy. 2018-03-22 21:11:01 +00:00
David Wood
239b3ec473
Changed location to at_self from at_successor. 2018-03-22 21:11:01 +00:00
David Wood
5f21aa8734
Added initial processing of UserAssertTy statements. 2018-03-22 21:11:00 +00:00
David Wood
1331cd4a8c
Killing UserAssertTy in CleanupPostBorrowck pass. 2018-03-22 21:11:00 +00:00
David Wood
17b285d203
Added UserAssertTy statement. 2018-03-22 21:10:59 +00:00
David Wood
c0fdb29362
Added initial test for #47184 2018-03-22 21:09:37 +00:00
Niko Matsakis
94468dac63 permit '_ and &T in impl headers
Deprecated forms of elision are not supported.
2018-03-22 16:54:52 -04:00
Niko Matsakis
df70060bd6 distinguish the three cases where elision occurs 2018-03-22 16:54:52 -04:00
Niko Matsakis
1488095b08 change in-band array to store hir::LifetimeName 2018-03-22 16:54:51 -04:00
Niko Matsakis
d913af8691 add new test for dyn<Trait + '_> used in a struct
`'_` is illegal in structs; this currently gets a duplicate error
2018-03-22 16:54:51 -04:00
Niko Matsakis
f07ebc5df8 add a helper function maybe_collect_in_band_lifetime 2018-03-22 16:54:51 -04:00
Niko Matsakis
f71807d507 make parent_id not optional
It'd be pretty buggy if `None` were supplied anyway; we'd skip over
in-band lifetimes completely!
2018-03-22 16:54:51 -04:00
Niko Matsakis
a5743b3b57 change with_in_scope_lifetime_defs to take an iterator 2018-03-22 16:54:51 -04:00
Niko Matsakis
1b26be5750 rustfmt lowering.rs 2018-03-22 16:54:50 -04:00
David Wood
73fa6d52ed
Remove std/test documentation from compiler docs. 2018-03-22 20:49:05 +00:00
Alex Crichton
d889957dab rustc: Add a #[wasm_import_module] attribute
This commit adds a new attribute to the Rust compiler specific to the wasm
target (and no other targets). The `#[wasm_import_module]` attribute is used to
specify the module that a name is imported from, and is used like so:

    #[wasm_import_module = "./foo.js"]
    extern {
        fn some_js_function();
    }

Here the import of the symbol `some_js_function` is tagged with the `./foo.js`
module in the wasm output file. Wasm-the-format includes two fields on all
imports, a module and a field. The field is the symbol name (`some_js_function`
above) and the module has historically unconditionally been `"env"`. I'm not
sure if this `"env"` convention has asm.js or LLVM roots, but regardless we'd
like the ability to configure it!

The proposed ES module integration with wasm (aka a wasm module is "just another
ES module") requires that the import module of wasm imports is interpreted as an
ES module import, meaning that you'll need to encode paths, NPM packages, etc.
As a result, we'll need this to be something other than `"env"`!

Unfortunately neither our version of LLVM nor LLD supports custom import modules
(aka anything not `"env"`). My hope is that by the time LLVM 7 is released both
will have support, but in the meantime this commit adds some primitive
encoding/decoding of wasm files to the compiler. This way rustc postprocesses
the wasm module that LLVM emits to ensure it's got all the imports we'd like to
have in it.

Eventually I'd ideally like to unconditionally require this attribute to be
placed on all `extern { ... }` blocks. For now though it seemed prudent to add
it as an unstable attribute, so for now it's not required (as that'd force usage
of a feature gate). Hopefully it doesn't take too long to "stabilize" this!

cc rust-lang-nursery/rust-wasm#29
2018-03-22 13:16:38 -07:00
Alex Crichton
7df6f4161c rustc: Add a #[wasm_custom_section] attribute
This commit is an implementation of adding custom sections to wasm artifacts in
rustc. The intention here is to expose the ability of the wasm binary format to
contain custom sections with arbitrary user-defined data. Currently neither our
version of LLVM nor LLD supports this so the implementation is currently custom
to rustc itself.

The implementation here is to attach a `#[wasm_custom_section = "foo"]`
attribute to any `const` which has a type like `[u8; N]`. Other types of
constants aren't supported yet but may be added one day! This should hopefully
be enough to get off the ground with *some* custom section support.

The current semantics are that any constant tagged with `#[wasm_custom_section]`
section will be *appended* to the corresponding section in the final output wasm
artifact (and this affects dependencies linked in as well, not just the final
crate). This means that whatever is interpreting the contents must be able to
interpret binary-concatenated sections (or each constant needs to be in its own
custom section).

To test this change the existing `run-make` test suite was moved to a
`run-make-fulldeps` folder and a new `run-make` test suite was added which
applies to all targets by default. This test suite currently only has one test
which only runs for the wasm target (using a node.js script to use `WebAssembly`
in JS to parse the wasm output).
2018-03-22 13:16:38 -07:00
bors
52f7e8836c Auto merge of #49210 - oli-obk:pango_crash, r=eddyb
Fix the conversion between bit representations and i128 representations

fixes #49181

the `Discr` type now encodes the bit representation instead of `i128` or `u128` casted to `u128`.

r? @eddyb
2018-03-22 20:02:14 +00:00
David Wood
1b0e9f5af9
Only generate documentation for local rustc crates. 2018-03-22 17:21:30 +00:00
bors
5092c6b01a Auto merge of #49264 - kennytm:rollup, r=kennytm
Rollup of 23 pull requests

- Successful merges: #48374, #48596, #48759, #48939, #49029, #49069, #49093, #49109, #49117, #49140, #49158, #49188, #49189, #49209, #49211, #49216, #49225, #49231, #49234, #49242, #49244, #49105, #49038
- Failed merges:
2018-03-22 16:58:57 +00:00
Bryan Drewery
70559c54ce Command::env_saw_path() may be unused on platforms not using posix_spawn() 2018-03-22 09:49:20 -07:00
varkor
ad50f3389a Optimise decode return expression for unit structs 2018-03-22 16:35:54 +00:00
Oliver Schneider
9fa14e47d4
Skip checking for Storage* statements in constants/statics 2018-03-22 16:59:02 +01:00
varkor
0d278ca6a8 Use FunctionRetTy::Default rather than an explicit TyKind::Infer for lambda-building
This prevents explicit `-> _` return type annotations for closures generated by `lambda`.
2018-03-22 15:55:57 +00:00
Lymia Aluysia
57f9c4d6d9
Clarify description of raw_identifiers feature flag. 2018-03-22 10:37:27 -05:00
Lymia Aluysia
bfb94ac5f4
Clean up raw identifier handling when recovering tokens from AST. 2018-03-22 10:34:51 -05:00
kennytm
2c6f911463
Rollup merge of #49038 - canndrew:replace-infallible-with-never, r=SimonSapin
replace `convert::Infallible` with `!`
2018-03-22 23:22:38 +08:00
kennytm
2b9674d2b1
Rollup merge of #49105 - SimonSapin:from_utf8_lossy_example, r=alexcrichton
Add an example of lossy decoding to str::Utf8Error docs

CC https://github.com/rust-lang/rust/issues/33906
2018-03-22 23:20:11 +08:00
kennytm
a4bc859011
Revert "Temporarily disable dist-ing RLS, Rustfmt and Clippy."
This reverts commit 9f792e199b.
2018-03-22 22:43:56 +08:00
kennytm
d54f74ea0a
Rollup merge of #49244 - varkor:type_dependent_defs_ExprMethodCall, r=estebank
Fix type_dependent_defs ICE on method calls

Fixes #49241.
2018-03-22 22:43:55 +08:00
kennytm
eb99deb9c6
Rollup merge of #49242 - Mrowqa:typaram-attrs, r=petrochenkov
Pass attributes to hir::TyParam

Required by https://github.com/servo/servo/pull/20264
Discussed here: https://gitter.im/servo/servo?at=5aafdcd1012ff2bf681da97a

CC @nikomatsakis
2018-03-22 22:43:53 +08:00
kennytm
a10db97069
Rollup merge of #49234 - kennytm:revert-fix-dpl-788, r=alexcrichton
dpl 1.9.5 has been released, revert #49217.

dpl 1.9.5 has been released which includes travis-ci/dpl#789, so we could move back to the standard Travis settings before that `s3-eager-autoload` branch is removed.
2018-03-22 22:43:52 +08:00
kennytm
87f5a4b6f2
Rollup merge of #49231 - gnzlbg:fix_vec_fminmax, r=rkruppe
fix vector fmin/fmax non-fast/fast intrinsics NaN handling

This bugs shows up in release mode tests of `stdsimd`: https://github.com/rust-lang-nursery/stdsimd/pull/391 . The intrinsics are thoroughly tested there for roundoff errors, NaN, and overflow behavior.

The problem was that the non-fast intrinsics where specifying `NoNaNs == true`, which meant that they don't support NaNs. This is incorrect, the non-fast intrinsics should handle NaNs properly.

Also, the "fast" intrinsics where specifying `NoNaNs == false` which meant that they support NaNs and then fast-math, which probably disables this support. This was not intended either.

I've added a comment specifying what the boolean flags do.
2018-03-22 22:43:51 +08:00
kennytm
3e95c71c18
Rollup merge of #49225 - QuietMisdreavus:all-the-features-all-the-time, r=alexcrichton
whitelist every target feature for rustdoc

When https://github.com/rust-lang-nursery/stdsimd/pull/367 was attempted to be upstreamed, it failed to document on non-x86 targets because it made every intrinsic visible, even the ones on foreign arches. This change makes it so that whenever rustdoc asks for the target feature whitelist, it gets a list of every feature known to every arch in `rustc_trans/llvm_util.rs`.

Before pushing, i temporarily updated the `stdsimd` submodule to include the `doc(cfg)` change, generated documentation for `aarch64-unknown-linux-gnu`, and it completed without a problem. The generated `core::arch` docs contained complete submodules for all main arches.
2018-03-22 22:43:50 +08:00
kennytm
346a46e9d6
Rollup merge of #49216 - bjorn3:patch-1, r=estebank
Don't check interpret_interner when accessing a static to fix miri mutable statics

Mutable statics don't work in my PR to fix the standalone [miri](https://github.com/solson/miri), as init_static didn't get called when the interpret_interner already contained a entry for the static, which is always immutable.

cc solson/miri#364
2018-03-22 22:43:48 +08:00
kennytm
70ae9174ee
Rollup merge of #49211 - varkor:chalk-lowering-Implemented-From-Env, r=nikomatsakis
Implement Chalk lowering rule "Implemented-From-Env"

This extends the Chalk lowering pass with the "Implemented-From-Env" rule for generating program clauses from a trait definition as part of #49177.

r? @nikomatsakis
2018-03-22 22:43:47 +08:00
kennytm
34eca5346f
Rollup merge of #49209 - Zoxc:run-make-last, r=Mark-Simulacrum
Run the `run-make` tests last, so more tests run on Windows when `make` is unavailable

Just https://github.com/rust-lang/rust/pull/47996 again.

r? @Mark-Simulacrum
2018-03-22 22:43:45 +08:00
kennytm
d7eda77692
Rollup merge of #49189 - GuillaumeGomez:fix-implied-shortcut-links, r=QuietMisdreavus
Fix automatic urls with backticks

Fixes #49164.

r? @QuietMisdreavus
2018-03-22 22:43:43 +08:00
kennytm
95967c7c72
Rollup merge of #49188 - memoryleak47:macro_use_doctest, r=QuietMisdreavus
Put `#[macro_use] extern crate <crate>` before fn main() in doctests

Closes #49174.
2018-03-22 22:43:41 +08:00
kennytm
c9457250ce
Rollup merge of #49158 - varkor:compiletest-triples, r=rkruppe
Make compiletest do exact matching on triples

This avoids the issues of the previous substring matching, ensuring `ARCH_TABLE` and `OS_TABLE` will no longer contain redundant entries. Fixes #48893.

r? @rkruppe
2018-03-22 22:43:40 +08:00