]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #47398 - GuillaumeGomez:pulldown-warnings, r=QuietMisdreavus
Guillaume Gomez [Wed, 17 Jan 2018 22:43:28 +0000 (23:43 +0100)]
Rollup merge of #47398 - GuillaumeGomez:pulldown-warnings, r=QuietMisdreavus

Switch to pulldown as default markdown renderer

r? @QuietMisdreavus

6 years agoRollup merge of #47313 - ollie27:rustdoc_record_extern_trait, r=QuietMisdreavus
Guillaume Gomez [Wed, 17 Jan 2018 22:43:27 +0000 (23:43 +0100)]
Rollup merge of #47313 - ollie27:rustdoc_record_extern_trait, r=QuietMisdreavus

rustdoc: Populate external_traits with traits only seen in impls

This means default methods can always be found and "Important traits" will include all spotlight traits.

6 years agoRollup merge of #47250 - GuillaumeGomez:test-rustdoc-js, r=Mark-Simulacrum
Guillaume Gomez [Wed, 17 Jan 2018 22:43:26 +0000 (23:43 +0100)]
Rollup merge of #47250 - GuillaumeGomez:test-rustdoc-js, r=Mark-Simulacrum

Test rustdoc js

Add tests for the rustdoc search. It was heavily required because of all the recent breaking changes that happened while I went through improvements in doc search (add search in/for generic search for example).

6 years agoAuto merge of #47522 - kennytm:rollup, r=kennytm
bors [Wed, 17 Jan 2018 18:38:34 +0000 (18:38 +0000)]
Auto merge of #47522 - kennytm:rollup, r=kennytm

Rollup of 21 pull requests

- Successful merges: #47302, #47333, #47387, #47404, #47407, #47426, #47427, #47436, #47444, #47456, #47458, #47467, #47479, #47481, #47483, #47487, #47497, #47498, #47505, #47509, #47514
- Failed merges:

6 years agoRollup merge of #47514 - gnzlbg:whitelist_x86_fxsr, r=rkruppe
kennytm [Wed, 17 Jan 2018 17:57:32 +0000 (01:57 +0800)]
Rollup merge of #47514 - gnzlbg:whitelist_x86_fxsr, r=rkruppe

whitelist x86 fxsr feature

https://github.com/rust-lang/rust/pull/47223 properly checks that only white-listed features are allowed in combination with `target_feature`, but the `fxsr` feature used by `stdsimd` was not white-listed.

r? @alexcrichton

6 years agoRollup merge of #47509 - cuviper:rayon-rust-installer, r=Mark-Simulacrum
kennytm [Wed, 17 Jan 2018 17:57:31 +0000 (01:57 +0800)]
Rollup merge of #47509 - cuviper:rayon-rust-installer, r=Mark-Simulacrum

Update rust-installer for streaming parallelism

Pull in rust-lang/rust-installer#76 to get streamed tarball generation,
rather than batching it all in memory, while still getting the benefit
of compressing in parallel.

6 years agoRollup merge of #47505 - alexcrichton:fix-bat-spawn-regression, r=estebank
kennytm [Wed, 17 Jan 2018 17:57:30 +0000 (01:57 +0800)]
Rollup merge of #47505 - alexcrichton:fix-bat-spawn-regression, r=estebank

rustc: Spawn `cmd /c` for `.bat` scripts

This fixes an accidental regression #46335 where the behavior of
`Path::ends_with` is different from `str::ends_with` (paths operate over
components, strs operate over chars).

6 years agoRollup merge of #47498 - dominikWin:missing-module-name, r=petrochenkov
kennytm [Wed, 17 Jan 2018 17:57:29 +0000 (01:57 +0800)]
Rollup merge of #47498 - dominikWin:missing-module-name, r=petrochenkov

Make non-found module name optional

No longer uses a magic string for missing or root module.

6 years agoRollup merge of #47497 - goffrie:patch-1, r=dtolnay
kennytm [Wed, 17 Jan 2018 17:57:28 +0000 (01:57 +0800)]
Rollup merge of #47497 - goffrie:patch-1, r=dtolnay

Remove incorrect `Default::default` links, add a new one

`map_or` and `map_or_else` don't use `Default::default`, but `unwrap_or_default` does.

6 years agoRollup merge of #47487 - Pulkit07:foo, r=kennytm
kennytm [Wed, 17 Jan 2018 17:57:27 +0000 (01:57 +0800)]
Rollup merge of #47487 - Pulkit07:foo, r=kennytm

implement "only-<platforms>" for test headers

This patch implements "only-<platforms>" for tests headers using which one can
specify just the platforms on which the test should run rather than listing all
the platforms to ignore using "ignore-<platforms>".

This fixes #33581 and fixes #47459.

6 years agoRollup merge of #47483 - segevfiner:mingw64-build-hack, r=alexcrichton
kennytm [Wed, 17 Jan 2018 17:57:26 +0000 (01:57 +0800)]
Rollup merge of #47483 - segevfiner:mingw64-build-hack, r=alexcrichton

Add "-lmsvcrt" twice to get rustc to build with the latest mingw64

