Commit Graph

56077 Commits

Author SHA1 Message Date
Tshepang Lekhonkhobe
071410ba57 string: remove needless binding 2016-08-11 20:44:49 +02:00
Tshepang Lekhonkhobe
c99c2ea838 doc: a value of type &str is called a "string slice" 2016-08-11 20:41:31 +02:00
Stephan Hügel
31da7f6f25 More clarification 2016-08-11 20:37:26 +02:00
Alex Crichton
045c8c8624 std: Optimize panic::catch_unwind slightly
The previous implementation of this function was overly conservative with
liberal usage of `Option` and `.unwrap()` which in theory never triggers. This
commit essentially removes the `Option`s in favor of unsafe implementations,
improving the code generation of the fast path for LLVM to see through what's
happening more clearly.

cc #34727
2016-08-11 11:19:30 -07:00
crypto-universe
4209f948b1 Add label to E0254
This issue #35513 is a part of #35233.
r? @jonathandturner
2016-08-11 20:15:10 +02:00
Stephan Hügel
2ed052d82f Clarify type declaration language 2016-08-11 20:05:05 +02:00
Jonathan Turner
d3af9a38ed Fix tidy warning 2016-08-11 10:17:12 -07:00
bors
11f8805887 Auto merge of #34193 - petrochenkov:privalias, r=nikomatsakis
privacy: Substitute type aliases in private-in-public checker

Closes https://github.com/rust-lang/rust/issues/30503
Closes https://github.com/rust-lang/rust/issues/34293

