Commit Graph

42836 Commits

Author SHA1 Message Date
Alex Crichton
e2854b3893 libc: Add necessary libraries for MSVC
These libs seem to be required by the standard library at least to link
successfully!
2015-05-19 10:53:06 -07:00
Alex Crichton
d97b4af153 mklldeps: Don't link stdc++/c++ on MSVC
These libraries don't exist! The linker for MSVC is highly likely to not pass
`/NODEFAULTLIB` in which case the right standard library will automatically be
selected.
2015-05-19 10:53:06 -07:00
Alex Crichton
af56e2efde rustc_back: Tweak the MSVC target spec
This change primarily changes the default ar utility used by MSVC-targeting
compilers as `llvm-ar`, adding comments along the way as to why.
2015-05-19 10:53:06 -07:00
Alex Crichton
37659a1803 rustc_back: Remove unneeded explicit variable
This value is the default anyway
2015-05-19 10:53:06 -07:00
Alex Crichton
839dcfd5a7 rustc_back: Refactor Archive to better express intent
This commit was initially written to target either `ar` or `lib.exe` for MSVC,
but it ended up not needing `lib.exe` support after all. I would personally like
to refactor this to one day not invoke processes at all (but rather use the
`llvm-ar.cpp` file in LLVM as alibrary) so I chose to preserve this refactoring
to allow it to be easily done in the future.
2015-05-19 10:53:06 -07:00
Alex Crichton
f9846e902d rustc: Shorten MSVC metadata section name
It looks like section names in objects generated by `link.exe` are limited to at
most 8 characters in length, so shorten `.note.rustc` to just `.rustc`
2015-05-19 10:53:06 -07:00
Alex Crichton
a4ef308473 mk: Add the ability to depend on native LLVM tools
The compiler will require that `llvm-ar.exe` be available for MSVC-targeting
builds (more comments on this soon), so this commit adds support for targets to
depend on LLVM tools. The `core` library for MSVC depends on `llvm-ar.exe` which
will be copied into place for the target before the compiler starts to run.

Note that these targets all depend on `llvm-config.exe` to ensure that they're
built before they're attempted to be copied.
2015-05-19 10:53:04 -07:00
Alex Crichton
6122a5f559 mk: Fix MSVC build for rustllvm.lib
This commit updates the rustllvm.mk file with the necessary flags and such to
build rustllvm.lib with cl.exe instead of gcc. Some comments can be found in the
commit itself.
2015-05-19 10:52:57 -07:00
Alex Crichton
64412a49be mk: Fix building compiler-rt on MSVC
It looks like compiler-rt has a cmake build sytem inside its source, but I have
been unable to figure out how to use it and actually build the right library.
For now this commit hard-wires MSVC-targeting builds of libcompiler-rt to
continue using `make` as the primary bulid system, but some frobbing of the
flags are necessary to ensure that the right compiler is used.
2015-05-19 10:52:57 -07:00
Alex Crichton
ee64bab76c mk: Don't add cross prefixes for MSVC
Currently the MSVC compilers don't have any cross prefixes and we're only able
to make an MSVC compiler with a cross compile, so just avoid this logic on msvc
for now.
2015-05-19 10:52:57 -07:00
Alex Crichton
fcf7ecd1d7 mk: Add build system support for cl.exe
We have a number of support C/C++ files in Rust that we link into the standard
library and other various locations, and these all need to be built with cl.exe
instead of gcc.exe when targeting MSVC. This commit adds helper macros for this
functionality to use different sets of programs/flags/invocations on MSVC than
on GNU-like platforms.
2015-05-19 10:52:57 -07:00
Alex Crichton
b56d47cc80 mk: Enable building LLVM targeting MSVC
This commit modifies the makefiles to enable building LLVM with cmake and Visual
Studio to generate an LLVM that targets MSVC. Rust's configure script requires
cmake to be installed when targeting MSVC and will configure LLVM with cmake
instead of the normal `./configure` script LLVM provides. The build will then
run cmake to execute the build instead of the normal `make`.

Currently `make clean-llvm` isn't supported on MSVC as I can't figure out how to
run a "clean" target for the Visual Studio files.
2015-05-19 10:52:57 -07:00
Alex Crichton
7cf0b1798b configure: Start adding MSVC support
This commit starts to add MSVC support to the ./configure script to enable the
build system to detect and build an MSVC target with the cl.exe compiler and
toolchain. The primary change here is a large sanity check when an MSVC target
is requested (and currently only `x86_64-pc-windows-msvc` is recognized).

When building an MSVC target, the configure script either requires the
`--msvc-root` argument or for `cl.exe` to be in `PATH`. It also requires that if
in the path `cl.exe` is the 64-bit version of the compiler.