After updating mingw-w64 in Msys2, I started getting this when doing `./x.py build --stage 1 src/libtest`:
```
error: linking with `gcc` failed: exit code: 1
  |
  = note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-m64" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\crt2.o" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc-b67a4fe646fd8794.rustc0-833528dbd46ff06c3b1f5154abdef2ed.rs.rcgu.o" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc-b67a4fe646fd8794.rustc1-833528dbd46ff06c3b1f5154abdef2ed.rs.rcgu.o" "-o" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc-b67a4fe646fd8794.exe" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps\\rustc-b67a4fe646fd8794.crate.allocator.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\release\\deps" "-L" "...\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\dbghelp-sys-0.2.0/x86_64" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\build\\miniz-sys-98d83a845f69b3ab\\out" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\build\\rustc_binaryen-f106436b515711ff\\out/build/lib" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\build\\rustc_binaryen-f106436b515711ff\\out" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\build\\rustc_llvm-9a040fa1f1937a67\\out" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\llvm/lib" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_driver-224d9efe142c632e" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_trans-767a58ff60ff6a03" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_resolve-bcc2d91b756552d1" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_incremental-e93e816231352cc9" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_plugin-8273bd6d564e8657" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_metadata-5537b9a8ab6e6015" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_lint-796681662b9ad8e1" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_passes-9ef6de765e132a7c" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_privacy-2289da126d06c49e" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_llvm-893cdac51017c26f" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_borrowck-ac2009fc1ce58d88" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_mir-d4ce85a1cded4423" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_const_eval-a4e766ec47afde96" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_save_analysis-66d4c41e75392976" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_typeck-4e21db5573af1446" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_platform_intrinsics-f40c4b99b60d15e9" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_allocator-86ef12c8efbcf068" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_trans_utils-8199c3d0e673bb7b" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc-8f435ca07f1a04ff" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-l" "test-8abb197945b79a6a" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_const_math-fa724350247d1ae6" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_back-838b735c189dd798" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "graphviz-42c69c0ff2aacc5b" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "arena-454325a3f2773bc8" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "syntax_ext-7880c41067f1be05" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "proc_macro-f609718c6b927026" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "syntax-3d2aaf6e201abcfe" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_errors-2c007ffe6a847ed7" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "syntax_pos-067e758dda669d03" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_data_structures-50e5e6db2f34c196" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-l" "term-9d9f4c10ffba6dd6" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "serialize-e55b4fb27a4d08bf" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "rustc_cratesio_shim-baed94e463835a87" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-rustc\\x86_64-pc-windows-gnu\\release\\deps" "-l" "fmt_macros-3c2cdca7d2f8dd09" "-L" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-l" "std-b1b09a5d7798628b" "-Wl,-Bstatic" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-69f85297d9318c97.rlib" "-Wl,-Bdynamic" "-l" "advapi32" "-l" "ole32" "-l" "oleaut32" "-l" "psapi" "-l" "shell32" "-l" "ole32" "-l" "uuid" "-l" "stdc++" "-l" "gcc_eh" "-l" "pthread" "-l" "psapi" "-l" "dbghelp" "-l" "kernel32" "-l" "advapi32" "-l" "kernel32" "-l" "advapi32" "-l" "ws2_32" "-l" "userenv" "-l" "shell32" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
  = note: rust/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmsvcrt.a(lib64_libmsvcrt_os_a-__p__fmode.o):__p__fmode.c:(.rdata$.refptr.__imp__fmode[.refptr.__imp__fmode]+0x0): undefined reference to `__imp__fmode'
          collect2.exe: error: ld returned 1 exit status

error: aborting due to previous error

error: Could not compile `rustc-main`.

Caused by:
  process didn't exit successfully: `rust\msys64\home\...\rust\build\bootstrap/debug/rustc --crate-name rustc rustc\rustc.rs --error-format json --crate-type bin --emit=dep-info,link -C opt-level=2 --cfg feature="jemalloc" --cfg feature="llvm" --cfg feature="rustc_back" --cfg feature="rustc_driver" -C metadata=b67a4fe646fd8794 -C extra-filename=-b67a4fe646fd8794 --out-dir rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\deps --target x86_64-pc-windows-gnu -L dependency=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\deps -L dependency=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\release\deps --extern rustc_back=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\deps\rustc_back-838b735c189dd798.dll --extern rustc_driver=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\deps\rustc_driver-224d9efe142c632e.dll -L native=...\.cargo\registry\src\github.com-1ecc6299db9ec823\dbghelp-sys-0.2.0/x86_64 -L native=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\build\miniz-sys-98d83a845f69b3ab\out -L native=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\build\rustc_binaryen-f106436b515711ff\out/build/lib -L native=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\build\rustc_binaryen-f106436b515711ff\out -L native=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\stage0-rustc\x86_64-pc-windows-gnu\release\build\rustc_llvm-9a040fa1f1937a67\out -L native=rust\msys64\home\...\rust\build\x86_64-pc-windows-gnu\llvm/lib` (exit code: 101)
