about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2018-03-24Add test for `impl Trait` in argument positionShotaro Yamada-0/+46
2018-03-24Resolve `impl Trait` in argument positionShotaro Yamada-10/+54
2018-03-24Hide synthesized type parametersShotaro Yamada-4/+23
2018-03-23Test fixesAlex Crichton-1/+9
2018-03-23Merge branch '49001_epoch' of https://github.com/klnusbaum/rust into rollupAlex Crichton-95/+95
2018-03-23Merge branch 'master' of https://github.com/Lymia/rust into rollupAlex Crichton-145/+519
2018-03-23Rollup merge of #49295 - csmoe:nll_test_48238, r=alexcrichtonAlex Crichton-0/+30
Add test for issue-48238 Fixes #48238 test case made from comments in #48238
2018-03-23Rollup merge of #49272 - semarie:cat-and-grep-gnu, r=alexcrichtonAlex Crichton-0/+5
Use GNU version of fgrep/egrep tool if available It is mostly for BSD system. Some tests (run-make/issue-35164 and run-make/cat-and-grep-sanity-check) are failing with BSD fgrep, whereas they pass with gnu version (gfgrep).
2018-03-23Rollup merge of #49262 - oli-obk:fixed_size_array_len, r=estebankAlex Crichton-7/+56
Produce nice array lengths on a best effort basis fixes #49208 r? @estebank
2018-03-23Rollup merge of #49169 - sanxiyn:doc-only, r=aturonAlex Crichton-0/+2
Document only-X test header This was added in #47487 without documentation.
2018-03-23Rollup merge of #49160 - estebank:issue-47457-missing-fields, r=oli-obkAlex Crichton-42/+104
Reduce the diagnostic spam when multiple fields are missing in pattern Fix #47457.
2018-03-23Rollup merge of #49102 - glandium:decimal, r=aturonAlex Crichton-5/+0
Remove core::fmt::num::Decimal Before ebf9e1aaf6, it was used for Display::fmt, but ebf9e1aaf6 replaced that with a faster implementation, and nothing else uses it.
2018-03-23Rollup merge of #49030 - Zoxc:misc, r=michaelwoeristerAlex Crichton-65/+60
Misc changes from my parallel rustc branch r? @michaelwoerister
2018-03-23Rollup merge of #49028 - ↵Alex Crichton-0/+363
QuietMisdreavus:the-dark-forbidden-corners-of-rustdoc, r=frewsxcv add an "unstable features" chapter to the rustdoc book There are several rustdoc features that currently are undocumented, but also don't fit with the rest of the Rustdoc Book since they're also unstable. Some of these have corresponding feature gates and chapters in the Unstable Book, but many don't, and i wanted a place to talk about them officially. Goal: talk about everything rustdoc can do that needs nightly - [x] Feature gates (extensions to the doc attribute that can be caught by the compiler) - [x] doc(cfg) - [x] doc(masked) - [x] doc(spotlight) - [x] doc(include) - [x] Command-line flags (features that require a CLI flag to use, where the flag itself is a `-Z` command or otherwise requires `-Z unstable-options` before rustdoc will accept it) - [x] markdown-before-content/markdown-after-content - [x] playground-url - [x] display-warnings - [x] crate-version - [x] linker - [x] sort-modules-by-appearance - [x] themes/theme-checker - [x] resource-suffix - [x] `-Z force-unstable-if-unmarked` - [x] Nightly-gated functionality (features that are gated by requiring a nightly build without needing a CLI flag or a feature gate to unlock) - [x] intra-links - [x] error numbers for `compile_fail` doctests
2018-03-23Rollup merge of #48909 - RalfJung:type_alias_bounds, r=petrochenkovAlex Crichton-84/+270
Improve lint for type alias bounds First of all, I learned just today that I was wrong assuming that the bounds in type aliases are entirely ignored: It turns out they are used to resolve associated types in type aliases. So: ```rust type T1<U: Bound> = U::Assoc; // compiles type T2<U> = U::Assoc; // fails type T3<U> = <U as Bound>::Assoc; // "correct" way to write this, maybe? ``` I am sorry for creating this mess. This PR changes the wording of the lint accordingly. Moreover, since just removing the bound is no longer always a possible fix, I tried to detect cases like `T1` above and show a helpful message to the user: ``` warning: bounds on generic parameters are not enforced in type aliases --> $DIR/type-alias-bounds.rs:57:12 | LL | type T1<U: Bound> = U::Assoc; //~ WARN not enforced in type aliases | ^^^^^ | = help: the bound will not be checked when the type alias is used, and should be removed help: use absolute paths (i.e., <T as Trait>::Assoc) to refer to associated types in type aliases --> $DIR/type-alias-bounds.rs:57:21 | LL | type T1<U: Bound> = U::Assoc; //~ WARN not enforced in type aliases | ^^^^^^^^ ``` I am not sure if I got this entirely right. Ideally, we could provide a suggestion involving the correct trait and type name -- however, while I have access to the HIR in the lint, I do not know how to get access to the resolved name information, like which trait `Assoc` belongs to above. The lint does not even run if that resolution fails, so I assume that information is available *somewhere*... This is a follow-up for (parts of) https://github.com/rust-lang/rust/pull/48326. Also see https://github.com/rust-lang/rust/issues/21903. This changes the name of a lint, but that lint was just merged to master yesterday and has never even been on beta.
2018-03-23Rollup merge of #48883 - alexcrichton:wasm-custom-sections, r=nikomatsakisAlex Crichton-62/+1145
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-23Rollup merge of #48624 - bdrewery:freebsd-posix-spawn, r=alexcrichtonAlex Crichton-28/+194
Command: Support posix_spawn() on FreeBSD/OSX/GNU Linux
2018-03-23Rollup merge of #48265 - SimonSapin:nonzero, r=KodrAusAlex Crichton-89/+210
Add 12 num::NonZero* types for primitive integers, deprecate core::nonzero RFC: https://github.com/rust-lang/rfcs/pull/2307 Tracking issue: ~~https://github.com/rust-lang/rust/issues/27730~~ https://github.com/rust-lang/rust/issues/49137 Fixes https://github.com/rust-lang/rust/issues/27730
2018-03-23add test for issue-48238csmoe-0/+30
2018-03-23Auto merge of #49285 - nrc:update, r=alexcrichtonbors-6/+41
Update RLS and Rustfmt Fixes broken RLS tests/build r? @alexcrichton
2018-03-23Update RLS and RustfmtNick Cameron-6/+41
Fixes broken RLS tests/build
2018-03-22rustc: Add a `#[wasm_import_module]` attributeAlex Crichton-75/+653
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-22rustc: Add a `#[wasm_custom_section]` attributeAlex Crichton-17/+522
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-22Auto merge of #49210 - oli-obk:pango_crash, r=eddybbors-38/+66
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-22Auto merge of #49264 - kennytm:rollup, r=kennytmbors-1129/+1447
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-22Command::env_saw_path() may be unused on platforms not using posix_spawn()Bryan Drewery-0/+1
2018-03-22Clarify description of raw_identifiers feature flag.Lymia Aluysia-1/+1
2018-03-22Clean up raw identifier handling when recovering tokens from AST.Lymia Aluysia-4/+5
2018-03-22Rollup merge of #49038 - canndrew:replace-infallible-with-never, r=SimonSapinkennytm-38/+9
replace `convert::Infallible` with `!`
2018-03-22Rollup merge of #49105 - SimonSapin:from_utf8_lossy_example, r=alexcrichtonkennytm-0/+31
Add an example of lossy decoding to str::Utf8Error docs CC https://github.com/rust-lang/rust/issues/33906
2018-03-22Revert "Temporarily disable dist-ing RLS, Rustfmt and Clippy."kennytm-9/+1
This reverts commit 9f792e199bc53a75afdad72547a151a0bc86ec5d.
2018-03-22Rollup merge of #49244 - varkor:type_dependent_defs_ExprMethodCall, r=estebankkennytm-4/+41
Fix type_dependent_defs ICE on method calls Fixes #49241.
2018-03-22Rollup merge of #49242 - Mrowqa:typaram-attrs, r=petrochenkovkennytm-2/+7
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-22Rollup merge of #49231 - gnzlbg:fix_vec_fminmax, r=rkruppekennytm-4/+4
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-22Rollup merge of #49225 - QuietMisdreavus:all-the-features-all-the-time, ↵kennytm-4/+26
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-22Rollup merge of #49216 - bjorn3:patch-1, r=estebankkennytm-22/+18
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-22Rollup merge of #49211 - varkor:chalk-lowering-Implemented-From-Env, ↵kennytm-4/+75
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-22Rollup merge of #49209 - Zoxc:run-make-last, r=Mark-Simulacrumkennytm-2/+4
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-22Rollup merge of #49189 - GuillaumeGomez:fix-implied-shortcut-links, ↵kennytm-10/+28
r=QuietMisdreavus Fix automatic urls with backticks Fixes #49164. r? @QuietMisdreavus
2018-03-22Rollup merge of #49188 - memoryleak47:macro_use_doctest, r=QuietMisdreavuskennytm-0/+19
Put `#[macro_use] extern crate <crate>` before fn main() in doctests Closes #49174.
2018-03-22Rollup merge of #49158 - varkor:compiletest-triples, r=rkruppekennytm-7/+36
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-22Rollup merge of #49140 - semarie:rustdoc-test-path, r=alexcrichtonkennytm-1/+3
Allow test target to pass without installing explicitly pass -L target-lib to rustdoc on OpenBSD, without it, it fails on several tests with: ``` error[E0463]: can't find crate for `std` ```
2018-03-22Rollup merge of #49117 - nivkner:fixme_fixup3, r=estebankkennytm-77/+40
address some FIXME whose associated issues were marked as closed part of #44366
2018-03-22Rollup merge of #49109 - SimonSapin:deprecate-asciiext, r=alexcrichtonkennytm-16/+24
Deprecate the AsciiExt trait in favor of inherent methods The trait and some of its methods are stable and will remain. Some of the newer methods are unstable and can be removed later. Fixes https://github.com/rust-lang/rust/issues/39658
2018-03-22Rollup merge of #49093 - Zoxc:speedup, r=aidanhskennytm-43/+29
Update submodules in parallel
2018-03-22Rollup merge of #49069 - wesleywiser:incr_soa, r=michaelwoeristerkennytm-10/+20
Convert SerializedDepGraph to be a struct-of-arrays Fixes #47326 I did not try the "`mem::swap()` to avoid copying the arrays" idea because that would leave the DepGraph in an incorrect state and that doesn't seem like a good idea for me. r? @michaelwoerister
2018-03-22Rollup merge of #49029 - GuillaumeGomez:atomic-docs, r=QuietMisdreavuskennytm-364/+401
Make Atomic doc examples specific to each type Fixes #49018. r? @QuietMisdreavus
2018-03-22Rollup merge of #48939 - wesleywiser:incr_query_wf_checking, r=michaelwoeristerkennytm-506/+545
Querify WF-checking so it can be cached r? @michaelwoerister
2018-03-22Use GNU version of fgrep/egrep tool if availableSébastien Marie-0/+5
It is mostly for BSD system. Some tests (run-make/issue-35164 and run-make/cat-and-grep-sanity-check) are failing with BSD fgrep, whereas they pass with gnu version (gfgrep).
2018-03-22Fix the conversion between bit representations and i128 representationsOliver Schneider-38/+66