Commit Graph

43041 Commits

Author SHA1 Message Date
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
Eric Ye
4bc8853cea fix footnote link 2015-05-19 07:46:52 -04: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
Nick Hamann
35d979d8f8 Fix the error explanation for E0053. 2015-05-19 00:33:39 -05:00
Nick Hamann
d50fa7eff5 Add error explanation for E0326. 2015-05-19 00:32:27 -05: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
Steven Fackler
e87b353d65 Fix debug builder examples examples 2015-05-18 20:57:11 -07:00
bors
eeaf2ba489 Auto merge of #25496 - alexcrichton:stabilize-cloned, r=aturon
The method was stabilized but the structure was forgotten to be stabilized.

Closes #25480
2015-05-19 03:41:23 +00:00
Ulrik Sverdrup
93701b399b collections: Clean up feature flags doc examples 2015-05-19 03:33:17 +02:00
Ulrik Sverdrup
4a53456628 collections: Avoid unstable code in examples for Vec 2015-05-19 03:33:17 +02:00