thread 'main' panicked at 'command did not execute successfully: "rust\\msys64\\home\\...\\rust\\build\\x86_64-pc-windows-gnu\\stage0/bin\\cargo.exe" "build" "--target" "x86_64-pc-windows-gnu" "-j" "4" "--release" "--features" " jemalloc llvm" "--manifest-path" "rust/msys64/home/.../rust\\src/rustc/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101', bootstrap\compile.rs:886:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failed to run: rust/msys64/home/.../rust/build/bootstrap/debug/bootstrap build --stage 1 src/libtest
Build completed unsuccessfully in 0:00:25
```

The code that uses `__p__fmode` was added in https://github.com/mirror/mingw-w64/commit/2e64b9e4537d564478f17b873b2f655f518325ed, apparently in x86_64, it uses its own implementation of it. libmsvcrt.a is kind of a weird beast, it's both an import library for the system msvcrt.dll, but it also is a library that includes compiled code.

For some reason it fails to find the reference for the import symbol that is found in the very same archive as the function that uses it. I don't know what in the Rust code base triggers this. i.e. Create an MWE that can show why this PR is required.

This probably *shouldn't be merged* without understanding why this is necessary or not.

To successfully bootstrap rustc and show that this does make the build work (On latest mingw-w64 x86_64 on Msys2):
```sh
$ RUSTFLAGS="-C link-arg=-lmsvcrt" ./x.py build --stage 1 src/libtest
$ ./x.py build --keep-stage 1 --stage 2 src/libtest # Should work with the patch, and fail without it
```

Issue https://github.com/rust-lang/rust/issues/47265

6 years agoRollup merge of #47481 - estebank:unused-args, r=arielb1
kennytm [Wed, 17 Jan 2018 17:57:25 +0000 (01:57 +0800)]
Rollup merge of #47481 - estebank:unused-args, r=arielb1

Point at unused arguments for format string

Avoid overlapping spans by only pointing at the arguments that are not
being used in the argument string. Enable libsyntax to have diagnostics
with multiple primary spans by accepting `Into<MultiSpan>` instead of
`Span`.

Partially addresses #41850.

6 years agoRollup merge of #47479 - zackmdavis:and_the_case_of_the_suggested_double-pub, r=estebank
kennytm [Wed, 17 Jan 2018 17:57:24 +0000 (01:57 +0800)]
Rollup merge of #47479 - zackmdavis:and_the_case_of_the_suggested_double-pub, r=estebank

private no-mangle lints: only suggest `pub` if it doesn't already exist

Fixes #47383 (function or static can be `pub` but unreachable because it's in a private module; adding another `pub` is nonsensical).

r? @estebank

6 years agoRollup merge of #47467 - arielb1:cleanup-shims, r=eddyb
kennytm [Wed, 17 Jan 2018 17:57:23 +0000 (01:57 +0800)]
Rollup merge of #47467 - arielb1:cleanup-shims, r=eddyb

remove noop landing pads in cleanup shims

No-op landing pads are already removed in the normal optimization pipeline - so also removing them on the shim pipeline should slightly improve codegen performance, as these cleanup blocks are known to hurt LLVM.

This un-regresses and is therefore a fix for #47442. However, the reporter of that issue should try using `-C panic=abort` instead of carefully avoiding panics.

r? @eddyb

6 years agoRollup merge of #47458 - mark-i-m:lint_array_comma, r=estebank
kennytm [Wed, 17 Jan 2018 17:57:22 +0000 (01:57 +0800)]
Rollup merge of #47458 - mark-i-m:lint_array_comma, r=estebank

Allow a trailing comma in lint_array

fix #47428

6 years agoRollup merge of #47456 - chrisvittal:nll-tests, r=nikomatsakis
kennytm [Wed, 17 Jan 2018 17:57:21 +0000 (01:57 +0800)]
Rollup merge of #47456 - chrisvittal:nll-tests, r=nikomatsakis

Add NLL test for #45045

cc #45045
Part of #47366

r? @nikomatsakis

6 years agoRollup merge of #47444 - etaoins:dont-include-bang-in-macro-suggestion, r=estebank
kennytm [Wed, 17 Jan 2018 17:57:20 +0000 (01:57 +0800)]
Rollup merge of #47444 - etaoins:dont-include-bang-in-macro-suggestion, r=estebank

Don't include bang in macro replacement suggestion

When we suggest the replacement for a macro we include the "!" in the suggested replacement but the span only contains the name of the macro itself. Using that replacement would cause a duplicate "!" in the resulting code.

I originally tried to extend the span to be replaced by 1 byte in rust-lang/rust#47424. However, @zackmdavis pointed out that there can be whitespace between the macro name and the bang.

Instead, just remove the bang from the suggested replacement.

Fixes #47418

r? @estebank

6 years agoRollup merge of #47436 - GuillaumeGomez:up-html-diff, r=QuietMisdreavus
kennytm [Wed, 17 Jan 2018 17:57:19 +0000 (01:57 +0800)]
Rollup merge of #47436 - GuillaumeGomez:up-html-diff, r=QuietMisdreavus

Update html-diff crate => fix unicode parsing and invalid paths

r? @QuietMisdreavus

6 years agoRollup merge of #47427 - EdSchouten:cloudabi-ci, r=alexcrichton
kennytm [Wed, 17 Jan 2018 17:57:18 +0000 (01:57 +0800)]
Rollup merge of #47427 - EdSchouten:cloudabi-ci, r=alexcrichton

Add a Docker container for doing automated builds for CloudABI.

Setting up a cross compilation toolchain for CloudABI is relatively
easy. It's just a matter of installing a somewhat recent version of
Clang (5.0 preferred) and installing the corresponding
`${target}-cxx-runtime` package, containing a set of core C/C++ libraries
(libc, libc++, libunwind, etc).

Eventually it would be nice if we could also run `x.py test`. That,
however still requires some more work. Both libtest and compiletest
would need to be adjusted to deal with CloudABI's requirement of having
all of an application's dependencies injected. Let's settle for just
doing `x.py dist` for now.

6 years agoRollup merge of #47426 - varkor:default-mir-dump-dir, r=nikomatsakis
kennytm [Wed, 17 Jan 2018 17:57:17 +0000 (01:57 +0800)]
Rollup merge of #47426 - varkor:default-mir-dump-dir, r=nikomatsakis

Add a default directory for -Zmir-dump-dir

The current behaviour of dumping in the current directory is rarely
desirable: a sensible default directory for dumping is much more
convenient. This makes sets the default value for `-Zmir-dump-dir`
to `mir_dump/`.

r? @eddyb

6 years agoRollup merge of #47407 - gaurikholkar:master, r=estebank
kennytm [Wed, 17 Jan 2018 17:57:16 +0000 (01:57 +0800)]
Rollup merge of #47407 - gaurikholkar:master, r=estebank

fix mispositioned span

This fixes #47377

The output now looks like this
```
error[E0369]: binary operation `+` cannot be applied to type `&str`
 --> h.rs:3:11
  |
3 |     let _a = b + ", World!";
  |              ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
  |
3 |     let _a = b.to_owned() + ", World!";
  |              ^^^^^^^^^

error: aborting due to previous error
```
For the case when emojis are involved,  it gives the new output for proper indentation.
But for an indentation as follows,
```
fn main() {
let b = "hello";
    let _a = b + ", World!";
}
```
it still mispositions the span
```
3 |     println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!";
  |                                           ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
  |
3 |     println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";
  |                                           ^^^^^^^
