Commit Graph

69686 Commits

Author SHA1 Message Date
Manish Goregaokar
0cb367266b Emit parentheses in suggestion for global paths 2018-02-27 19:24:16 -08:00
Maxim Nazarenko
78789add6c and some more tidy checks 2018-02-27 23:52:47 +02:00
Maxim Nazarenko
ff6754c68e fix tidy checks 2018-02-27 23:34:38 +02:00
Maxim Nazarenko
50f5ea9192 Simplify
Merge three rules into one following @cramertj
2018-02-27 23:23:19 +02:00
Maxim Nazarenko
d9b8724a80 style fix 2018-02-27 23:21:04 +02:00
Esteban Küber
d63d363ef9 Diagnostic tweaks (review) 2018-02-27 10:47:49 -08:00
Esteban Küber
36baa81be9 Add label to primary span in some parse errors 2018-02-27 10:47:33 -08:00
Esteban Küber
ba7039cfd6 Detect missing if blocks
When unnecessarily using a fat arrow after an if condition, suggest the
removal of it.

When finding an if statement with no block, point at the `if` keyword to
provide more context.
2018-02-27 10:46:23 -08:00
Esteban Küber
0c9afa87ba Provide missing comma in match arm suggestion
When finding:

```rust
match &Some(3) {
    &None => 1
    &Some(2) => { 3 }
    _ => 2
}
```

provide the following diagnostic:

```
error: expected one of `,`, `.`, `?`, `}`, or an operator, found `=>`
 --> $DIR/missing-comma-in-match.rs:15:18
  |
X |         &None => 1
  |               --  - help: missing comma
  |               |
  |               while parsing the match arm starting here
X |         &Some(2) => { 3 }
  |                  ^^ expected one of `,`, `.`, `?`, `}`, or an operator here
```
2018-02-27 10:45:18 -08:00
Scott McMurray
fc2e4e7833 Put some thought and documentation effort into process::ExitCode 2018-02-27 10:31:17 -08:00
John Kåre Alsaker
89e55d108c Make TransitiveRelation thread safe. Avoid locking by using get_mut in some cases. 2018-02-27 19:07:33 +01:00
Martin Hoffmann
44be054a2a Further refinement of Borrow documentation. 2018-02-27 16:24:52 +01:00
Mazdak Farrokhzad
f8ebb3f09f fix wording on panics in binary operators on RefCells" 2018-02-27 15:48:50 +01:00
Maxim Nazarenko
273166e765 remove italic
remove italic as per @GuillaumeGomez suggestion
2018-02-27 16:41:28 +02:00
Björn Steinbrink
f05d9679d7 Backport LLVM fixes for a JumpThreading / assume intrinsic bug 2018-02-27 14:20:13 +01:00
Ralf Jung
30b5be0e95 update compile-fail tests; remove now redundant issue-39122.rs
It is subsumed by ui/param-bounds-ignored.rs.
2018-02-27 13:16:30 +01:00
Ralf Jung
86821f7fb6 add lint to detect ignored generic bounds; this subsumes the previous 'generic bounds in type aliases are ignored' warning 2018-02-27 13:16:30 +01:00
Ralf Jung
d1ed6cce6c Lint passes: add check_where_predicate and check_poly_trait_ref 2018-02-27 13:00:30 +01:00
Tatsuyuki Ishi
f297f56e76 Bring back ParamEnv deduplication 2018-02-27 17:30:20 +09:00
Phlosioneer
ffb6291cd0 Improve --help performance for x.py
Since compiling the bootstrap command doesn't require any submodules,
we can skip updating submodules when a --help command is passed in.
On my machine, this saves 1 minute if the submodules are already
downloaded, and 10 minutes if run on a clean repo.

This commit also adds a message before compiling/downloading anything
when a --help command is passed in, to tell the user WHY --help
takes so long to complete. It also points the user to the bootstrap
README.md for faster help.

Finally, this fixes one warning message that still referenced using
make instead of x.py, even though x.py is now the standard way of
building rust.
2018-02-26 20:45:52 -05:00
Phlosioneer
b7b3498ce8 Fix doctest failure
Tried to be fancy with print statements.
2018-02-26 19:48:15 -05:00
Alex Crichton
c133a082a8 rustc: Rename bmi feature to bmi1
This is what [Intel calls it][bmi1] and will [remove a special case][stdsimd]
when verifying intrinsics in stdsimd.