Everyone in the issue discussion seemed to be in favor, @huonw also spoke about this [here](https://www.reddit.com/r/rust/comments/3xldr9/surfaces_and_signatures_component_privacy_versus/cy615wq), but the issue haven't got any movement.
I think it's reasonable to do this before turning `private_in_public` warnings into errors.

r? @nikomatsakis
2016-08-11 10:09:10 -07:00
Jake Goulding
b707a12a6b Allow compiling against a custom LLVM 3.9 installation 2016-08-11 12:55:53 -04:00
Jorge Aparicio
c0ff3c1070 fix match 2016-08-11 11:22:39 -05:00
Michael Woerister
67f19e5e28 Always add -Z incremental-info to incremental compilation tests. 2016-08-11 10:59:35 -04:00
Michael Woerister
3a70aa530f Fix incremental/commandline-args test. 2016-08-11 10:59:05 -04:00
Michael Woerister
a7de0bc4c6 Address comments by reviewers. 2016-08-11 09:56:00 -04:00
Michael Woerister
65eb024542 Remove the 'cfg' field from session::config::Options.
The 'cfg' in the Options struct is only the commandline-specified
subset of the crate configuration and it's almost always wrong to
read that instead of the CrateConfig in HIR crate node.
2016-08-11 09:56:00 -04:00
Michael Woerister
d3578ab742 Save dep-tracking hash of commandline arguments in dep-graph file.
.. and use it to purge the incremental compilation cache if necessary.
2016-08-11 09:56:00 -04:00
Michael Woerister
32414310b7 Add the notion of a dependency tracking status to commandline arguments.
Commandline arguments influence whether incremental compilation
can use its compilation cache and thus their changes relative to
previous compilation sessions need to be taking into account. This
commit makes sure that one has to specify for every commandline
argument whether it influences incremental compilation or not.
2016-08-11 09:56:00 -04:00
Jonathan Turner
cdedad530f Rollup merge of #35576 - circuitfox:E0072-update-error-format, r=jonathandturner
E0072 update error format

Part of  #35233

Fixes #35506

r? @jonathandturner

The bonus for this issue currently seems to be impossible to do reliably, as the compiler seems to lack span information for item names alone, like `Foo` in `struct Foo { ... }`. It would be possible to hack something together by computing span offsets, but that seems like a solution that would be begging for trouble.

A proper solution to this would, of course, be to add span information to the right place (seems to be `rustc::hir::Item::name` but I may be wrong).
2016-08-11 06:34:02 -07:00
Jonathan Turner
0e92c5e8b2 Rollup merge of #35569 - pietroalbini:fix-typo, r=steveklabnik
Fix docs typo in std::os::unix::net::SocketAddr::is_unnamed
2016-08-11 06:34:02 -07:00
Jonathan Turner
efbed8ba79 Rollup merge of #35565 - wdv4758h:E0133, r=jonathandturner
Update E0133 to new format

Part of #35233
Fix #35509
r? @jonathandturner
2016-08-11 06:34:01 -07:00
Jonathan Turner
6692f41e12 Rollup merge of #35562 - birkenfeld:as-mut-doc, r=steveklabnik
Remove redundant `&mut ref mut` in doc for Result::as_mut()

While a good example of how `&mut ref mut` is a no-op, I don't think we should show that here :)
See https://users.rust-lang.org/t/mnemonic-for-reading-qualifiers/6853

r? @steveklabnik
2016-08-11 06:34:01 -07:00
Jonathan Turner
aaed538b24 Rollup merge of #35557 - Limeth:master, r=jonathandturner
E0263 updated to new format.

Fixes #35518. Part of #35233.
r? @jonathandturner
2016-08-11 06:34:01 -07:00
Jonathan Turner
a5408a5415 Rollup merge of #35555 - circuitfox:E0128-update-error-format, r=jonathandturner
E0128 update error format

Fixes #35508

Part of #35233

r? @jonathandturner
2016-08-11 06:34:00 -07:00
Jonathan Turner
b76ca890dd Rollup merge of #35554 - murarth:insert-str-issue, r=apasel422
Add tracking issue for `String::insert_str`
2016-08-11 06:34:00 -07:00
Jonathan Turner
b758688505 Rollup merge of #35552 - theypsilon:master, r=jonathandturner
Update error message E0384 to new format

Part of #35233
Fixes #35184

r? @jonathandturner
2016-08-11 06:34:00 -07:00
Jonathan Turner
08d5df8f5f Rollup merge of #35541 - hank-der-hafenarbeiter:E0045, r=jonathandturner
Updated E0045 to new error format (no bonus)

Part of #35501
r? @jonathandturner
2016-08-11 06:34:00 -07:00
Jonathan Turner
8d63269b8a Rollup merge of #35537 - munyari:e0038, r=jonathandturner
Update E0038 to the new error format

Part of #35233

Addresses #35500
"r? @jonathandturner

This doesn't compile yet, and I need help. In my naive solution, adding the span label makes our error message a mutable `errors::DiagnosticBuilder` pointer.

```bash
python src/bootstrap/bootstrap.py --step check-cfail E0038 --stage 1
```

```
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Building stage0 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling rustc v0.0.0 (file:///home/nash/code/rust/src/librustc)
src/librustc/traits/error_reporting.rs:735:9: 735:12 error: mismatched types [E0308]
src/librustc/traits/error_reporting.rs:735         err
                                                   ^~~
src/librustc/traits/error_reporting.rs:735:9: 735:12 help: run `rustc --explain E0308` to see a detailed explanation
src/librustc/traits/error_reporting.rs:735:9: 735:12 note: expected type `core::option::Option<errors::DiagnosticBuilder<'tcx>>`
src/librustc/traits/error_reporting.rs:735:9: 735:12 note:    found type `core::option::Option<&mut errors::DiagnosticBuilder<'_>>`
error: aborting due to previous error
error: Could not compile `rustc`.

To learn more, run the command again with --verbose.

command did not execute successfully: "/home/nash/code/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "-j" "4" "--target" "x86_64-unknown-linux-gnu" "--release" "--features" " jemalloc" "--manifest-path" "/home/nash/code/rust/src/rustc/Cargo.toml"
expected success, got: exit code: 101
```
2016-08-11 06:34:00 -07:00
Jonathan Turner
294ac7b561 Rollup merge of #35536 - hank-der-hafenarbeiter:E0433, r=jonathandturner
Updated E0433 to new error message. (no bonus)

Part of #35345
r? @jonathandturner
2016-08-11 06:33:59 -07:00
Jonathan Turner
d0922f6dc1 Rollup merge of #35532 - KiChjang:e0004-follow-up, r=jonathandturner
Do not span across nodes for E0004

Part of #35233.
Fixes #35529.

r? @arielb1
2016-08-11 06:33:59 -07:00
Jonathan Turner
c7513d79a1 Rollup merge of #35530 - srdja:master, r=jonathandturner
Update E0008 and E0007 to new format

Part of #35233
A fix for #35496

r? @jonathandturner
2016-08-11 06:33:59 -07:00
Jonathan Turner
0283443522 Rollup merge of #35528 - Vassah:master, r=jonathandturner
Update Error Format for E0091 and E0092

Addresses [#35228](https://github.com/rust-lang/rust/issues/35228) and [#35229](https://github.com/rust-lang/rust/issues/35229) as part of [#35233](https://github.com/rust-lang/rust/issues/35233).

Please let me know if there are any issues; first time contributor.

r? @jonathandturner
2016-08-11 06:33:59 -07:00
Jonathan Turner
ea342549a8 Rollup merge of #35505 - futile:test_29053, r=nikomatsakis
Add test for issue #29053

This PR adds a test for #29053 (currently fails on stage 0, but works with stage 1, as it should).

Fixes #29053
2016-08-11 06:33:59 -07:00
Jonathan Turner
853fe86906 Rollup merge of #35486 - KiChjang:e0081-bonus, r=jonathandturner
Shrink span to variant discriminant expression for E0081

Part of #35233.
Extension of #35353.
Fixes #35224.

r? @jonathandturner
2016-08-11 06:33:58 -07:00
Jonathan Turner
d423c25e08 Rollup merge of #35482 - frewsxcv:patch-31, r=GuillaumeGomez
Remove unnecessary `main` functions in doc examples.
2016-08-11 06:33:58 -07:00
Jonathan Turner
b17904234a Rollup merge of #35448 - srinivasreddy:rf_compiletest, r=nikomatsakis
run rustfmt on compiletest folder in src/tools/ folder
2016-08-11 06:33:58 -07:00
Jonathan Turner
d2e9573194 Rollup merge of #35445 - pcn:update-E0017-to-new-format, r=arielb1
Update e0017 to new format

Updated `span_err!` to use `struct_span_err!` and provide a `span_label` that describes the error in context.

Updated the test to look for the `span_label`s that are provided now.
2016-08-11 06:33:58 -07:00
Jonathan Turner
e24c326400 Rollup merge of #35375 - trixnz:update-error-326, r=jonathandturner
Update error format for E0326

Fixes #35335 as part of #35233

r? @jonathandturner
2016-08-11 06:33:57 -07:00
Jonathan Turner
0fecdc5931 Rollup merge of #35358 - vadimcn:vscode, r=steveklabnik
Ignore VS Code settings directory

r? @steveklabnik
2016-08-11 06:33:57 -07:00
Jonathan Turner
260a379ba5 Rollup merge of #35331 - trixnz:update-error-130, r=jonathandturner
Update error format for E0130

Fixes #35256 as part of #35233

r? @jonathandturner
2016-08-11 06:33:57 -07:00
Jonathan Turner
476e49614d Rollup merge of #35279 - cengizIO:master, r=brson
Provide a cleaner documentation for 'write!'

Hello!

This is my attempt to fix #35110

Any feedback is more than welcome!

Cheers!
2016-08-11 06:33:57 -07:00
bors
42001edc99 Auto merge of #35403 - scottcarr:lvalue_refactor, r=nikomatsakis
refactor lvalue_ty to be method of lvalue

Currently `Mir` (and `MirContext`) implement a method `lvalue_ty` (and actually many more `foo_ty`).  But this should be a method of `Lvalue`.

If you have an `lvalue` and you want to get its type, the natural thing to write is:

```
lvalue.ty()
```

Of course it needs context, but still:

```
lvalue.ty(mir, tcx)
```

Makes more sense than

```
mir.lvalue_ty(lvalue, tcx)
```

I actually think we should go a step farther and have traits so we could get the type of some value generically, but that's up for debate.  The thing I'm running into a lot in the compiler is I have a value of type `Foo` and I know that there is some related type `Bar` which I can get through some combination of method calls, but it's often not as direct as I would imagine.  Unless you already know the code, its not clear why you would look in `Mir` for a method to get the type of an `Lvalue`.
2016-08-11 05:04:41 -07:00
Andrii Dmytrenko
4b54dd7fd9
Use an existing constant name as an example. 2016-08-11 11:41:44 +01:00
bors
695b3d8279 Auto merge of #34866 - cynicaldevil:panic-counter, r=alexcrichton
Refactored code to access TLS only in case of panic (II)

Fixes #34787
r? @alexcrichton
Do it **very** carefully this time!
2016-08-11 01:58:48 -07:00
bors
1222f5d52b Auto merge of #34845 - bitshifter:issue-30961, r=alexcrichton
Add help for target CPUs, features, relocation and code models.

Fix for https://github.com/rust-lang/rust/issues/30961. Requires PR https://github.com/rust-lang/llvm/pull/45 to be accepted first, and the .gitmodules for llvm to be updated before this can be merged.
2016-08-10 21:42:48 -07:00
Chiu-Hsiang Hsu
92f7e85b30 Update E0138 to new format 2016-08-11 10:18:23 +08:00
cgswords
16cc8a767a Implemented a smarter concatenation system that will hopefully produce more efficient tokenstream usages. 2016-08-10 16:31:05 -07:00
Vadim Petrochenkov
5d4ae4ba5a Add test for recursive private alias substitution in rustdoc 2016-08-11 00:41:58 +03:00
petrochenkov
d43b9cb487 privacy: Move private-in-public diagnostics for type aliases to the public interface location 2016-08-11 00:32:07 +03:00
petrochenkov
08f0f7c54a Substitute private type aliases in rustdoc 2016-08-11 00:32:07 +03:00
Vadim Petrochenkov
b7db9e88bf privacy: Substitute type aliases in private-in-public checker 2016-08-11 00:32:07 +03:00
bors
0ef24eed2f Auto merge of #35489 - sanxiyn:target-list, r=alexcrichton
Print Rust target name, not LLVM target name, for `--print target-list`

Rust target name and LLVM target name are usually the same, but not always. For example, `arm-unknown-linux-musleabi` Rust target uses `arm-unknown-linux-gnueabi` LLVM target.

Fix #35481.
2016-08-10 13:13:50 -07:00