error: aborting due to previous erro
```

cc @estebank  @est31

6 years agoRollup merge of #47404 - integer32llc:reexport-to-re-export, r=steveklabnik
kennytm [Wed, 17 Jan 2018 17:57:15 +0000 (01:57 +0800)]
Rollup merge of #47404 - integer32llc:reexport-to-re-export, r=steveklabnik

Standardize on "re-export" rather than "reexport"

While working on the book with our editors, it was brought to our attention that we're not consistent with when we use "re-export" versus "reexport". For the book, we've decided (with our editors) to go with "re-export"; in prose, I think that looks better. In code, I'm fine with "reexport".

However, the rustdoc generated section is currently "Reexports", so when we have a screenshot of generated documentation with the prose where we use "re-export", it's inconsistent.

It's too late to fix this for the book because we're using 1.21.0 for the output in the book, and it's really only one spot so it's not a huge deal, but I'd like to advocate for changing the documentation header so that a future edition of the book can be consistent.

The first commit here only changes the documentation section heading text and rustdoc documentation that references it. This is the commit that's most important to me.

The second commit changes error messages and associated tests to also be consistent with the use of re-export. This is the next most important commit to me, but I could be argued out of this one because then it won't match code like the `macro_reexports` feature name, which ostensibly should change to `macro_re_exports` to be most consistent but I didn't want to change code.

The last commit changes re-export anywhere else in prose: either in documentation comments or regular comments. This is least important as most of them aren't user-visible. Instances like these will likely sneak back in over time. I'm totally fine dropping this commit if anyone wants, but [the hobgoblins made me do it](http://www.bartleby.com/100/420.47.html) and it sets a good example.

r? @steveklabnik

6 years agoRollup merge of #47387 - Rantanen:linkchecker-error-msg, r=steveklabnik
kennytm [Wed, 17 Jan 2018 17:57:14 +0000 (01:57 +0800)]
Rollup merge of #47387 - Rantanen:linkchecker-error-msg, r=steveklabnik

Report errors instead of panic!() when linkcheck encounters absolute paths

The RBE contained some absolute links that failed the link check in #46196. Diagnosing these issues was needlessly complicated, thanks to the linkchecker just panicing instead of reporting proper errors.

This PR replaces the panic with a proper `*errors = true` + error message handling.

The linkchecker itself doesn't have any tests so I intentionally didn't touch anything else than the code that previously did the `panic!()`. A small code quality improvement might be made by binding the `Path::new(base).join(url)` into a variable before the for-loop and using this resolved url in both the for loop and the error message.

r? @steveklabnik

(If not for any other reason than having r on the #46196.)

6 years agoRollup merge of #47333 - arthurprs:iter-position-bounds-check, r=dtolnay
kennytm [Wed, 17 Jan 2018 17:57:13 +0000 (01:57 +0800)]
Rollup merge of #47333 - arthurprs:iter-position-bounds-check, r=dtolnay

Optimize slice.{r}position result bounds check

Second attempt of https://github.com/rust-lang/rust/pull/45501
Fixes https://github.com/rust-lang/rust/issues/45964

Demo: https://godbolt.org/g/N4mBHp

6 years agoRollup merge of #47302 - andjo403:commentfix, r=michaelwoerister
kennytm [Wed, 17 Jan 2018 17:57:12 +0000 (01:57 +0800)]
Rollup merge of #47302 - andjo403:commentfix, r=michaelwoerister

fix faulty comment

after #43506 there is no fixed number of request sent.

6 years agowhitelist x86 fxsr feature
gnzlbg [Wed, 17 Jan 2018 11:21:14 +0000 (12:21 +0100)]
whitelist x86 fxsr feature

6 years agoAuto merge of #47035 - acfoltzer:dep-info-tweak, r=alexcrichton
bors [Wed, 17 Jan 2018 09:22:22 +0000 (09:22 +0000)]
Auto merge of #47035 - acfoltzer:dep-info-tweak, r=alexcrichton

Remove dep-info files as targets in themselves

If you ask `rustc` to `--emit dep-info`, the resulting dependency file contains a rule for producing the dependency file itself. This differs from the output of `gcc -MD` or `clang -MD`, which only includes dependency rules for the object files produced.

Tools like Ninja often consume and delete dependency files as soon as they’re produced for performance reasons, particularly on Windows. In the case of `rustc` output, though, the recently-deleted dependency file is cached by Ninja as a target, and therefore triggers a rebuild every time.

This very small patch removes the dep-info file from the list of output filenames, so it matches the behavior of gcc and clang.

6 years agoAdd secondary span pointing at the statement (error span)
Esteban Küber [Wed, 17 Jan 2018 02:11:35 +0000 (18:11 -0800)]
Add secondary span pointing at the statement (error span)

6 years agoUpdate rust-installer for streaming parallelism
Josh Stone [Wed, 17 Jan 2018 02:06:32 +0000 (18:06 -0800)]
Update rust-installer for streaming parallelism

Pull in rust-lang/rust-installer#76 to get streamed tarball generation,
rather than batching it all in memory, while still getting the benefit
of compressing in parallel.

6 years agorustc: Spawn `cmd /c` for `.bat` scripts
Alex Crichton [Tue, 16 Jan 2018 23:49:58 +0000 (15:49 -0800)]
rustc: Spawn `cmd /c` for `.bat` scripts

This fixes an accidental regression #46335 where the behavior of
`Path::ends_with` is different from `str::ends_with` (paths operate over
components, strs operate over chars).

6 years agoDocument the mingw -lmsvcrt hack better
Segev Finer [Tue, 16 Jan 2018 23:18:04 +0000 (01:18 +0200)]
Document the mingw -lmsvcrt hack better

6 years agoOnly enable CloudABI builds for x86-64 for now.
Ed Schouten [Tue, 16 Jan 2018 22:21:51 +0000 (23:21 +0100)]
Only enable CloudABI builds for x86-64 for now.

We'll turn on other architectures if it turns out we have enough
capacity.

6 years agoAllow a trailing comma in lint_array; fix #47428
Mark Mansi [Mon, 15 Jan 2018 16:29:30 +0000 (10:29 -0600)]
Allow a trailing comma in lint_array; fix #47428

6 years agoIntegrate dist-cloudabi into dist-various-2.
Ed Schouten [Tue, 16 Jan 2018 21:23:18 +0000 (22:23 +0100)]
Integrate dist-cloudabi into dist-various-2.

As discussed in #47427, let's not have a separate container for doing
CloudABI builds. It's a lot faster if we integrate it into an existing
container, so there's less duplication of what's being built.

Upgrade the existing container to Ubuntu 17.10, which is required for
CloudABI builds. The version of Clang shipped with 16.04 is not recent
enough to support CloudABI properly.

6 years agofix minor errors
Gauri [Tue, 16 Jan 2018 20:37:07 +0000 (02:07 +0530)]
fix minor errors

6 years agousing tabs in ui tests
Gauri [Tue, 16 Jan 2018 20:30:09 +0000 (02:00 +0530)]
using tabs in ui tests

6 years agofix tidy checks
Gauri [Tue, 16 Jan 2018 20:01:21 +0000 (01:31 +0530)]
fix tidy checks

6 years agoMake non-found module name optional
Dominik Winecki [Tue, 16 Jan 2018 19:47:14 +0000 (14:47 -0500)]
Make non-found module name optional

No longer uses a magic string for missing or root module.

6 years agoRemove incorrect `Default::default` links, add a new one
Geoffry Song [Tue, 16 Jan 2018 19:43:57 +0000 (11:43 -0800)]
Remove incorrect `Default::default` links, add a new one

`map_or` and `map_or_else` don't use `Default::default`, but `unwrap_or_default` does.

6 years agoMove dist-cloudabi/ into disabled/.
Ed Schouten [Sun, 14 Jan 2018 18:47:41 +0000 (19:47 +0100)]
Move dist-cloudabi/ into disabled/.

There is not enough capacity to do automated builds for CloudABI at this
time.

6 years agoAdd a Docker container for doing automated builds for CloudABI.
Ed Schouten [Sun, 14 Jan 2018 17:37:52 +0000 (18:37 +0100)]
Add a Docker container for doing automated builds for CloudABI.

Setting up a cross compilation toolchain for CloudABI is relatively
easy. It's just a matter of installing a somewhat recent version of
Clang (5.0 preferred) and installing the corresponding
${target}-cxx-runtime package, containing a set of core C/C++ libraries
(libc, libc++, libunwind, etc).

Eventually it would be nice if we could also run 'x.py test'. That,
however still requires some more work. Both libtest and compiletest
would need to be adjusted to deal with CloudABI's requirement of having
all of an application's dependencies injected. Let's settle for just
doing 'x.py dist' for now.

6 years agoFix for older JS versions
Guillaume Gomez [Tue, 16 Jan 2018 14:38:08 +0000 (15:38 +0100)]
Fix for older JS versions

6 years agoadd a comment about parsing only prefix in header.rs
Pulkit Goyal [Tue, 16 Jan 2018 13:39:32 +0000 (19:09 +0530)]
add a comment about parsing only prefix in header.rs

6 years agorename parse_cfg_prefix() to has_cfg_prefix()
Pulkit Goyal [Tue, 16 Jan 2018 13:30:42 +0000 (19:00 +0530)]
rename parse_cfg_prefix() to has_cfg_prefix()

The function parse_cfg_prefix() is not really parsing. It's just checking
whether the prefix is present or not. So the new function name as suggested by
@Mark-Simulacrum is better.

6 years agoreturn the boolean value directly instead of using if-else
Pulkit Goyal [Tue, 16 Jan 2018 09:32:29 +0000 (15:02 +0530)]
return the boolean value directly instead of using if-else

Previous patch introduced something like if x {true} else {false} which can be
simply replaced by returning x here.

Thanks to @kennytm for spotting it.

6 years agoimplement "only-<platforms>" for test headers
Pulkit Goyal [Tue, 16 Jan 2018 09:07:05 +0000 (14:37 +0530)]
implement "only-<platforms>" for test headers

This patch implements "only-<platforms>" for tests headers using which one can
specify just the platforms on which the test should run rather than listing all
the platforms to ignore using "ignore-<platforms>".

This is a fix for issues #33581 and #47459.

6 years agoin which the private no-mangle lints receive a valued lesson in humility
Zack M. Davis [Tue, 16 Jan 2018 02:32:18 +0000 (18:32 -0800)]
in which the private no-mangle lints receive a valued lesson in humility

The incompetent fool who added these suggestions in 38e5a964f2 apparently
thought it was safe to assume that, because the offending function or
static was unreachable, it would therefore have not have any existing
visibility modifiers, making it safe for us to unconditionally suggest
inserting `pub`. This isn't true.

This resolves #47383.

6 years agoAuto merge of #47209 - eddyb:ccx, r=nikomatsakis
bors [Tue, 16 Jan 2018 08:06:15 +0000 (08:06 +0000)]
Auto merge of #47209 - eddyb:ccx, r=nikomatsakis

rustc_trans: reorganize CrateContext and rename context types.

Firstly, the `{Shared,Local}CrateContext` hasn't been meaningful for a while now, and this PR resolves it by moving all their fields to `CrateContext` and removing redundant accessor methods.

Secondly, this PR contains the following mass-renames:
* `ccx: CrateContext` -> `cx: CodegenCx`
* `mircx: MirContext` -> `fx: FunctionCx`
* `bcx: Builder` -> `bx: Builder`

r? @nikomatsakis

6 years agoPoint at unused arguments for format string
Esteban Küber [Tue, 16 Jan 2018 05:38:12 +0000 (21:38 -0800)]
Point at unused arguments for format string

Avoid overlapping spans by only pointing at the arguments that are not
being used in the argument string. Enable libsyntax to have diagnostics
with multiple primary spans by accepting `Into<MultiSpan>` instead of
`Span`.

6 years agoAdd "-lmsvcrt" twice to get rustc to build with the latest mingw64
Segev Finer [Tue, 16 Jan 2018 05:27:04 +0000 (07:27 +0200)]
Add "-lmsvcrt" twice to get rustc to build with the latest mingw64

6 years agoremove noop landing pads in cleanup shims
Ariel Ben-Yehuda [Mon, 15 Jan 2018 21:57:44 +0000 (23:57 +0200)]
remove noop landing pads in cleanup shims

These are already removed in the normal optimization pipeline - so this
should slightly improve codegen performance, as these cleanup blocks are
known to hurt LLVM.

This un-regresses and is therefore a fix for #47442. However, the
reporter of that issue should try using `-C panic=abort` instead of
carefully avoiding panics.

6 years agoAdd `-Z dep-info-omit-d-target` to control dep-info style
Adam C. Foltzer [Mon, 15 Jan 2018 21:08:27 +0000 (13:08 -0800)]
Add `-Z dep-info-omit-d-target` to control dep-info style

This avoids a breaking change to dep-info output, putting the
gcc/clang-compliant dep-info behavior behind a flag

6 years agoremove dep-info files as targets in themselves
Adam C. Foltzer [Wed, 27 Dec 2017 17:55:20 +0000 (09:55 -0800)]
remove dep-info files as targets in themselves

6 years agoReexport -> re-export in prose and documentation comments
Carol (Nichols || Goulding) [Fri, 12 Jan 2018 21:41:25 +0000 (16:41 -0500)]
Reexport -> re-export in prose and documentation comments

6 years agoReexport -> re-export in error messages
Carol (Nichols || Goulding) [Fri, 12 Jan 2018 21:41:45 +0000 (16:41 -0500)]
Reexport -> re-export in error messages

6 years agoReexport -> re-export in documentation section headings
Carol (Nichols || Goulding) [Fri, 12 Jan 2018 21:58:33 +0000 (16:58 -0500)]
Reexport -> re-export in documentation section headings

6 years agoAdd NLL test for #45045
Christopher Vittal [Mon, 15 Jan 2018 16:14:47 +0000 (11:14 -0500)]
Add NLL test for #45045

Closes #45045

6 years agoAuto merge of #47413 - GuillaumeGomez:unstable-error-code, r=estebank
bors [Mon, 15 Jan 2018 15:36:54 +0000 (15:36 +0000)]
Auto merge of #47413 - GuillaumeGomez:unstable-error-code, r=estebank

Add error code for unstable feature errors

Fixes #47397.

6 years agoAuto merge of #47445 - kennytm:rollup, r=kennytm
bors [Mon, 15 Jan 2018 12:46:10 +0000 (12:46 +0000)]
Auto merge of #47445 - kennytm:rollup, r=kennytm

Rollup of 10 pull requests

- Successful merges: #47120, #47126, #47277, #47330, #47368, #47372, #47414, #47417, #47432, #47443
- Failed merges: #47334

6 years agoRollup merge of #47443 - FenrirWolf:rand, r=alexcrichton
kennytm [Mon, 15 Jan 2018 08:55:37 +0000 (16:55 +0800)]
Rollup merge of #47443 - FenrirWolf:rand, r=alexcrichton

Remove leftover Rand stuff

The in-tree version of `rand` was removed in 6bc8f164b09b9994e6a2d4c4ca60d7d36c09d3fe, but for some reason this lone file avoided the purge. Figured it's about time to finish the job. :smiling_imp:

6 years agoRollup merge of #47432 - etaoins:make-fulldeps-update-references-exec, r=petrochenkov
kennytm [Mon, 15 Jan 2018 08:55:36 +0000 (16:55 +0800)]
Rollup merge of #47432 - etaoins:make-fulldeps-update-references-exec, r=petrochenkov

Make ui-fulldeps/update-references executable

When a ui-fulldeps comparison fails it suggests running update-references.sh:

```
src/test/ui-fulldeps/update-references.sh 'rust/build/x86_64-apple-darwin/test/ui-fulldeps' 'resolve-error.rs'
```

This does not work as update-references.sh isn't executable. The other update-references.sh in the ui directory is already executable so this looks like an oversight.

6 years agoRollup merge of #47417 - petrochenkov:noasm, r=estebank
kennytm [Mon, 15 Jan 2018 08:55:35 +0000 (16:55 +0800)]
Rollup merge of #47417 - petrochenkov:noasm, r=estebank

Move "no asm" check into AST validation

6 years agoRollup merge of #47414 - est31:master, r=alexcrichton
kennytm [Mon, 15 Jan 2018 08:55:34 +0000 (16:55 +0800)]
Rollup merge of #47414 - est31:master, r=alexcrichton

Enforce dashes in the unstable book file names

Also rename the existing underscore using files to use dashes.

Fixes #47394.

6 years agoRollup merge of #47372 - topecongiro:issue-43925, r=alexcrichton
kennytm [Mon, 15 Jan 2018 08:55:33 +0000 (16:55 +0800)]
Rollup merge of #47372 - topecongiro:issue-43925, r=alexcrichton

Avoid panicking when invalid argument is passed to cfg(..)

Closes #43925.
Closes #43926.

6 years agoRollup merge of #47368 - chrisvittal:nll-tests, r=nikomatsakis
kennytm [Mon, 15 Jan 2018 08:55:32 +0000 (16:55 +0800)]
Rollup merge of #47368 - chrisvittal:nll-tests, r=nikomatsakis

Add NLL tests for #46557 and #38899

This adapts the sample code from the two issues into test code.

Closes #46557
Closes #38899

r? @nikomatsakis

6 years agoRollup merge of #47330 - bmusin:patch-2, r=shepmaster
kennytm [Mon, 15 Jan 2018 08:55:30 +0000 (16:55 +0800)]
Rollup merge of #47330 - bmusin:patch-2, r=shepmaster

fix off-by-one error

Fixes https://github.com/rust-lang/rust/issues/47325.

6 years agoRollup merge of #47277 - tspiteri:log-correctness, r=frewsxcv
kennytm [Mon, 15 Jan 2018 08:55:29 +0000 (16:55 +0800)]
Rollup merge of #47277 - tspiteri:log-correctness, r=frewsxcv

doc: show that `f32::log` and `f64::log` are not correctly rounded

Fixes #47273.

One thing I'm not sure about is whether the "calculated as `self.ln() / base.ln()`" bit is being too specific, maybe we do not want to make this such a strong commitment. I think it's fine, but we should not make commitments in the API documentation by accident.

In case that is removed, the added sentence "`self.log2()` can ... base 10." still makes it amply clear that the `log` methods can be more inaccurate than other methods. If the above clause is removed, this second sentence can be moved to the first paragraph, kind of like the accuracy comment for the [`mul_add`](https://doc.rust-lang.org/std/primitive.f32.html#method.mul_add) method.

6 years agoRollup merge of #47126 - sdroege:exact-chunks, r=bluss
kennytm [Mon, 15 Jan 2018 08:55:28 +0000 (16:55 +0800)]
Rollup merge of #47126 - sdroege:exact-chunks, r=bluss

Add slice::ExactChunks and ::ExactChunksMut iterators

These guarantee that always the requested slice size will be returned
and any leftoever elements at the end will be ignored. It allows llvm to
get rid of bounds checks in the code using the iterator.

This is inspired by the same iterators provided by ndarray.

Fixes https://github.com/rust-lang/rust/issues/47115

I'll add unit tests for all this if the general idea and behaviour makes sense for everybody.
Also see https://github.com/rust-lang/rust/issues/47115#issuecomment-354715511 for an example what this improves.

6 years agoRollup merge of #47120 - clarcharr:io_error_debug, r=dtolnay
kennytm [Mon, 15 Jan 2018 08:55:26 +0000 (16:55 +0800)]
Rollup merge of #47120 - clarcharr:io_error_debug, r=dtolnay

Better Debug impl for io::Error.

This PR includes the below changes:

1. The former impl wrapped the entire thing in `Error { repr: ... }` which was unhelpful; this has been removed.
2. The `Os` variant of `io::Error` included the code and message, but not the kind; this has been fixed.
3. The `Custom` variant of `io::Error` included a `Custom(Custom { ... })`, which is now just `Custom { ... }`.

Example of previous impl:

```rust
Error {
    repr: Custom(
        Custom {
            kind: InvalidData,
            error: Error {
                repr: Os {
                    code: 2,
                    message: "no such file or directory"
                }
            }
        }
    )
}
```

Example of new impl:

```rust
Custom {
    kind: InvalidData,
    error: Os {
        code: 2,
        kind: NotFound,
        message: "no such file or directory"
    }
}
```

6 years agoAdd error code for unstable feature errors
Guillaume Gomez [Sat, 13 Jan 2018 13:05:51 +0000 (14:05 +0100)]
Add error code for unstable feature errors

6 years agoDon't include bang in macro replacement suggestion
Ryan Cumming [Sun, 14 Jan 2018 21:08:22 +0000 (08:08 +1100)]
Don't include bang in macro replacement suggestion

When we suggest the replacement for a macro we include the "!" in the
suggested replacement but the span only contains the name of the macro
itself. Using that replacement would cause a duplicate "!" in the
resulting code.

I originally tried to extend the span to be replaced by 1 byte in
rust-lang/rust#47424. However, @zackmdavis pointed out that there can be
whitespace between the macro name and the bang.

Instead, just remove the bang from the suggested replacement.

Fixes #47418

6 years agoAuto merge of #47329 - davidtwco:issue-46983, r=nikomatsakis
bors [Mon, 15 Jan 2018 06:52:12 +0000 (06:52 +0000)]
Auto merge of #47329 - davidtwco:issue-46983, r=nikomatsakis

NLL: bad error message when converting anonymous lifetime to `'static`

