Commit Graph

73935 Commits

Author SHA1 Message Date
Guillaume Gomez
7cc3cb29bd Fix quoted search 2018-01-22 22:49:44 +01:00
Cameron Hart
651ea8ea44 Stabilized #[repr(align(x))] attribute (RFC 1358) 2018-01-23 08:36:13 +11:00
Guillaume Gomez
3c52acd9ca Change theme icon 2018-01-22 21:47:39 +01:00
bors
ae920dcc98 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
2018-01-22 20:30:14 +00:00
QuietMisdreavus
aae6dc4f20 tweak colors on dark theme 2018-01-22 14:27:58 -06:00
Vadim Petrochenkov
2d56abfbeb AST/HIR: Add a separate structure for labels 2018-01-22 23:13:12 +03:00
Marco A L Barbosa
68db72d8cd Do not assume dynamic linking for musl/mips[el] targets
All musl targets except mips[el] assume static linking by default. This
can be confusing
https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084

When the musl/mips[el] targets was
[added](https://github.com/rust-lang/rust/pull/31298), dynamic linking
was chosen because of binary size concerns, and probably also because
libunwind
[didn't](https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084/8)
supported mips.

Now that we have `crt-static` target-feature (the user can choose
dynamic link for musl targets), and libunwind
[6.0](https://github.com/llvm-mirror/libunwind/commits/release_60) add
support to mips, we do not need to assume dynamic linking.
2018-01-22 16:14:51 -02:00
Santiago Pastorino
90aef18cb0 Add dynamic-drop test to nll tests also 2018-01-22 15:09:02 -03:00
bjorn3
c3fabceab1 Inline some rustc_driver function 2018-01-22 18:19:41 +01:00
Manish Goregaokar
cfc9f5a9d8 Temporary fix missing escape_href in hoedown_link by copying pulldown's code 2018-01-22 22:23:08 +05:30
Esteban Küber
4121ddb041 Do not suggest private traits that have missing method
When encountering a method call for an ADT that doesn't have any
implementation of it, we search for traits that could be implemented
that do have that method. Filter out private non-local traits that would
not be able to be implemented.

This doesn't account for public traits that are in a private scope, but
works as a first approximation and is a more correct behavior than the
current one.
2018-01-22 08:29:24 -08:00
bors
fdc18b3067 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
2018-01-22 11:11:47 +00:00
Tatsuyuki Ishi
0bbc4221dc
Use std based dedup in projection
Unstable sort was added recently, and the code that is being modified is 3 years old. As quicksort doesn't allocate it will likely perform as well as, or better than linear search.
2018-01-22 19:58:13 +09:00
Manish Goregaokar
fe93adad2c Update to new commonmark arg 2018-01-22 16:25:59 +05:30
Ryan Cumming
e1bffbdf66 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.
2018-01-22 21:09:14 +11:00
Manish Goregaokar
dc5475257f Review fixes 2018-01-22 15:29:34 +05:30
Manish Goregaokar
4ced272780 Move macro_resolve() into a function 2018-01-22 15:24:32 +05:30
Manish Goregaokar
7739bb2d35 Move resolve() into a function 2018-01-22 15:24:32 +05:30
Manish Goregaokar
fbd2d16c3f Add ambiguity errors for macros 2018-01-22 15:24:32 +05:30
Manish Goregaokar
6256bff7a3 Move the figuring out of the 'kind' of def out into functions 2018-01-22 15:24:32 +05:30
Manish Goregaokar
5762fa4b5a Allow macros to be resolved with ambiguous idents too 2018-01-22 15:24:31 +05:30
Manish Goregaokar
869dd91d44 Allow function@, value@, macro@ 2018-01-22 15:24:31 +05:30
Manish Goregaokar
6a1a449220 Error only in the case of overlap 2018-01-22 15:24:31 +05:30
Manish Goregaokar
d44910ceeb Use the registered def id (makes enum variants link to the enum page instead of not at all) 2018-01-22 15:24:31 +05:30
Manish Goregaokar
28805fd53e Better error message 2018-01-22 15:24:31 +05:30
QuietMisdreavus
afe3e27085 value-namespace items require a marker, so emit an error 2018-01-22 15:24:31 +05:30
QuietMisdreavus
b31bb097f5 resolve module docs based on inner/outer attributes 2018-01-22 15:24:30 +05:30
QuietMisdreavus
1a62b17f7d clean module docs while its module ID is still on the stack 2018-01-22 15:24:30 +05:30
QuietMisdreavus
eca3c55881 add ambiguity markers to the intra-links test 2018-01-22 15:24:30 +05:30
QuietMisdreavus
4a20fb44c8 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, @
2018-01-22 15:24:30 +05:30
QuietMisdreavus
a3d71d7405 add a macro to the intra-links test 2018-01-22 15:24:30 +05:30
Manish Goregaokar
00ce770e34 Store a list of local macros on the resolver; use for resolving intra-doc macro links 2018-01-22 15:24:30 +05:30
Manish Goregaokar
7ac48d793b Resolve foreign macros 2018-01-22 15:24:29 +05:30
Manish Goregaokar
d6dd902616 Register definitions 2018-01-22 15:24:29 +05:30
Manish Goregaokar
383d169e15 Fix unit tests 2018-01-22 15:24:29 +05:30
Manish Goregaokar
c0af89723d Fix tidy 2018-01-22 15:24:29 +05:30
Manish Goregaokar
191e5b0b78 Exit early for non-linky things 2018-01-22 15:24:29 +05:30
Manish Goregaokar
4f10f676d9 Handle relative paths 2018-01-22 15:24:29 +05:30
Manish Goregaokar
8166b59c74 Use correct item for links in modules 2018-01-22 15:24:28 +05:30
Manish Goregaokar
d6dcc47f0d Handle errors for intra doc link path lookup 2018-01-22 15:24:28 +05:30
Manish Goregaokar
140e77f71d Make resolve_hir_path and resolve_str_path fallible 2018-01-22 15:24:28 +05:30
Manish Goregaokar
f951d74389 Don't return early and discard the link in hoedown mode 2018-01-22 15:24:28 +05:30
QuietMisdreavus
30fca0919c add basic test for rustdoc intra links 2018-01-22 15:24:28 +05:30
QuietMisdreavus
c4a4d3a031 parse path ambiguity markers 2018-01-22 15:24:28 +05:30
QuietMisdreavus
ef4587b270 fix error_index_generator 2018-01-22 15:24:28 +05:30
QuietMisdreavus
9d5b1ae763 add intra-links support to hoedown 2018-01-22 15:24:27 +05:30
QuietMisdreavus
611866f3cf cleanup 2018-01-22 15:24:27 +05:30
Manish Goregaokar
e8dd5df69b Add LinkReplacer pass for pulldown 2018-01-22 15:24:27 +05:30
Manish Goregaokar
dae2e22e81 Make correct resolver available in rustdoc 2018-01-22 15:24:23 +05:30
Manish Goregaokar
fe0c10019d Split out creation of the resolver arena in phase_2_configure_and_expand 2018-01-22 15:21:29 +05:30