[bmi1]: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#othertechs=BMI1
[stdsimd]: bed25b2a9f/crates/stdsimd-verify/tests/x86-intel.rs (L252-L258)
2018-02-26 15:58:16 -08:00
Mark Simulacrum
9c80019e6c Fix error-format argument to x.py 2018-02-26 15:07:24 -07:00
Bryan Drewery
279e5b0a48 FreeBSD uses Clang which can return small structs as an integer. 2018-02-26 10:21:55 -08:00
Bryan Drewery
2026453bcf Add specific target option for returning struct as an integer. 2018-02-26 10:21:52 -08:00
Vadim Petrochenkov
9f9183d34d Fix rebase 2018-02-26 21:20:31 +03:00
Vadim Petrochenkov
7ba5fd168a Update UI tests 2018-02-26 20:24:42 +03:00
Vadim Petrochenkov
99b1054d9f Anonymize remaining line numbers at line starts 2018-02-26 20:24:41 +03:00
Vadim Petrochenkov
e650eef8b0 Implement opt-out from UI testing normalization 2018-02-26 20:24:41 +03:00
Vadim Petrochenkov
fa2d9fc4b9 Update UI tests 2018-02-26 20:24:02 +03:00
Vadim Petrochenkov
cdbd8c2f2a Support flag -Z ui-testing for tweaking diagnostic output for UI tests 2018-02-26 20:24:00 +03:00
Mark Simulacrum
5db73fc6db Encode linker arguments as UTF-16 on MSVC platforms 2018-02-26 08:51:39 -08:00
Christian Poveda
9091584def some grammar corrections 2018-02-26 11:14:40 -05:00
bors
bedbad6119 Auto merge of #48337 - GuillaumeGomez:rustc-explain, r=estebank
Rustc explain

Fixes #48041.

To make the review easier, I separated tests update to code update. Also, I used this script to generate new ui tests stderr:

```python
from os import listdir
from os.path import isdir, isfile, join

PATH = "src/test/ui"

def do_something(path):
    files = [join(path, f) for f in listdir(path)]

    for f in files:
        if isdir(f):
            do_something(f)
            continue
        if not isfile(f) or not f.endswith(".stderr"):
            continue
        x = open(f, "r")
        content = x.read().strip()
        if "error[E" not in content:
            continue
        errors = dict()
        for y in content.splitlines():
            if y.startswith("error[E"):
                errors[y[6:11]] = True
        errors = sorted(errors.keys())
        if len(errors) < 1:
            print("weird... {}".format(f))
            continue
        if len(errors) > 1:
            content += "\n\nYou've got a few errors: {}".format(", ".join(errors))
            content += "\nIf you want more information on an error, try using \"rustc --explain {}\"".format(errors[0])
        else:
            content += "\n\nIf you want more information on this error, try using \"rustc --explain {}\"".format(errors[0])
        content += "\n"
        x = open(f, "w")
        x.write(content)

do_something(PATH)
```
2018-02-26 12:34:52 +00:00
bors
4a70e27219 Auto merge of #48082 - jseyfried:improve_struct_field_hygiene, r=petrochenkov
macros: improve struct constructor field hygiene, fix span bug

Fixes #47311.
r? @nrc
2018-02-26 09:41:33 +00:00
Guillaume Gomez
ce6429af7a Fix new tests 2018-02-26 09:56:00 +01:00
Ryan Cumming
c237d4f859 Add test for #48508
This is named for the issue as it's testing the specific details of that
bug. It's a bit tricky as the ICE requires multiple files and debug info
enabled to trigger.
2018-02-26 19:25:10 +11:00
John Paul Adrian Glaubitz
7c84ba43ce test: Run atomic-lock-free on powerpc-linux-gnuspe 2018-02-26 02:07:24 +01:00
John Paul Adrian Glaubitz
b7683a33ce build-manifest: Add powerpc-unknown-linux-gnuspe target 2018-02-26 02:07:24 +01:00
John Paul Adrian Glaubitz
a22fbf8a9c librustc_back: Add support for powerpc-linux-gnuspe 2018-02-26 02:07:24 +01:00
John Paul Adrian Glaubitz
88de279dca bootstrap: Add openssl configuration for powerpc-unknown-linux-gnuspe 2018-02-26 02:07:24 +01:00
varkor
2466644389 Ensure main() always has external linkage
This ensures that the entry function is never elided due to inlining, even with `inline(always)`. Fixes #47783.

There were a couple of possible ways of addressing this issue; I simply picked the one that seemed most direct. A warning could be appropriate, but considering using inlining hints in other places it doesn't apply also throws no warnings, and it seems like an edge case anyway, I haven't added one for now.
2018-02-25 23:05:06 +00:00
Mark Mansi
7a82da1c4d tidy fix 2018-02-25 15:42:25 -06:00
Mark Mansi
d6f22a2481 Make comment into a doc comment and change readme ref 2018-02-25 15:26:53 -06:00
Mark Mansi
968ce252a8 Change links to readmes 2018-02-25 15:24:14 -06:00
Phlosioneer
e8904f935a Change the example string to something arbitrary
The choice of string is arbitrary, so all references to a number
in the string were removed. The string is now the standard "Hello
world!".
2018-02-25 15:46:17 -05:00
Mikhail Modin
12c7e27330 restore Subslice move out from array after elaborate drops and borrowck 2018-02-25 18:59:16 +03:00
kennytm
1aa103511b Rollup merge of #48330 - frewsxcv:frewsxcv-tests-zero-duration, r=sfackler
Add tests ensuring zero-Duration timeouts result in errors; fix Redox issues.

Part of #48311
2018-02-25 22:47:56 +08:00
Christian Poveda
397ce8a1ae fixed links 2018-02-25 09:39:21 -05:00
Corey Farwell
a554a2f564 Return error if timeout is zero-Duration on Redox. 2018-02-25 08:54:08 -05:00