Fixes #46983.

r? @nikomatsakis

6 years agoRemove leftover Rand stuff
Fenrir [Mon, 15 Jan 2018 06:07:51 +0000 (23:07 -0700)]
Remove leftover Rand stuff

6 years agoAuto merge of #46196 - projektir:rbe-submodule, r=steveklabnik
bors [Mon, 15 Jan 2018 02:02:22 +0000 (02:02 +0000)]
Auto merge of #46196 - projektir:rbe-submodule, r=steveklabnik

Adding RBE as a submodule #46194

Adding RBE as a submodule to start issue #46194.

6 years agoFix test
varkor [Mon, 15 Jan 2018 00:09:39 +0000 (00:09 +0000)]
Fix test

6 years agoUpdate html-diff crate => fix unicode parsing and invalid paths
Guillaume Gomez [Sun, 14 Jan 2018 23:40:49 +0000 (00:40 +0100)]
Update html-diff crate => fix unicode parsing and invalid paths

6 years agoMake ui-fulldeps/update-references executable
Ryan Cumming [Sun, 14 Jan 2018 21:09:55 +0000 (08:09 +1100)]
Make ui-fulldeps/update-references executable

When a ui-fulldeps comparison fails it suggests running
update-references.sh:

```
src/test/ui-fulldeps/update-references.sh 'rust/build/x86_64-apple-darwin/test/ui-fulldeps' 'resolve-error.rs'
```