Once detected the configure script will run the `vcvarsall.bat` script provided
by Visual Studio to learn about the `INCLUDE` and `LIB` variables needed by the
`cl.exe` compiler to run (the default include/lib paths for the
compiler/linker). These variables are then reexported when running `make` to
ensure that our own compiles are running the same toolchain.

The purpose of this detection and environment variable scraping is to avoid
requiring the build itself to be run inside of a `cmd.exe` shell but rather
allow it to run in the currently expected MinGW/MSYS shell.
2015-05-19 10:52:55 -07:00
Matt Brubeck
d776191d4a Add example code and cross-link to BufReader docs 2015-05-19 10:41:19 -07:00
petrochenkov
9e1f531d53 Fix test run-pass-fulldeps\issue-15149.rs on Windows 2015-05-19 20:37:17 +03:00
parir
3b95cd71fe doc: fix a broken link 2015-05-19 19:36:10 +02:00
Alex Crichton
ee258c548f mk: Fix native LLVM deps for cross-host builds
We use a script called `mklldeps.py` to run `llvm-config` to generate a list
of LLVM libraries and native dependencies needed by LLVM, but all cross-compiled
LLVM builds were using the *host triple's* `llvm-config` instead of the
*target's* `llvm-config`. This commit alters this to require the right
`llvmdeps.rs` to be generated which will run the correct `llvm-config`.
2015-05-19 10:36:00 -07:00
Alex Crichton
150663c3b6 mk: Correct names of installed libs on windows
Previously libmorestack.a and libcompiler-rt.a were installed, but link.exe
looks for morestack.lib and compiler-rt.lib by default, so we need to install
these with the correct name
2015-05-19 10:36:00 -07:00
Alex Crichton
eb5bf151a5 mk: Remove generation of .d files
Looks like cl.exe doesn't support this and we're also barely using them anyway
as we have very few header files and C code in general.
2015-05-19 10:36:00 -07:00
Alex Crichton
cb513c7b46 rt: Clean up to build with cl.exe
* Detect the #define _MSC_VER in addition to __WIN32__
* Don't include valgrind.h for windows
* Remove unused `rust_valgrind_stack_{un,}register` functions
* Add stub definition for `rust_running_on_valgrind` for windows
* Conditionally define `rust_dbg_extern_empty_struct` as empty structures are
  not allowed by cl.exe apparently.
2015-05-19 10:35:58 -07:00
Ms2ger
fb7c0b44bb Return the iterator from reader::docs. 2015-05-19 19:31:54 +02:00
parir
c9c474cb86 doc: add missing fences 2015-05-19 19:19:42 +02:00
bors
aca207a65c Auto merge of #25605 - Manishearth:rollup, r=Manishearth
- Successful merges: #25452, #25512, #25551, #25556, #25562, #25575, #25576, #25580, #25587, #25590, #25591
- Failed merges: #25585
2015-05-19 16:44:52 +00:00
peferron
afbe15d103 Fix description of assert! 2015-05-19 07:56:29 -07:00
Ariel Ben-Yehuda
3afd760bb3 Fix translation of semi-constant if-statements
Thanks @dotdash
2015-05-19 17:42:15 +03:00
Ariel Ben-Yehuda
27d2bd13c3 Make float -> int casts actually work 2015-05-19 17:42:15 +03:00
Ariel Ben-Yehuda
32fe2e3ad4 Address review commets
I think I didn't run tests properly - my second call to
select_all_obligations_or_error has made 3 tests fail. However, this is
just an error message change - integer fallback never worked with casts.
2015-05-19 17:42:14 +03:00
Ariel Ben-Yehuda
de4b0e9961 remove todo 2015-05-19 17:42:14 +03:00
Ariel Ben-Yehuda
d9b9f4ee7d fix conflicts 2015-05-19 17:42:14 +03:00
Ariel Ben-Yehuda
9ee2335bfc Fix test fallout, and add some rather comprehensive tests. 2015-05-19 17:42:14 +03:00
Ariel Ben-Yehuda
83acebc462 Overhaul cast semantics and make them follow RFC401
This should hopefully fix all cast-related ICEs once and for all.

I managed to make diagnostics hate me and give me spurious "decoder error"
 - removing $build/tmp/extended-errors seems to fix it.
2015-05-19 17:42:14 +03:00
Ariel Ben-Yehuda
a172f4022d Expose enum discriminant signedness 2015-05-19 17:42:14 +03:00
Manish Goregaokar
3bb54a3362 Rollup merge of #25591 - rick68:patch-2, r=alexcrichton
fixed a mistake.
2015-05-19 18:47:16 +05:30
Manish Goregaokar
9d5e621c6d Rollup merge of #25590 - michaelsproul:enum-struct-diagnostics, r=Manishearth
Part of #24407.

