]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoUpdate compiler-builtins submodule
Alex Crichton [Wed, 24 Jan 2018 15:47:40 +0000 (07:47 -0800)]
Update compiler-builtins submodule

No sense of urgency, just wanted to make sure we don't lag too far behind!

6 years agoAuto merge of #45337 - Zoxc:gen-static, r=nikomatsakis
bors [Tue, 23 Jan 2018 22:50:03 +0000 (22:50 +0000)]
Auto merge of #45337 - Zoxc:gen-static, r=nikomatsakis

Immovable generators

This adds support for immovable generators which allow you to borrow local values inside generator across suspension points. These are declared using a `static` keyword:
```rust
let mut generator = static || {
    let local = &Vec::new();
    yield;
    local.push(0i8);
};
generator.resume();

// ERROR moving the generator after it has resumed would invalidate the interior reference
// drop(generator);
```

Region inference is no longer affected by the types stored in generators so the regions inside should be similar to other code (and unaffected by the presence of `yield` expressions). The borrow checker is extended to pick up the slack so interior references still result in errors for movable generators. This fixes #44197, #45259 and #45093.

This PR depends on [PR #44917 (immovable types)](https://github.com/rust-lang/rust/pull/44917), I suggest potential reviewers ignore the first commit as it adds immovable types.

6 years agoAuto merge of #47678 - kennytm:rollup, r=kennytm
bors [Tue, 23 Jan 2018 16:13:18 +0000 (16:13 +0000)]
Auto merge of #47678 - kennytm:rollup, r=kennytm

Rollup of 14 pull requests

- Successful merges: #47423, #47425, #47440, #47541, #47549, #47554, #47558, #47610, #47635, #47655, #47661, #47662, #47667, #47672
- Failed merges:

6 years agoRollup merge of #47672 - ollie27:rustdoc_auto_traits, r=GuillaumeGomez
kennytm [Tue, 23 Jan 2018 09:03:47 +0000 (17:03 +0800)]
Rollup merge of #47672 - ollie27:rustdoc_auto_traits, r=GuillaumeGomez

rustdoc: Show when traits are auto traits

6 years agoRollup merge of #47667 - GuillaumeGomez:fix-quoted-search, r=QuietMisdreavus
kennytm [Tue, 23 Jan 2018 09:03:46 +0000 (17:03 +0800)]
Rollup merge of #47667 - GuillaumeGomez:fix-quoted-search, r=QuietMisdreavus

Fix quoted search

r? @QuietMisdreavus

6 years agoRollup merge of #47662 - spastorino:add_test_to_nll, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:45 +0000 (17:03 +0800)]
Rollup merge of #47662 - spastorino:add_test_to_nll, r=nikomatsakis

Add dynamic-drop test to nll tests also

r? @nikomatsakis

Fixes #47585

6 years agoRollup merge of #47661 - bjorn3:refactor_driver, r=michaelwoerister
kennytm [Tue, 23 Jan 2018 09:03:44 +0000 (17:03 +0800)]
Rollup merge of #47661 - bjorn3:refactor_driver, r=michaelwoerister

Inline some rustc_driver function

6 years agoRollup merge of #47655 - etaoins:fix-spurious-warning-on-empty-proc-macro-crate,...
kennytm [Tue, 23 Jan 2018 09:03:43 +0000 (17:03 +0800)]
Rollup merge of #47655 - etaoins:fix-spurious-warning-on-empty-proc-macro-crate, r=alexcrichton

Fix spurious warning on empty proc macro crates

While attempting to reproduce rust-lang/rust#47086 I noticed the following warning:

```shell
> rustc /dev/null --crate-type proc-macro
warning: unused variable: `registrar`
 --> /dev/null:0:1
```

As there are no macros to register the automatically generated registrar function for the crate has no body. As a result its `registrar` argument is unused triggering the above warning.

The warning is confusing and not easily actionable by the developer. It could also be triggered legitimately by e.g. having all of the macros in a crate #[cfg]'ed out.

Fix by naming the generated argument `_registrar` inside `mk_registrar()`. This suppresses the unused variable warning.

6 years agoRollup merge of #47635 - Zoxc:remove-attr, r=michaelwoerister
kennytm [Tue, 23 Jan 2018 09:03:42 +0000 (17:03 +0800)]
Rollup merge of #47635 - Zoxc:remove-attr, r=michaelwoerister

Remove the IGNORED_ATTR_NAMES thread local

6 years agoAuto merge of #47620 - GuillaumeGomez:multiple-themes, r=QuietMisdreavus
bors [Tue, 23 Jan 2018 13:23:58 +0000 (13:23 +0000)]
Auto merge of #47620 - GuillaumeGomez:multiple-themes, r=QuietMisdreavus

Multiple themes for rustdoc

r? @QuietMisdreavus

6 years agoRollup merge of #47610 - cuviper:captured-dwarf, r=eddyb
kennytm [Tue, 23 Jan 2018 09:03:40 +0000 (17:03 +0800)]
Rollup merge of #47610 - cuviper:captured-dwarf, r=eddyb

LLVM5: Update DW_OP_plus to DW_OP_plus_uconst

LLVM <= 4.0 used a non-standard interpretation of `DW_OP_plus`.  In the
DWARF standard, this adds two items on the expressions stack.  LLVM's
behavior was more like DWARF's `DW_OP_plus_uconst` -- adding a constant
that follows the op.  The patch series starting with [D33892] switched
to the standard DWARF interpretation, so we need to follow.

[D33892]: https://reviews.llvm.org/D33892

Fixes #47464
r? @eddyb

6 years agoRollup merge of #47558 - spastorino:rustc_args, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:39 +0000 (17:03 +0800)]
Rollup merge of #47558 - spastorino:rustc_args, r=nikomatsakis

Add rustc-args option to test runner

r? @nikomatsakis

6 years agoRollup merge of #47554 - EdSchouten:cloudabi-jemalloc, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:38 +0000 (17:03 +0800)]
Rollup merge of #47554 - EdSchouten:cloudabi-jemalloc, r=nikomatsakis

Make liballoc_jemalloc work on CloudABI.

The automated builds for CloudABI in dist-various-2 don't use
--disable-jemalloc, even though my original container image did. Instead
of setting that flag, let's go the extra mile of making jemalloc work.
CloudABI's C library already uses jemalloc and now exposes the API
extensions used by us.

This makes the CloudABI dist work out of the box.

6 years agoRollup merge of #47549 - Manishearth:29723-regression, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:37 +0000 (17:03 +0800)]
Rollup merge of #47549 - Manishearth:29723-regression, r=nikomatsakis

Add regression test for #29723

cc #29723

r? @nikomatsakis

6 years agoRollup merge of #47541 - psumbera:master, r=eddyb
kennytm [Tue, 23 Jan 2018 09:03:36 +0000 (17:03 +0800)]
Rollup merge of #47541 - psumbera:master, r=eddyb

Fixes sparc64 cabi fixes.

Argument up to 16 bytes size is provided in registers.
Return value up to 32 bytes size is stored in registers.

Fixes: #46679
---

Firefox now (almost) build on sparc. Original rust issue seems to be gone. Note that I'm not rust expert and the fix was suggested in bug.

6 years agoRollup merge of #47440 - mark-i-m:zunpretty, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:35 +0000 (17:03 +0800)]
Rollup merge of #47440 - mark-i-m:zunpretty, r=nikomatsakis

Change the --unpretty flag to -Z unpretty

First PR :smile: !

-Z unpretty no longer requires -Z unstable-options.

Also, I mildly changed the syntax of the flag to match the other -Z flags. All uses of the flag take the form `unpretty=something` where something can either `string` or `string=string` (see the help messages of the CLI).

Fix #47395

r? @nikomatsakis EDIT: apparently rust-highfive doesn't see edits...

6 years agoRollup merge of #47425 - EdSchouten:immutable-tls, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:34 +0000 (17:03 +0800)]
Rollup merge of #47425 - EdSchouten:immutable-tls, r=nikomatsakis

Properly pass down immutability info for thread-locals.

For thread-locals we call into cat_rvalue_node() to create a CMT
(Category, Mutability, Type) that always has McDeclared. This is
incorrect for thread-locals that don't have the 'mut' keyword; we should
use McImmutable there.

Extend cat_rvalue_node() to have an additional mutability parameter. Fix
up all the callers to make use of that function. Also extend one of the
existing unit tests to cover this.

Fixes: #47053
6 years agoRollup merge of #47423 - est31:rustbook_checking, r=alexcrichton
kennytm [Tue, 23 Jan 2018 09:03:32 +0000 (17:03 +0800)]
Rollup merge of #47423 - est31:rustbook_checking, r=alexcrichton

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.

6 years agoAuto merge of #47046 - Manishearth:intra-doc-links, r=eddyb,GuillaumeGomez,QuietMisdr...
bors [Tue, 23 Jan 2018 07:38:53 +0000 (07:38 +0000)]
Auto merge of #47046 - Manishearth:intra-doc-links, r=eddyb,GuillaumeGomez,QuietMisdreavus,Manishearth

Implement RFC 1946 - intra-rustdoc links

https://github.com/rust-lang/rfcs/pull/1946 https://github.com/rust-lang/rust/issues/43466

Note for reviewers: The plain line counts are a little inflated because of how the markdown link parsing was done. [Read the file diff with "whitespace only" changes removed](https://github.com/rust-lang/rust/pull/47046/files?w=1) to get a better view of what actually changed there.

This pulls the name/path resolution mechanisms out of the compiler and runs it on the markdown in a crate's docs, so that links can be made to `SomeStruct` directly rather than finding the folder path to `struct.SomeStruct.html`. Check the `src/test/rustdoc/intra-paths.rs` test in this PR for a demo. The change was... a little invasive, but unlocks a really powerful mechanism for writing documentation that doesn't care about where an item was written to on the hard disk.

Items included:

 - [x] Make work with the hoedown renderer
 - [x] Handle relative paths
 - [x] Parse out the "path ambiguities" qualifiers (`[crate foo]`, `[struct Foo]`, `[foo()]`, `[static FOO]`, `[foo!]`, etc)
 - [x] Resolve foreign macros
 - [x] Resolve local macros
 - [x] Handle the use of inner/outer attributes giving different resolution scopes (handling for non-modules pushed to different PR)

Items not included:

 - [ ] Make sure cross-crate inlining works (blocked on refactor described in https://github.com/rust-lang/rust/pull/47046#issuecomment-354824520)
 - [ ] Implied Shortcut Reference Links (where just doing `[::std::iter::Iterator][]` without a reference anchor will resolve using the reference name rather than the link target) (requires modifying the markdown parser - blocked on Hoedown/Pulldown switch and https://github.com/google/pulldown-cmark/issues/121)
 - [ ] Handle enum variants and UFCS methods (Enum variants link to the enum page, associated methods don't link at all)
 - [ ] Emit more warnings/errors when things fail to resolve (linking to a value-namespaced item without a qualifier will emit an error, otherwise the link is just treated as a url, not a rust path)
 - [ ] Give better spans for resolution errors (currently the span for the first doc comment is used)
 - [ ] Check for inner doc comments on things that aren't modules

I'm making the PR, but it should be noted that most of the work was done by Misdreavus :smile:

(Editor's note: This has become a lie, check that commit log, Manish did a ton of work after this PR was opened `>_>`)

6 years agoPort borrows across yield check to MIR borrowck
John Kåre Alsaker [Thu, 11 Jan 2018 18:50:40 +0000 (19:50 +0100)]
Port borrows across yield check to MIR borrowck

6 years agoAdd dropck test
John Kåre Alsaker [Thu, 11 Jan 2018 18:50:01 +0000 (19:50 +0100)]
Add dropck test

6 years agoFix yield-while-local-borrowed.rs test
John Kåre Alsaker [Thu, 11 Jan 2018 18:49:26 +0000 (19:49 +0100)]
Fix yield-while-local-borrowed.rs test

6 years agoUse delay_span_bug for things that should be errors
John Kåre Alsaker [Thu, 11 Jan 2018 18:46:51 +0000 (19:46 +0100)]
Use delay_span_bug for things that should be errors

6 years agoMake immovable generators unsafe
John Kåre Alsaker [Fri, 22 Dec 2017 21:12:27 +0000 (22:12 +0100)]
Make immovable generators unsafe

6 years agoAdds support for immovable generators. Move checking of invalid borrows across suspen...
John Kåre Alsaker [Sat, 7 Oct 2017 14:36:28 +0000 (16:36 +0200)]
Adds support for immovable generators. Move checking of invalid borrows across suspension points to borrowck. Fixes #44197, #45259 and #45093.

6 years agorustdoc: Show when traits are auto traits
Oliver Middleton [Tue, 23 Jan 2018 01:04:24 +0000 (01:04 +0000)]
rustdoc: Show when traits are auto traits

6 years agoFasten even more theme switch
Guillaume Gomez [Mon, 22 Jan 2018 23:45:34 +0000 (00:45 +0100)]
Fasten even more theme switch

6 years agoAuto merge of #47373 - wesleywiser:incr_cache_hashing, r=michaelwoerister
bors [Mon, 22 Jan 2018 23:32:16 +0000 (23:32 +0000)]
Auto merge of #47373 - wesleywiser:incr_cache_hashing, r=michaelwoerister

[Incremental] Cache hashes for AdDef and ty::Slice<T>

r? @michaelwoerister

6 years agodon't process code blocks when scanning for links
QuietMisdreavus [Mon, 22 Jan 2018 23:04:55 +0000 (17:04 -0600)]
don't process code blocks when scanning for links

6 years agoFasten up theme loading
Guillaume Gomez [Mon, 22 Jan 2018 22:44:08 +0000 (23:44 +0100)]
Fasten up theme loading

6 years agoFix quoted search
Guillaume Gomez [Mon, 22 Jan 2018 21:49:44 +0000 (22:49 +0100)]
Fix quoted search

6 years agoChange theme icon
Guillaume Gomez [Mon, 22 Jan 2018 20:38:56 +0000 (21:38 +0100)]
Change theme icon

6 years agoAuto merge of #47507 - alexcrichton:rerun-bat-scripts, r=michaelwoerister
bors [Mon, 22 Jan 2018 20:30:14 +0000 (20:30 +0000)]
Auto merge of #47507 - alexcrichton:rerun-bat-scripts, r=michaelwoerister

rustc: Lower link args to `@`-files on Windows more

When spawning a linker rustc has historically been known to blow OS limits for
the command line being too large, notably on Windows. This is especially true of
incremental compilation where there can be dozens of object files per
compilation. The compiler currently has logic for detecting a failure to spawn
and instead passing arguments via a file instead, but this failure detection
only triggers if a process actually fails to spawn.

Unfortunately on Windows we've got something else to worry about which is
`cmd.exe`. The compiler may be running a linker through `cmd.exe` where
`cmd.exe` has a limit of 8192 on the command line vs 32k on `CreateProcess`.
Moreso rustc actually succeeds in spawning `cmd.exe` today, it's just that after
it's running `cmd.exe` fails to spawn its child, which rustc doesn't currently
detect.

Consequently this commit updates the logic for the spawning the linker on
Windows to instead have a heuristic to see if we need to pass arguments via a
file. This heuristic is an overly pessimistic and "inaccurate" calculation which
just calls `len` on a bunch of `OsString` instances (where `len` is not
precisely the length in u16 elements). This number, when exceeding the 6k
threshold, will force rustc to always pass arguments through a file.

This strategy should avoid us trying to parse the output on Windows of the
linker to see if it successfully spawned yet failed to actually sub-spawn the
linker. We may just be passing arguments through files a little more commonly
now...

The motivation for this commit was a recent bug in Gecko [1] when beta testing,
notably when incremental compilation was enabled it blew out the limit on
`cmd.exe`. This commit will also fix #46999 as well though as emscripten uses a
bat script as well (and we're blowing the limit there).

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1430886

Closes #46999

6 years agotweak colors on dark theme
QuietMisdreavus [Mon, 22 Jan 2018 20:27:58 +0000 (14:27 -0600)]
tweak colors on dark theme

6 years agoAdd dynamic-drop test to nll tests also
Santiago Pastorino [Mon, 22 Jan 2018 18:08:57 +0000 (15:08 -0300)]
Add dynamic-drop test to nll tests also

6 years agoInline some rustc_driver function
bjorn3 [Mon, 22 Jan 2018 17:18:40 +0000 (18:18 +0100)]
Inline some rustc_driver function

6 years agoTemporary fix missing escape_href in hoedown_link by copying pulldown's code
Manish Goregaokar [Mon, 22 Jan 2018 16:53:08 +0000 (22:23 +0530)]
Temporary fix missing escape_href in hoedown_link by copying pulldown's code

6 years agoAuto merge of #47353 - nikomatsakis:nll-issue-47189, r=pnkfelix+nmatsakis
bors [Mon, 22 Jan 2018 11:11:47 +0000 (11:11 +0000)]
Auto merge of #47353 - nikomatsakis:nll-issue-47189, r=pnkfelix+nmatsakis

renumber regions in generators

This fixes #47189, but I think we still have to double check various things around how to treat generators in MIR type check + borrow check (e.g., what borrows should be invalidated by a `Suspend`? What consistency properties should type check be enforcing anyway around the "interior" type?)

Also fixes #47587 thanks to @spastorino's commit.

r? @pnkfelix

6 years agoUpdate to new commonmark arg
Manish Goregaokar [Mon, 22 Jan 2018 10:55:59 +0000 (16:25 +0530)]
Update to new commonmark arg

6 years agoFix spurious warning on empty proc macro crates
Ryan Cumming [Mon, 22 Jan 2018 09:58:21 +0000 (20:58 +1100)]
Fix spurious warning on empty proc macro crates

While attempting to reproduce rust-lang/rust#47086 I noticed the
following warning:

```shell
> rustc /dev/null --crate-type proc-macro
warning: unused variable: `registrar`
 --> /dev/null:0:1
```

As there are no macros to register the automatically generated registrar
function for the crate has no body. As a result its `registrar` argument
is unused triggering the above warning.

The warning is confusing and not easily actionable by the developer. It
could also be triggered legitimately by e.g. having all of the macros in
a crate #[cfg]'ed out.

Fix by naming the generated argument `_registrar` inside
`mk_registrar()`. This suppresses the unused variable warning.

6 years agoReview fixes
Manish Goregaokar [Mon, 22 Jan 2018 09:59:34 +0000 (15:29 +0530)]
Review fixes

6 years agoMove macro_resolve() into a function
Manish Goregaokar [Fri, 19 Jan 2018 12:43:50 +0000 (18:13 +0530)]
Move macro_resolve() into a function

6 years agoMove resolve() into a function
Manish Goregaokar [Fri, 19 Jan 2018 12:27:10 +0000 (17:57 +0530)]
Move resolve() into a function

6 years agoAdd ambiguity errors for macros
Manish Goregaokar [Fri, 19 Jan 2018 12:13:08 +0000 (17:43 +0530)]
Add ambiguity errors for macros

6 years agoMove the figuring out of the 'kind' of def out into functions
Manish Goregaokar [Fri, 19 Jan 2018 11:57:18 +0000 (17:27 +0530)]
Move the figuring out of the 'kind' of def out into functions

6 years agoAllow macros to be resolved with ambiguous idents too
Manish Goregaokar [Fri, 19 Jan 2018 11:49:01 +0000 (17:19 +0530)]
Allow macros to be resolved with ambiguous idents too

6 years agoAllow function@, value@, macro@
Manish Goregaokar [Fri, 19 Jan 2018 11:15:48 +0000 (16:45 +0530)]
Allow function@, value@, macro@

6 years agoError only in the case of overlap
Manish Goregaokar [Wed, 10 Jan 2018 05:36:51 +0000 (11:06 +0530)]
Error only in the case of overlap

6 years agoUse the registered def id (makes enum variants link to the enum page instead of not...
Manish Goregaokar [Tue, 9 Jan 2018 06:25:28 +0000 (11:55 +0530)]
Use the registered def id (makes enum variants link to the enum page instead of not at all)

6 years agoBetter error message
Manish Goregaokar [Tue, 9 Jan 2018 05:20:52 +0000 (10:50 +0530)]
Better error message

6 years agovalue-namespace items require a marker, so emit an error
QuietMisdreavus [Mon, 8 Jan 2018 19:20:19 +0000 (13:20 -0600)]
value-namespace items require a marker, so emit an error

6 years agoresolve module docs based on inner/outer attributes
QuietMisdreavus [Mon, 8 Jan 2018 17:10:50 +0000 (11:10 -0600)]
resolve module docs based on inner/outer attributes

6 years agoclean module docs while its module ID is still on the stack
QuietMisdreavus [Mon, 8 Jan 2018 16:07:16 +0000 (10:07 -0600)]
clean module docs while its module ID is still on the stack

6 years agoadd ambiguity markers to the intra-links test
QuietMisdreavus [Mon, 8 Jan 2018 15:33:27 +0000 (09:33 -0600)]
add ambiguity markers to the intra-links test

6 years agouse @ instead of space for link ambiguity markers
QuietMisdreavus [Mon, 8 Jan 2018 15:23:12 +0000 (09:23 -0600)]
use @ instead of space for link ambiguity markers

since spaces aren't allowed in link targets in commonmark, a new symbol
is needed to separate the marker from the rest of the path. hence, @

6 years agoadd a macro to the intra-links test
QuietMisdreavus [Sun, 7 Jan 2018 23:09:16 +0000 (17:09 -0600)]
add a macro to the intra-links test

6 years agoStore a list of local macros on the resolver; use for resolving intra-doc macro links
Manish Goregaokar [Sat, 6 Jan 2018 11:53:33 +0000 (17:23 +0530)]
Store a list of local macros on the resolver; use for resolving intra-doc macro links

6 years agoResolve foreign macros
Manish Goregaokar [Sat, 6 Jan 2018 08:31:54 +0000 (14:01 +0530)]
Resolve foreign macros

6 years agoRegister definitions
Manish Goregaokar [Sat, 6 Jan 2018 10:15:44 +0000 (15:45 +0530)]
Register definitions

6 years agoFix unit tests
Manish Goregaokar [Wed, 3 Jan 2018 08:41:54 +0000 (14:11 +0530)]
Fix unit tests

6 years agoFix tidy
Manish Goregaokar [Wed, 3 Jan 2018 06:03:04 +0000 (11:33 +0530)]
Fix tidy

6 years agoExit early for non-linky things
Manish Goregaokar [Mon, 1 Jan 2018 08:52:28 +0000 (14:22 +0530)]
Exit early for non-linky things

6 years agoHandle relative paths
Manish Goregaokar [Mon, 1 Jan 2018 07:31:19 +0000 (13:01 +0530)]
Handle relative paths

6 years agoUse correct item for links in modules
Manish Goregaokar [Mon, 1 Jan 2018 06:26:07 +0000 (11:56 +0530)]
Use correct item for links in modules

6 years agoHandle errors for intra doc link path lookup
Manish Goregaokar [Fri, 29 Dec 2017 08:22:30 +0000 (13:52 +0530)]
Handle errors for intra doc link path lookup

6 years agoMake resolve_hir_path and resolve_str_path fallible
Manish Goregaokar [Fri, 29 Dec 2017 08:06:32 +0000 (13:36 +0530)]
Make resolve_hir_path and resolve_str_path fallible

6 years agoDon't return early and discard the link in hoedown mode
Manish Goregaokar [Fri, 29 Dec 2017 06:35:42 +0000 (12:05 +0530)]
Don't return early and discard the link in hoedown mode

6 years agoadd basic test for rustdoc intra links
QuietMisdreavus [Thu, 28 Dec 2017 22:48:30 +0000 (16:48 -0600)]
add basic test for rustdoc intra links

6 years agoparse path ambiguity markers
QuietMisdreavus [Thu, 28 Dec 2017 22:46:13 +0000 (16:46 -0600)]
parse path ambiguity markers

6 years agofix error_index_generator
QuietMisdreavus [Thu, 28 Dec 2017 19:35:10 +0000 (13:35 -0600)]
fix error_index_generator

6 years agoadd intra-links support to hoedown
QuietMisdreavus [Thu, 28 Dec 2017 17:41:00 +0000 (11:41 -0600)]
add intra-links support to hoedown

6 years agocleanup
QuietMisdreavus [Thu, 28 Dec 2017 16:52:40 +0000 (10:52 -0600)]
cleanup

6 years agoAdd LinkReplacer pass for pulldown
Manish Goregaokar [Thu, 28 Dec 2017 10:59:20 +0000 (16:29 +0530)]
Add LinkReplacer pass for pulldown

6 years agoMake correct resolver available in rustdoc
Manish Goregaokar [Mon, 25 Dec 2017 09:04:56 +0000 (14:34 +0530)]
Make correct resolver available in rustdoc

6 years agoSplit out creation of the resolver arena in phase_2_configure_and_expand
Manish Goregaokar [Mon, 25 Dec 2017 08:25:21 +0000 (13:55 +0530)]
Split out creation of the resolver arena in phase_2_configure_and_expand

6 years agoMove resolve arenas/crate loader outside of the core of phase_2_configure_and_expand
Manish Goregaokar [Mon, 25 Dec 2017 08:19:25 +0000 (13:49 +0530)]
Move resolve arenas/crate loader outside of the core of phase_2_configure_and_expand

6 years agoDRY std_path
Manish Goregaokar [Mon, 25 Dec 2017 06:07:55 +0000 (11:37 +0530)]
DRY std_path

6 years agoabort documenting on resolution errors
QuietMisdreavus [Mon, 25 Dec 2017 04:28:34 +0000 (22:28 -0600)]
abort documenting on resolution errors

6 years agoresolve paths when cleaning docs
QuietMisdreavus [Fri, 22 Dec 2017 19:12:54 +0000 (13:12 -0600)]
resolve paths when cleaning docs

6 years agoadd a rustc_resolve::Resolver to DocContext
QuietMisdreavus [Thu, 21 Dec 2017 21:16:29 +0000 (15:16 -0600)]
add a rustc_resolve::Resolver to DocContext

6 years agogive render_text a generic return type
QuietMisdreavus [Thu, 21 Dec 2017 21:15:48 +0000 (15:15 -0600)]
give render_text a generic return type

6 years agoadd RenderType to DocContext
QuietMisdreavus [Thu, 21 Dec 2017 21:15:07 +0000 (15:15 -0600)]
add RenderType to DocContext

6 years agonew function to pull the links from a chunk of markdown
QuietMisdreavus [Thu, 21 Dec 2017 20:54:16 +0000 (14:54 -0600)]
new function to pull the links from a chunk of markdown

6 years agoAuto merge of #47158 - rkruppe:repr-transparent, r=eddyb
bors [Mon, 22 Jan 2018 08:10:41 +0000 (08:10 +0000)]
Auto merge of #47158 - rkruppe:repr-transparent, r=eddyb

Implement repr(transparent)

r? @eddyb for the functional changes. The bulk of the PR is error messages and docs, might be good to have a doc person look over those.

cc #43036
cc @nox

6 years agoAuto merge of #47144 - estebank:moved-closure-arg, r=nikomatsakis
bors [Mon, 22 Jan 2018 05:30:37 +0000 (05:30 +0000)]
Auto merge of #47144 - estebank:moved-closure-arg, r=nikomatsakis

Custom error when moving arg outside of its closure

When given the following code:

```rust
fn give_any<F: for<'r> FnOnce(&'r ())>(f: F) {
    f(&());
}

fn main() {
    let mut x = None;
    give_any(|y| x = Some(y));
}
```

provide a custom error:

```
error: borrowed data cannot be moved outside of its closure
 --> file.rs:7:27
  |
6 |     let mut x = None;
  |         ----- borrowed data cannot be moved into here...
7 |     give_any(|y| x = Some(y));
  |              ---          ^ cannot be moved outside of its closure
  |              |
  |              ...because it cannot outlive this closure
```

instead of the generic lifetime error:

```
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
 --> file.rs:7:27
  |
7 |     give_any(|y| x = Some(y));
  |                           ^
  |
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 7:14...
 --> file.rs:7:14
  |
7 |     give_any(|y| x = Some(y));
  |              ^^^^^^^^^^^^^^^
note: ...so that expression is assignable (expected &(), found &())
 --> file.rs:7:27
  |
7 |     give_any(|y| x = Some(y));
  |                           ^
note: but, the lifetime must be valid for the block suffix following statement 0 at 6:5...
 --> file.rs:6:5
  |
6 | /     let mut x = None;
7 | |     give_any(|y| x = Some(y));
8 | | }
  | |_^
note: ...so that variable is valid at time of its declaration
 --> file.rs:6:9
  |
6 |     let mut x = None;
  |         ^^^^^
```

Fix #45983.

6 years agorustc: Lower link args to `@`-files on Windows more
Alex Crichton [Tue, 16 Jan 2018 23:30:57 +0000 (15:30 -0800)]
rustc: Lower link args to `@`-files on Windows more

When spawning a linker rustc has historically been known to blow OS limits for
the command line being too large, notably on Windows. This is especially true of
incremental compilation where there can be dozens of object files per
compilation. The compiler currently has logic for detecting a failure to spawn
and instead passing arguments via a file instead, but this failure detection
only triggers if a process actually fails to spawn.

Unfortunately on Windows we've got something else to worry about which is
`cmd.exe`. The compiler may be running a linker through `cmd.exe` where
`cmd.exe` has a limit of 8192 on the command line vs 32k on `CreateProcess`.
Moreso rustc actually succeeds in spawning `cmd.exe` today, it's just that after
it's running `cmd.exe` fails to spawn its child, which rustc doesn't currently
detect.

Consequently this commit updates the logic for the spawning the linker on
Windows to instead have a heuristic to see if we need to pass arguments via a
file. This heuristic is an overly pessimistic and "inaccurate" calculation which
just calls `len` on a bunch of `OsString` instances (where `len` is not
precisely the length in u16 elements). This number, when exceeding the 6k
threshold, will force rustc to always pass arguments through a file.

This strategy should avoid us trying to parse the output on Windows of the
linker to see if it successfully spawned yet failed to actually sub-spawn the
linker. We may just be passing arguments through files a little more commonly
now...

The motivation for this commit was a recent bug in Gecko [1] when beta testing,
notably when incremental compilation was enabled it blew out the limit on
`cmd.exe`. This commit will also fix #46999 as well though as emscripten uses a
bat script as well (and we're blowing the limit there).

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1430886

Closes #46999

6 years agoAuto merge of #47644 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sun, 21 Jan 2018 22:38:29 +0000 (22:38 +0000)]
Auto merge of #47644 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 9 pull requests

- Successful merges: #47247, #47334, #47512, #47582, #47595, #47625, #47632, #47633, #47637
- Failed merges:

6 years agoRollup merge of #47637 - russmack:fix-mailmap-dupes, r=steveklabnik
Guillaume Gomez [Sun, 21 Jan 2018 22:11:45 +0000 (23:11 +0100)]
Rollup merge of #47637 - russmack:fix-mailmap-dupes, r=steveklabnik

Fix mailmap duplicates, Carol and Brian.

This fix corrects the .mailmap file so that Carol (Nichols || Goulding) appears only once, and Brian Anderson also appears only once.

6 years agoRollup merge of #47633 - pietroalbini:fix-ice-use-self, r=nagisa
Guillaume Gomez [Sun, 21 Jan 2018 22:11:44 +0000 (23:11 +0100)]
Rollup merge of #47633 - pietroalbini:fix-ice-use-self, r=nagisa

Fix ICE with `use self;`

Closes #47623

6 years agoRollup merge of #47632 - sdroege:exact-chunks-docs-broken-links, r=kennytm
Guillaume Gomez [Sun, 21 Jan 2018 22:11:43 +0000 (23:11 +0100)]
Rollup merge of #47632 - sdroege:exact-chunks-docs-broken-links, r=kennytm

Fix broken links to other slice functions in chunks/chunks_mut/exact_…

…chunk/exact_chunks_mut docs

See https://github.com/rust-lang/rust/pull/47126#discussion_r162780492

6 years agoRollup merge of #47625 - astraw:btreeset-doctest-fix, r=kennytm
Guillaume Gomez [Sun, 21 Jan 2018 22:11:42 +0000 (23:11 +0100)]
Rollup merge of #47625 - astraw:btreeset-doctest-fix, r=kennytm

fix doctests for BTreeSet to use BTreeSet (not BTreeMap)

This fixes #47624

6 years agoRollup merge of #47595 - PieterPenninckx:master, r=shepmaster
Guillaume Gomez [Sun, 21 Jan 2018 22:11:41 +0000 (23:11 +0100)]
Rollup merge of #47595 - PieterPenninckx:master, r=shepmaster

Small improvements to the documentation of VecDeque.

Some small improvements to the documentation of `VecDeque`.

6 years agoRollup merge of #47582 - alexcrichton:auto-beta, r=kennytm
Guillaume Gomez [Sun, 21 Jan 2018 22:11:40 +0000 (23:11 +0100)]
Rollup merge of #47582 - alexcrichton:auto-beta, r=kennytm

Automaticaly calculate beta prerelease numbers

This is a forward-port of:

9426dda83d7a928d6ced377345e14b84b0f11c21
cbfb9858951da7aee22d82178405306fca9decb1

from the beta branch which is used to automatically calculate the beta number
based on the number of merges to the beta branch so far.

6 years agoRollup merge of #47512 - GuillaumeGomez:e0659, r=petrochenkov
Guillaume Gomez [Sun, 21 Jan 2018 22:11:39 +0000 (23:11 +0100)]
Rollup merge of #47512 - GuillaumeGomez:e0659, r=petrochenkov

Add E0659 for ambiguous names

Still on the tracks of the "no error without error code" road.

6 years agoRollup merge of #47334 - etaoins:only-call-res-init-on-gnu-unix, r=alexcrichton
Guillaume Gomez [Sun, 21 Jan 2018 22:11:38 +0000 (23:11 +0100)]
Rollup merge of #47334 - etaoins:only-call-res-init-on-gnu-unix, r=alexcrichton

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.

Before this commit:
```shell
> cat main.rs
use std::net::ToSocketAddrs;

#[no_mangle]
pub extern "C" fn resolve_test() -> () {
    let addr_list = ("google.com.au", 0).to_socket_addrs().unwrap();
    println!("{:?}", addr_list);
}
> rustc --crate-type=staticlib main.rs
> clang libmain.a test.c -o combined
Undefined symbols for architecture x86_64:
  "_res_9_init", referenced from:
      std::net::lookup_host::h93c17fe9ad38464a in libmain.a(std-826c8d3b356e180c.std0.rcgu.o)
ld: symbol(s) not found for architecture x86_64
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
```

Afterwards:
```shell
> rustc --crate-type=staticlib main.rs
> clang libmain.a test.c -o combined
> ./combined
IntoIter([V4(172.217.25.131:0)])
```

Fixes  #46797

6 years agoRollup merge of #47247 - estebank:suggest-cast, r=petrochenkov
Guillaume Gomez [Sun, 21 Jan 2018 22:11:37 +0000 (23:11 +0100)]
Rollup merge of #47247 - estebank:suggest-cast, r=petrochenkov

Suggest casting on numeric type error

Re #47168.

6 years agoAuto merge of #47116 - estebank:non-accessible-ctor, r=petrochenkov
bors [Sun, 21 Jan 2018 16:52:09 +0000 (16:52 +0000)]
Auto merge of #47116 - estebank:non-accessible-ctor, r=petrochenkov

Tweaks to invalid ctor messages

 - Do not suggest using a constructor that isn't accessible
 - Suggest the appropriate syntax (`()`/`{}` as appropriate)
 - Add note when trying to use `Self` as a ctor

CC #22488, fix #47085.

6 years agoAdd themes option
Guillaume Gomez [Sat, 20 Jan 2018 21:16:46 +0000 (22:16 +0100)]
Add themes option

6 years agoAdd possibility to have multiple themes
Guillaume Gomez [Sat, 20 Jan 2018 20:12:00 +0000 (21:12 +0100)]
Add possibility to have multiple themes

6 years agoFix mailmap duplicates, Carol and Brian.
Russell Mackenzie [Sun, 21 Jan 2018 15:21:36 +0000 (15:21 +0000)]
Fix mailmap duplicates, Carol and Brian.