Commit Graph

53081 Commits

Author SHA1 Message Date
Georg Brandl
b48b509d89 typeck: show a note about tuple indexing for erroneous tup[i]
Fixes: #27842
2016-05-04 09:10:54 +02:00
Nick Cameron
25160af4b4 rustdoc: refactor rustdoc syntax highlighting for a more flexible API
Clients can now use the rustdoc syntax highlighter to classify tokens, then use that info to put together there own HTML (or whatever), rather than just having static HTML output.
2016-05-04 10:29:58 +12:00
Alex Crichton
f72bfe6661 rustbuild: Document many more parts of the build
This commit expands the bootstrap build system's `README.md` as well as ensuring
that all API documentation is present and up-to-date. Additionally a new
`config.toml.example` file is checked in with commented out versions of all
possible configuration values.
2016-05-03 15:15:27 -07:00
Adolfo Ochagavía
dca29d7b08 save-analysis: use a decoupled representation for dumped data
Closes #33348
2016-05-03 23:18:38 +02:00
Alex Crichton
74d1520c22 mk: Pass CFLAGS for target, not host
This changes the CFLAGS and related variables passed to compiletest to be passed
for the target, not the host, so we can correctly test 32-bit cross compiles on
64-bit host machines.

Hopefuly fixes #33379
2016-05-03 13:49:35 -07:00
Seo Sanghyeon
282afda58a Update commit hash in cargotest 2016-05-04 04:26:05 +09:00
Michael Woerister
bb0e5254ae Make runtest::check_debugger_output() handle wildcards at end. 2016-05-03 15:00:24 -04:00
Georg Brandl
72560e1403 parser: show a helpful note on unexpected inner comment
Fixes: #30318.
2016-05-03 17:53:23 +02:00
Ariel Ben-Yehuda
6c883840e6 stop dropping impls from cause backtraces 2016-05-03 18:52:55 +03:00
Ariel Ben-Yehuda
62db786fc8 stop using commit_if_ok where no errors can happen 2016-05-03 18:52:55 +03:00
Ariel Ben-Yehuda
6057a7f188 change the newly-added errors to warnings
this commit should be reverted after a release cycle
2016-05-03 18:52:55 +03:00
Ariel Ben-Yehuda
5876b4b12a improve error message for WF Tuples 2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
05f1a057b6 address review comments 2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
6fc19ada6b fix breaking changes 2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
2f8f256cef require the existential bounds of an object type to be object-safe
This is required, as Copy and Sized are object-unsafe.

As a soundness fix, this is a [breaking-change]

Fixes #32963
2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
0a6dfc5177 require the non-last elements of a tuple to be Sized
This requirement appears to be missing from RFC1214, but is clearly
necessary for translation. The last field of a tuple/enum remains in
a state of limbo, compiling but causing an ICE when it is used - we
should eventually fix that somehow.

this is a [breaking-change] - a soundness fix - and requires a
crater run.
2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
babb5df529 refactor the handling of builtin candidates 2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
4bcabbd45a add comments and tests 2016-05-03 18:30:10 +03:00
Ariel Ben-Yehuda
73f39a026a Short-cut Sized matching on ADTs
Put a constraint type on every ADT def, such that the ADT def is sized iff the constraint
type is, and use that in selection. This ignores types that are obviously sized.

This improves typeck performance by ~15%.
2016-05-03 18:30:10 +03:00
Manish Goregaokar
631e7b4eaa
Rollup merge of #33372 - birkenfeld:rustdoc-escape-code, r=cmr
rustdoc: HTML-escape Rust code (from constants)

Especially in cases like the one in the test file, this can blow up the rendering big time if string constants in the code contain HTML.

But also other constants can contain special chars (e.g. `&` as an operator in constant expressions).
2016-05-03 19:54:59 +05:30
Manish Goregaokar
1ab019584e
Rollup merge of #33371 - birkenfeld:issue-33302, r=cmr
rustdoc: fix inserting source code spans for constant values

This will go wrong when the constants partially result from macro expansion.
Instead, use the expressions and pretty-print them as Rust code.

Fixes: #33302
2016-05-03 19:54:58 +05:30
Manish Goregaokar
676fd362ff
Rollup merge of #33357 - pcwalton:inline-mem-forget, r=brson
libcore: Inline `mem::forget()`.