This covers various errors to do with struct and enum patterns.
2015-05-19 18:47:15 +05:30
Manish Goregaokar
f3896621b9 Rollup merge of #25587 - bluss:rustdoc-type-margin, r=alexcrichton
rustdoc: Fix left margin for type aliases

Fixes #24655

Margin for associated types was applied to type aliases (in return
value) by mistake.
2015-05-19 18:47:15 +05:30
Manish Goregaokar
b613ef552d Rollup merge of #25580 - killercup:trpl/unify-code-blocks, r=steveklabnik
This adds strictly more information to the source files and reduces the need for customized tooling to render the book. (While this should not change the output of _rustbook_, it is very useful when rendering the sources with external tools like Pandoc.)

This only adds the language marker to "first level" code blocks (and not to code blocks in comments inside of code examples).

r? @steveklabnik
2015-05-19 18:47:15 +05:30
Manish Goregaokar
cc50fd6f31 Rollup merge of #25576 - mbrubeck:pathext-doc, r=steveklabnik
This has been a frequently-asked question on IRC, and it isn't obvious where to
look for the fix.  r? @steveklabnik
2015-05-19 18:47:15 +05:30
Manish Goregaokar
02b79c4763 Rollup merge of #25575 - clatour:patch-2, r=steveklabnik
Looks like this was an issue in the source material. I've let the editor know and he has told me he is correcting it there as well.

r? @steveklabnik
2015-05-19 18:47:14 +05:30
Manish Goregaokar
f83fe6ec1e Rollup merge of #25562 - svetlyak40wt:patch-1, r=alexcrichton
That way old versions won't be a subsections of the 1.0.0 release.
2015-05-19 18:47:14 +05:30
Manish Goregaokar
5dc886b8ad Rollup merge of #25556 - mdinger:patch-1, r=alexcrichton 2015-05-19 18:47:14 +05:30
Manish Goregaokar
1e53218902 Rollup merge of #25551 - cllns:add-active-class-to-rustbook-toc, r=alexcrichton
Currently the table of contents for `rustbook` doesn't signify which page you are on.

This PR adds an 'active' class to the link for the current page, and defines the CSS rule for that class to make the link underlined and bold.

Not sure about two things:
1) Is `current_page` is a good name for the function parameter? At first I thought `current_item` would be good, but then in the `walk_item` function, you'd have `item` and `current_item`.

2) For the CSS, is both bold and underline too much? At first I had it just be underlined, but that's also how the links look when they're hovered over.
2015-05-19 18:47:14 +05:30
Manish Goregaokar
392576b6d8 Rollup merge of #25512 - peferron:doc-traits-error-fix, r=alexcrichton
The source code snippet uses `"whatever".as_bytes()` but the compilation error message uses `b"whatever"`. Both should be consistent with each other.

r? @steveklabnik
2015-05-19 18:47:13 +05:30
Manish Goregaokar
fddd89319d Rollup merge of #25452 - jimblandy:master, r=steveklabnik
Minor tweak: the text explaining the Borrow trait talks about slices, but the example immediately following just uses a simple reference; there are no slices involved.

r? @steveklabnik
2015-05-19 18:47:13 +05:30
Mohammed Attia
aa570bce3e Fix lifetimes trpl typo 2015-05-19 14:38:54 +02:00
Björn Steinbrink
b802b18730 Don't call drop when taking the address of unsized fields
When taking the address of an unsized field we generate a rvalue datum
for the field and then convert it to an lvalue datum. At that point,
cleanup is scheduled for the field, leading to multiple drop calls.

The problem is that we generate an rvalue datum for the field, since the
pointer does not own the data and there's already cleanup scheduled
elsewhere by the true owner. Instead, an lvalue datum must be created.

Thanks to @eddyb for identifying the underlying cause and suggesting the
correct fix.

Fixes #25549
Fixes #25515
2015-05-19 14:25:35 +02:00
Parker Moore
733e7eea5c fmt.rs: add note about lack of padding support for some types 2015-05-19 19:21:52 +07:00
bors
9c47ebb00a Auto merge of #25550 - sfackler:derive-debug-unsized, r=alexcrichton
Closes #25394
2015-05-19 07:38:24 +00:00
bors
b301e02f37 Auto merge of #25548 - sfackler:debug-builders-by-ref, r=alexcrichton
Based on feedback from https://internals.rust-lang.org/t/final-comment-period-for-debug-builders-stabilization/2007/2
2015-05-19 05:39:29 +00:00
Wei-Ming Yang
b460e4516d Update iter.rs
fixed a mistake.
2015-05-19 12:40:01 +08:00
Michael Sproul
eccb72e85b Explain E0023, E0024, E0025, E0026, E0027, E0033. 2015-05-19 14:16:18 +10:00