This does not work as update-references.sh isn't executable. The other
update-references.sh in the ui directory is already executable so this looks
like an oversight.

6 years agoMake dump_mir_dir non-optional
varkor [Sun, 14 Jan 2018 20:02:07 +0000 (20:02 +0000)]
Make dump_mir_dir non-optional

6 years agoAdd a default directory for -Zmir-dump-dir
varkor [Sun, 14 Jan 2018 17:15:39 +0000 (17:15 +0000)]
Add a default directory for -Zmir-dump-dir

The current behaviour of dumping in the current directory is rarely
desirable: a sensible default directory for dumping is much more
convenient.

6 years agoAuto merge of #46455 - petrochenkov:pimpl, r=nikomatsakis
bors [Sun, 14 Jan 2018 16:56:15 +0000 (16:56 +0000)]
Auto merge of #46455 - petrochenkov:pimpl, r=nikomatsakis

syntax: Rewrite parsing of impls

Properly parse impls for the never type `!`
Recover from missing `for` in `impl Trait for Type`
Prohibit inherent default impls and default impls of auto traits (https://github.com/rust-lang/rust/issues/37653#issuecomment-348687794, https://github.com/rust-lang/rust/issues/37653#issuecomment-348688785)
Change wording in more diagnostics to use "auto traits"
Fix some spans in diagnostics
Some other minor code cleanups in the parser
Disambiguate generics and qualified paths in impls (parse `impl <Type as Trait>::AssocTy { ... }`)
Replace the future-compatibility hack from https://github.com/rust-lang/rust/pull/38268 with actually parsing generic parameters
Add a test for https://github.com/rust-lang/rust/issues/46438

6 years agosyntax: Disambiguate generics and qualified paths
Vadim Petrochenkov [Sun, 14 Jan 2018 15:10:19 +0000 (18:10 +0300)]
syntax: Disambiguate generics and qualified paths

6 years agosyntax: Rewrite parsing of impls
Vadim Petrochenkov [Sat, 2 Dec 2017 19:15:03 +0000 (22:15 +0300)]
syntax: Rewrite parsing of impls

Properly parse impls for the never type `!`
Recover from missing `for` in `impl Trait for Type`
Prohibit inherent default impls and default impls of auto traits
Change wording in more diagnostics to use "auto traits"
Some minor code cleanups in the parser

6 years agoAuto merge of #47322 - nikomatsakis:nll-ice, r=pnkfelix
bors [Sun, 14 Jan 2018 14:11:59 +0000 (14:11 +0000)]
Auto merge of #47322 - nikomatsakis:nll-ice, r=pnkfelix

resolve type and region variables in "NLL dropck"

Fixes #47022.

r? @pnkfelix

6 years agoAuto merge of #47274 - Manishearth:rustdoc-span, r=QuietMisdreavus
bors [Sun, 14 Jan 2018 11:28:27 +0000 (11:28 +0000)]
Auto merge of #47274 - Manishearth:rustdoc-span, r=QuietMisdreavus

Use correct line offsets for doctests

Not yet tested.

This doesn't handle char positions. It could if I collected a map of char offsets and lines, but this is a bit more work and requires hooking into the parser much more (unsure if it's possible).