Was causing severe performance problems in WebRender.

r? @brson
2016-05-03 19:54:56 +05:30
Manish Goregaokar
51a3a8f523
Rollup merge of #33343 - birkenfeld:issue-32214, r=Manishearth
parser: change warning into an error on `T<A=B, C>`

part of #32214

This seems to be the obvious fix, and the error message is consistent with all the other parser errors ("expected x, found y").
2016-05-03 19:54:55 +05:30
Manish Goregaokar
52c97f237b
Rollup merge of #33340 - birkenfeld:issue-23716, r=Manishearth
resolve: print location of static for "static in pattern" error

The implementation mirrors the one for "constant defined here" annotation used for constant patterns in the irrefutable-pattern case.

Fixes: #23716
2016-05-03 19:54:54 +05:30
Manish Goregaokar
041a269bc7
Rollup merge of #33339 - oli-obk:fix/const_eval, r=japaric
fix various const eval errors

These were found after const_evaluating arbitrary expressions and linting if the const evaluator failed

fixes #33275 (int -> float casts for negative ints)
fixes #33291 (int -> char casts (new! wasn't allowed in constants until this PR))

r? @eddyb

cc @bluss @japaric
2016-05-03 19:54:52 +05:30
Manish Goregaokar
2e4474f890
Rollup merge of #33322 - justsostephen:master, r=steveklabnik
doc/book/getting-started.md: Spelling correction and revised wording.

The word 'Internet' was spelt with both an uppercase and a lowercase 'I'. The correct spelling seems to be a matter of some debate these days, however the first occurrence in the file has an uppercase 'I', so I've changed the second occurrence to suit for consistency.

Under the section titled 'Converting to Cargo', there's mention of creating a new executable. This, however, is not part of the process described. I've revised the wording to reflect as much.

Small changes, but I hope they are of benefit! :-)

r? @steveklabnik
2016-05-03 19:54:51 +05:30
Manish Goregaokar
5bac8cb16d
Rollup merge of #33294 - timothy-mcroy:E0501, r=GuillaumeGomez
Add detailed error explanation for E0501

r? @GuillaumeGomez

Bring on the nits!
2016-05-03 19:54:50 +05:30
Manish Goregaokar
af05b568c0
Rollup merge of #33277 - birkenfeld:fmt-named-dollar-args, r=steveklabnik
Fix std::fmt format spec: named args are allowed with "$" syntax
2016-05-03 19:54:48 +05:30
Georg Brandl
421e6fc24d rustdoc: use btree map for where clauses
to get more reproducible output.

Fixes: #32555
2016-05-03 14:30:35 +02:00
Georg Brandl
1bcf41e53f rustdoc: HTML-escape Rust code (from constants)
Especially in cases like the one in the test file, this can blow
up the docs big time if string constants in the code contain HTML.

But also other constants can contain special chars (e.g. `&` as an
operator in constant expressions).
2016-05-03 13:31:29 +02:00
bors
3157691f96 Auto merge of #33330 - birkenfeld:issue-29121, r=Manishearth
typeck: when suggesting associated fns, do not show call site as fallback

In case we cannot produce a span for the location of the definition, just do not show a span at all.

cc: #29121
2016-05-03 04:23:13 -07:00
Georg Brandl
24117f3c58 rustdoc: fix inserting source code spans for constant values
This will go wrong when the constants partially result from macro expansion.
Instead, use the expressions and pretty-print them as Rust code.

Fixes: #33302
2016-05-03 13:09:42 +02:00
Seo Sanghyeon
9f6494c16c Remove unused trait imports introduced while in review 2016-05-03 19:33:31 +09:00
Niko Matsakis
f030b5dbc2 degrade gracefully with empty spans 2016-05-03 06:15:39 -04:00
Seo Sanghyeon
a1d9c04ee2 Fix build on Windows 2016-05-03 18:51:19 +09:00
Seo Sanghyeon
84946b8ace Fix more tests 2016-05-03 18:51:19 +09:00
Seo Sanghyeon
8ff14bf382 Fix tests related to no_std 2016-05-03 18:51:19 +09:00
Seo Sanghyeon
24d86137f5 Warn unused trait imports 2016-05-03 18:51:19 +09:00
Seo Sanghyeon
7ad1900e1c Remove unused trait imports flagged by lint 2016-05-03 18:48:34 +09:00
bors
7d8100a068 Auto merge of #33119 - nrc:pretty, r=pnkfelix
Refactor pretty printing to use the compiler API
2016-05-02 23:56:48 -07:00
Georg Brandl
780f725176 typeck: when suggesting associated fns, do not show call site as fallback
In case we cannot produce a span for the location of the definition,
just do not show a span at all.

