Commit Graph

74523 Commits

Author SHA1 Message Date
Alex Crichton
6defae31f6 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).
2018-01-16 15:52:24 -08:00
Segev Finer
1606341697
Document the mingw -lmsvcrt hack better 2018-01-17 01:18:04 +02:00
Ed Schouten
dcf0cd0ac0 Only enable CloudABI builds for x86-64 for now.
We'll turn on other architectures if it turns out we have enough
capacity.
2018-01-16 23:21:51 +01:00
Mark Mansi
f81c2ded5e Allow a trailing comma in lint_array; fix #47428 2018-01-16 16:07:49 -06:00
Ed Schouten
ae4288f9ff 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.
2018-01-16 22:23:18 +01:00
Ariel Ben-Yehuda
06e32d044d avoid double-unsizing arrays in bytestring match lowering
The match lowering code, when lowering matches against bytestrings,
works by coercing both the scrutinee and the pattern to `&[u8]` and
then comparing them using `<[u8] as Eq>::eq`.

If the scrutinee is already of type `&[u8]`, then unsizing it is both
unneccessary and a trait error caught by the new and updated MIR typeck,
so this PR changes lowering to avoid doing that (match lowering tried to
avoid that before, but that attempt was quite broken).

Fixes #46920.
2018-01-16 23:23:11 +02:00
Gauri
efe3d69ad8 fix minor errors 2018-01-17 02:07:15 +05:30
Gauri
a4e3f361ba using tabs in ui tests 2018-01-17 02:00:09 +05:30
Gauri
d769539f42 fix tidy checks 2018-01-17 01:31:21 +05:30
Dominik Winecki
1dcfd144b9 Make non-found module name optional
No longer uses a magic string for missing or root module.
2018-01-16 14:47:14 -05:00
Geoffry Song
46c20c0990
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.
2018-01-16 11:43:57 -08:00
QuietMisdreavus
ab7f02d0a8 add documentation from doc(include) to analysis data 2018-01-16 13:31:42 -06:00
Ed Schouten
5801f95cbc Move dist-cloudabi/ into disabled/.
There is not enough capacity to do automated builds for CloudABI at this
time.
2018-01-16 20:31:09 +01:00
Ed Schouten
24c3a6db9b 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.
2018-01-16 20:31:09 +01:00
Michael Woerister
f0a7d8e2bd Add incremental-fulldeps test suite and regression test for #47290. 2018-01-16 19:31:15 +01:00
Niko Matsakis
3b390e5420 remove bogus assertion and comments
The code (incorrectly) assumed that constants could not have generics
in scope, but it's not really a problem if they do.
2018-01-16 12:45:39 -05:00
Taylor Cramer
f25f468709 Adjust wording of Placer trait safety requirements 2018-01-16 08:51:24 -08:00
Michael Woerister
8756ef6385 Don't include DefIndex in plugin- and proc-macro registrar fn symbol. 2018-01-16 17:30:11 +01:00
Eduard-Mihai Burtescu
cbeebc5b2c rustc_trans: take into account primitives larger than 8 bytes. 2018-01-16 18:12:13 +02:00
Eduard-Mihai Burtescu
9b95e914a1 rustc_trans: ignore trailing padding larger than 8 bytes. 2018-01-16 18:04:24 +02:00
Guillaume Gomez
3a7e247acb Fix for older JS versions 2018-01-16 15:38:08 +01:00
Pulkit Goyal
bd70f0fa66 add a comment about parsing only prefix in header.rs 2018-01-16 19:09:32 +05:30
Pulkit Goyal
567b07c9e6 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.
2018-01-16 19:00:42 +05:30
Vadzim Dambrouski
98dee04bae Add run-make test for no_integrated_as flag. 2018-01-16 16:00:31 +03:00
Robin Kruppe
9eb473579a Compute LLVM argument indices correctly in face of padding
Closes #47278
2018-01-16 12:49:38 +01:00
Pulkit Goyal
1e436eb236 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.
2018-01-16 15:02:29 +05:30
Pulkit Goyal
fd075c6f21 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.
2018-01-16 14:37:05 +05:30
Zack M. Davis
661e03383c 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.
2018-01-16 00:31:43 -08:00
bors
da569fa9dd 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
2018-01-16 08:06:15 +00:00
Robin Kruppe
2be697bc21 Implement repr(transparent) 2018-01-16 08:58:32 +01:00
Esteban Küber
a4660dfea2 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`.
2018-01-15 21:38:12 -08:00
Segev Finer
bfde33f2fb Add "-lmsvcrt" twice to get rustc to build with the latest mingw64 2018-01-16 07:27:04 +02:00
Wesley Wiser
45bd091e76 [incremental] Cache ty::Slice<T> hashes
Fixes #47294
2018-01-15 20:16:40 -05:00
Wesley Wiser
14780b310e [incremental] Cache AdtDef hashes
Part of #47294
2018-01-15 20:16:40 -05:00
Esteban Küber
282f75a4ce Review comments: remove enum suggestion 2018-01-15 15:20:48 -08:00
Esteban Küber
71c08734a3 Move ExprPrecedence to libsyntax/util/parser.rs 2018-01-15 15:09:39 -08:00
Esteban Küber
9b36030a65 On E0283, point at method with the requirements
On required type annotation diagnostic error, point at method with the
requirements if the span is available.
2018-01-15 14:56:32 -08:00
Esteban Küber
a0d44976bb Do not suggest to make mut binding external to Fn closure 2018-01-15 14:19:33 -08:00
Ariel Ben-Yehuda
dc44d41b98 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.
2018-01-16 00:07:06 +02:00
Adam C. Foltzer
8c09d29d04 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
2018-01-15 13:19:46 -08:00
Adam C. Foltzer
7e99764df3 remove dep-info files as targets in themselves 2018-01-15 13:18:49 -08:00
Esteban Küber
4a7691692c Further tweaks to the output
- Properly address Variant Ctors
- Show signature if span of trait method without `self` is not available
2018-01-15 12:35:15 -08:00
Ryan Cumming
090a968fe7 Only link res_init() on GNU/*nix
To workaround a bug in glibc <= 2.26 lookup_host() calls res_init()
based on the glibc version detected at runtime. While this avoids
calling res_init() on platforms where it's not required we will still
end up linking against the symbol.

This causes an issue on macOS where res_init() is implemented in a
separate library (libresolv.9.dylib) from the main libc. While this is
harmless for standalone programs it becomes a problem if Rust code is
statically linked against another program. If the linked program doesn't
already specify -lresolv it will cause the link to fail. This is
captured in issue #46797

Fix this by hooking in to the glibc workaround in `cvt_gai` and only
activating it for the "gnu" environment on Unix This should include all
glibc platforms while excluding musl, windows-gnu, macOS, FreeBSD, etc.

This has the side benefit of removing the #[cfg] in sys_common; only
unix.rs has code related to the workaround now.
2018-01-16 06:30:44 +11:00
Esteban Küber
1820da5211 Move diagnostic logic to its own module
- Move specialized borrow checker diagnostic for bindings escaping its
  closure to its own module.
- Move affected tests to `ui`.
2018-01-15 11:12:25 -08:00
Carol (Nichols || Goulding)
e168aa385b
Reexport -> re-export in prose and documentation comments 2018-01-15 13:36:53 -05:00
Carol (Nichols || Goulding)
90fcd4476c
Reexport -> re-export in error messages 2018-01-15 13:36:52 -05:00
Carol (Nichols || Goulding)
c698496f84
Reexport -> re-export in documentation section headings 2018-01-15 13:36:52 -05:00
Marcel Hellwig
38e5d304fe extended dt with kbd tags
removed styling of dt tages, which would make them look like keys and
added <kbd> tag inside of dt tag.
Added css style for kbd and removed some stylings for dt
2018-01-15 18:12:38 +01:00
Christopher Vittal
f9e1b9c2c2 Add NLL test for #45045
Closes #45045
2018-01-15 11:14:47 -05:00
est31
38ddb446b9 Check for deadlinks from the summary during book generation
Previously, any deadlinks from a book's SUMMARY.md wouldn't
cause any errors or warnings or similar but mdbook would simply
create a page with blank content.

This has kept bug #47394 hidden. It should have been detected
back in the PR when those wrongly named files got added to the
book.

PR #47414 was one component of the solution. This change
is a second line of defense for the unstable book and a first
line of defense for any other book.

We also update mdbook to the most recent version.
2018-01-15 16:39:20 +01:00