r? @QuietMisdreavus

(fixes #45868)

6 years agoAuto merge of #47268 - EdSchouten:cloudabi-libstd, r=alexcrichton
bors [Sun, 14 Jan 2018 08:49:10 +0000 (08:49 +0000)]
Auto merge of #47268 - EdSchouten:cloudabi-libstd, r=alexcrichton

Implement libstd for CloudABI.

Though CloudABI is strongly inspired by POSIX, its absence of features that don't work well with capability-based sandboxing makes it different enough that adding bits to `sys/unix` will make things a mess. This change therefore adds CloudABI specific platform code under `sys/cloudabi`.

One of the goals of this implementation is to build as much as possible directly on top of CloudABI's system call layer, as opposed to using the C library. This is preferred, as the system call layer is supposed to be stable, whereas the C library ABI technically is not. An advantage of this approach is that it allows us to implement certain interfaces, such as mutexes and condition variables more optimally. They can be lighter than the ones provided by pthreads.

This change disables some modules that cannot realistically be implemented right now. For example, libstd's pathname abstraction is not designed with POSIX `*at()` (e.g., `openat()`) in mind. The `*at()` functions are the only set of file system APIs available on CloudABI. There is no global file system namespace, nor a process working directory. Discussions on how to port these modules over are outside the scope of this change.

6 years agorustc_trans: rename mircx: MirContext to fx: FunctionCx.
Eduard-Mihai Burtescu [Fri, 5 Jan 2018 05:34:28 +0000 (07:34 +0200)]
rustc_trans: rename mircx: MirContext to fx: FunctionCx.

6 years agorustc_trans: rename bcx to bx.
Eduard-Mihai Burtescu [Fri, 5 Jan 2018 05:12:32 +0000 (07:12 +0200)]
rustc_trans: rename bcx to bx.

6 years agorustc_trans: rename ccx to cx.
Eduard-Mihai Burtescu [Fri, 5 Jan 2018 05:04:08 +0000 (07:04 +0200)]
rustc_trans: rename ccx to cx.

6 years agorustc_trans: rename CrateContext to CodegenCx.
Eduard-Mihai Burtescu [Fri, 5 Jan 2018 05:01:54 +0000 (07:01 +0200)]
rustc_trans: rename CrateContext to CodegenCx.

6 years agorustc_trans: access fields directly on CrateContext.
Eduard-Mihai Burtescu [Fri, 5 Jan 2018 04:58:34 +0000 (06:58 +0200)]
rustc_trans: access fields directly on CrateContext.

6 years agorustc_trans: remove unused `TargetDataRef` accessor.
Eduard-Mihai Burtescu [Fri, 5 Jan 2018 04:21:57 +0000 (06:21 +0200)]
rustc_trans: remove unused `TargetDataRef` accessor.

6 years agorustc_trans: collapse {Local,Shared}CrateContext.
Eduard-Mihai Burtescu [Fri, 5 Jan 2018 04:14:44 +0000 (06:14 +0200)]
rustc_trans: collapse {Local,Shared}CrateContext.

6 years agoAuto merge of #47261 - estebank:immutable-arg, r=petrochenkov
bors [Sun, 14 Jan 2018 06:09:14 +0000 (06:09 +0000)]
Auto merge of #47261 - estebank:immutable-arg, r=petrochenkov

Assignment to immutable argument: diagnostic tweak

Re #46659.

6 years agoAuto merge of #47223 - alexcrichton:new-target-feature, r=eddyb
bors [Sun, 14 Jan 2018 03:27:35 +0000 (03:27 +0000)]
Auto merge of #47223 - alexcrichton:new-target-feature, r=eddyb

rustc: Tweak `#[target_feature]` syntax

This is an implementation of the `#[target_feature]` syntax-related changes of
[RFC 2045][rfc]. Notably two changes have been implemented:

* The new syntax is `#[target_feature(enable = "..")]` instead of
  `#[target_feature = "+.."]`. The `enable` key is necessary instead of the `+`
  to indicate that a feature is being enabled, and a sub-list is used for
  possible expansion in the future. Additionally within this syntax the feature
  names being enabled are now whitelisted against a known set of target feature
  names that we know about.

* The `#[target_feature]` attribute can only be applied to unsafe functions. It
  was decided in the RFC that invoking an instruction possibly not defined for
  the current processor is undefined behavior, so to enable this feature for now
  it requires an `unsafe` intervention.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/2045-target-feature.md

6 years agoAuto merge of #46832 - Diggsey:bufread-cheaper-seek, r=alexcrichton
bors [Sun, 14 Jan 2018 00:42:11 +0000 (00:42 +0000)]
Auto merge of #46832 - Diggsey:bufread-cheaper-seek, r=alexcrichton

BufRead: Only flush the internal buffer if seeking outside of it.

Fixes #31100

r? @dtolnay

6 years agorustc: Refactor attribute checking to operate on HIR
Alex Crichton [Mon, 8 Jan 2018 21:43:42 +0000 (13:43 -0800)]
rustc: Refactor attribute checking to operate on HIR

This'll enable running queries that could be cached and overall be more amenable
to the query infastructure.

6 years agoAuto merge of #47416 - petrochenkov:remove-impl-for-dot-dot, r=petrochenkov
bors [Sat, 13 Jan 2018 21:48:12 +0000 (21:48 +0000)]
Auto merge of #47416 - petrochenkov:remove-impl-for-dot-dot, r=petrochenkov

Remove `impl Foo for .. {}` in favor `auto trait Foo {}`

Rebase of https://github.com/rust-lang/rust/pull/46480 with restored parsing support.

6 years agoOnly run rustdoc-js test suite when nodejs is available
Guillaume Gomez [Sat, 13 Jan 2018 21:35:41 +0000 (22:35 +0100)]
Only run rustdoc-js test suite when nodejs is available

6 years agoAdding RBE as a submodule #46194
projektir [Sat, 2 Dec 2017 02:29:12 +0000 (18:29 -0800)]
Adding RBE as a submodule #46194

6 years agoMove "no asm" check into AST validation
Vadim Petrochenkov [Sat, 13 Jan 2018 20:13:49 +0000 (23:13 +0300)]
Move "no asm" check into AST validation