cc: #29121
2016-05-03 08:26:00 +02:00
Georg Brandl
e24999e485 Makefile: there is only one tidy target now
Also removes mention of tidy.py from the tidy sources.
2016-05-03 07:13:10 +02:00
bors
43c5fef47d Auto merge of #33354 - Manishearth:rollup, r=Manishearth
Rollup of 14 pull requests

- Successful merges: #32756, #33129, #33225, #33260, #33309, #33320, #33323, #33324, #33325, #33330, #33332, #33334, #33335, #33346
- Failed merges:
2016-05-02 21:37:18 -07:00
Manish Goregaokar
638cf9f675
Rollup merge of #33346 - Ryman:patch-4, r=alexcrichton
libstd: correct the link to functions in io module documentation

Currently the link refers to it's own section of the documentation rather than the list of functions generated by rustdoc.

i.e. [this](http://doc.rust-lang.org/std/io/index.html#functions) should link to [this](http://doc.rust-lang.org/std/io/index.html#functions-1)
2016-05-03 08:05:30 +05:30
Manish Goregaokar
d6c6bbf200
Rollup merge of #33335 - cramertj:master, r=alexcrichton
docs: Changed docs for `size_of` to describe size as a stride offset

Current documentation for `std::mem::size_of` is ambiguous, and the documentation for `std::intrinsics::size_of` incorrectly defines size.

This fix re-defines size as the offset in bytes between successive instances of a type, as described in LLVM's [getTypeAllocSize](http://llvm.org/docs/doxygen/html/classllvm_1_1DataLayout.html#a1d6fcc02e91ba24510aba42660c90e29).

Fixes: #33266
2016-05-03 08:05:29 +05:30
Manish Goregaokar
ac19fdc09c
Rollup merge of #33334 - birkenfeld:issue29088, r=Manishearth
lexer: do not display char confusingly in error message

Current code leads to messages like `... use a \xHH escape: \u{e4}` which is confusing.

The printed span already points to the offending character, which should be enough to identify the non-ASCII problem.

Fixes: #29088
2016-05-03 08:05:29 +05:30
Manish Goregaokar
7e88dc7760
Rollup merge of #33332 - alexcrichton:handle-more-races, r=michaelwoerister
rustc: Handle concurrent `create_dir` requests

The compiler created a directory as part of `-Z incremental` but that may be
hierarchically used concurrently so we need to protect ourselves against that.
2016-05-03 08:05:29 +05:30
Manish Goregaokar
0ee84c71fc
Rollup merge of #33325 - birkenfeld:issue-31341, r=jseyfried
typeck: remove confusing suggestion for calling a fn type

* It is not clear what a "base function" is.
* The suggestion just adds parens, so suggests calling without args.

The second point could be fixed with e.g. `(...)` instead of `()`,
but the preceding "note: X is a function, perhaps you wish to call it"
should already be clear enough.

Fixes: #31341
2016-05-03 08:05:28 +05:30
Manish Goregaokar
68c29e0904
Rollup merge of #33324 - birkenfeld:issue-30497, r=GuillaumeGomez
E0269: add suggestion to check for trailing semicolons

In situations where the value of the last expression must be inferred,
rustc will not emit the "you might need to remove the semicolon" warning,
so at least note this in the extended description.

Fixes: #30497
2016-05-03 08:05:28 +05:30
Manish Goregaokar
c4d950d6d5
Rollup merge of #33323 - birkenfeld:issue-31221, r=Manishearth
match check: note "catchall" patterns in unreachable error

Caught as catchall patterns are:

* unconditional name bindings
* references to them
* tuple bindings with catchall elements

Fixes #31221.
2016-05-03 08:05:27 +05:30