about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2018-02-27Detect missing `if` blocksEsteban Küber-10/+60
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-27Provide missing comma in match arm suggestionEsteban Küber-2/+68
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-26Fix rebaseVadim Petrochenkov-240/+243
2018-02-26Update UI testsVadim Petrochenkov-365/+365
2018-02-26Anonymize remaining line numbers at line startsVadim Petrochenkov-9/+12
2018-02-26Implement opt-out from UI testing normalizationVadim Petrochenkov-3/+140
2018-02-26Update UI testsVadim Petrochenkov-6168/+6168
2018-02-26Support flag `-Z ui-testing` for tweaking diagnostic output for UI testsVadim Petrochenkov-11/+38
2018-02-26Auto merge of #48337 - GuillaumeGomez:rustc-explain, r=estebankbors-45/+1352
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-26Auto merge of #48082 - jseyfried:improve_struct_field_hygiene, r=petrochenkovbors-24/+62
macros: improve struct constructor field hygiene, fix span bug Fixes #47311. r? @nrc
2018-02-26Fix new testsGuillaume Gomez-3/+11
2018-02-25Rollup merge of #48330 - frewsxcv:frewsxcv-tests-zero-duration, r=sfacklerkennytm-3/+95
Add tests ensuring zero-Duration timeouts result in errors; fix Redox issues. Part of #48311
2018-02-25Return error if timeout is zero-Duration on Redox.Corey Farwell-2/+18
2018-02-25Rollup merge of #48235 - varkor:parse-float-lonely-exponent, r=alexcrichtonkennytm-1/+8
Make ".e0" not parse as 0.0 This forces floats to have either a digit before the separating point, or after. Thus `".e0"` is invalid like `"."`, when using `parse()`. Fixes #40654. As mentioned in the issue, this is technically a breaking change... but clearly incorrect behaviour at present.
2018-02-25Rollup merge of #48529 - remexre:docs/fix/unicode-0021, r=kennytmkennytm-3/+3
Fixes docs for ASCII functions to no longer claim U+0021 is '@'. Looks like a typo that got copy-pasted without anyone checking on it.
2018-02-25Rollup merge of #48517 - penpalperson:master, r=Mark-Simulacrumkennytm-0/+13
Added error-format flag to x.py. Fixes #48475 r? @Mark-Simulacrum
2018-02-25Rollup merge of #48494 - bdrewery:freebsd-omit-frame-pointer, r=eddybkennytm-0/+1
Workaround abort(2) on compilation error on FreeBSD. Same problem as OpenBSD, tracking bug #43575. @semarie @dumbbell
2018-02-25Rollup merge of #48491 - glaubitz:s390x-linux, r=sanxiynkennytm-0/+2
test: Fix s390x-unknown-linux-gnu atomic-lock-free test not run for systemz The s390-unknown-linux-gnu atomic-lock-free test is currently run for ```LLVM_COMPONENTS == powerpc```. I assume it was meant to be run for ```LLVM_COMPONENTS == systemz```, so let's fix this.
2018-02-25Rollup merge of #48489 - glaubitz:x32-linux, r=alexcrichtonkennytm-0/+1
bootstrap: Add openssl configuration for x86_64-unknown-linux-gnux32 OpenSSL provides a native configuration for x86_64-unknown-linux-gnux32: > https://github.com/openssl/openssl/blob/master/Configurations/10-main.conf#L810 Let's use it.
2018-02-25Rollup merge of #48369 - newpavlov:rdrand, r=nagisakennytm-15/+15
Rename rdrnd target feature to rdrand Plus minor cleanup. Related stdsimd [issue](https://github.com/rust-lang-nursery/stdsimd/issues/325).
2018-02-25Rollup merge of #48362 - cuviper:libdir_relative, r=Mark-Simulacrumkennytm-6/+17
rustbuild: Restore Config.libdir_relative This re-introduces a `Config.libdir_relative` field, now derived from `libdir` and made relative to `prefix` if necessary. This fixes a regression from #46592 when `--libdir` is given an absolute path. `Builder::sysroot_libdir` should always use a relative path so its callers don't clobber system locations, and `librustc` also asserts that `CFG_LIBDIR_RELATIVE` is really relative.
2018-02-25Reduce error codes length when too much are thrownGuillaume Gomez-7/+136
2018-02-25Update ui testsGuillaume Gomez-0/+1151
2018-02-25Update tools codeGuillaume Gomez-38/+21
2018-02-25Add rustc --explain backGuillaume Gomez-7/+43
2018-02-25Rollup merge of #48302 - mark-i-m:markim_macro-test, r=aturonkennytm-0/+80
Move macro-at-most-once-rep-ambig test to ui test I had written this test for the feature. Now moving to ui test.
2018-02-25Rollup merge of #48297 - glaubitz:sparc-linux, r=estebankkennytm-1/+38
Add missing pieces for sparc-linux-gnu support I noticed that while Rust has CABI support for 32-bit SPARC, there are still some pieces missing to be able to use Rust on a 32-Bit SPARC system like Gentoo which still defaults to a 32-bit port unlike Debian's sparc64 port. This PR is an attempt to add the missing pieces. I will send the necessary changes for libc in a separate PR. CC @jrtc27
2018-02-25Rollup merge of #48281 - jakllsch:netbsd-powerpc, r=alexcrichtonkennytm-0/+37
Add powerpc-unknown-netbsd target
2018-02-25Rollup merge of #48166 - ↵kennytm-81/+2
hedgehog1024:hedgehog1024-stabilize-entry_and_modify, r=alexcrichton Stabilize 'entry_and_modify' feature Stabilize `entry_and_modify` feature introduced by #44734. Closes #44733
2018-02-25Rollup merge of #48115 - Centril:feature/iterator_flatten, r=alexcrichtonkennytm-36/+367
Add Iterator::flatten This adds the trait method `.flatten()` on `Iterator` which flattens one level of nesting from an iterator or (into)iterators. The method `.flat_fmap(f)` is then redefined as `.map(f).flatten()`. The implementation of `Flatten` is essentially that of what it was for `FlatMap` but removing the call to `f` at various places. Hopefully the type alias approach should be OK as was indicated / alluded to by @bluss and @eddyb in https://github.com/rust-lang/rfcs/pull/2306#issuecomment-361391370. cc @scottmcm
2018-02-25Rollup merge of #48076 - canarysnort01:fix_pie, r=alexcrichtonkennytm-12/+62
pass correct pie args to gcc linker When linking with gcc, run gcc -v to see if --enable-default-pie is compiled in. If it is, pass -no-pie when necessary to disable pie. Otherwise, pass -pie when necessary to enable it. Fixes #48032 and fixes #35061
2018-02-25Rollup merge of #47970 - vlovich:condvar_wait_until, r=dtolnaykennytm-2/+214
Add Condvar APIs not susceptible to spurious wake Provide wait_until and wait_timeout_until helper wrappers that aren't susceptible to spurious wake. Additionally wait_timeout_until makes it possible to more easily write code that waits for a fixed amount of time in face of spurious wakes since otherwise each user would have to do math on adjusting the duration. Implements #47960.
2018-02-25Rollup merge of #47964 - jcowgill:mips64-abi, r=eddybkennytm-76/+188
rustc_trans: rewrite mips64 ABI code This PR rewrites the ABI handling code for 64-bit MIPS and should fix various FFI issues including #47290. To accomodate the 64-bit ABI I have had to add a new `CastTarget` variant which I've called `Chunked` (though maybe this isn't the best name). This allows an ABI to cast to some arbitrary structure of `Reg` types. This is required on MIPS which might need to cast to a structure containing a mixture of `i64` and `f64` types.
2018-02-251.25.0 -> 1.26.-Manish Goregaokar-2/+2
2018-02-24Fixes docs for ASCII functions to no longer claim U+0021 is '@'.Nathan Ringo-3/+3
2018-02-24ignore-pretty on dyn trait testManish Goregaokar-0/+2
2018-02-24Rollup merge of #48503 - petrochenkov:nort, r=Mark-SimulacrumManish Goregaokar-3/+3
Remove directory `src/rt`
2018-02-24Rollup merge of #48499 - dwijnand:patch-1, r=BurntSushiManish Goregaokar-1/+1
Fix capitalisation in Path#file_name's docs
2018-02-24Rollup merge of #48490 - petrochenkov:orpat, r=eddybManish Goregaokar-128/+231
Implement multiple patterns with `|` in `if let` and `while let` (RFC 2175) cc https://github.com/rust-lang/rust/issues/48215
2018-02-24Rollup merge of #48481 - Manishearth:dyn-paren, r=petrochenkovManish Goregaokar-10/+11
Allow parentheses in `dyn (Trait)` r? @eddyb @nikomatsakis
2018-02-24Rollup merge of #48452 - varkor:unpacked-kind, r=eddybManish Goregaokar-153/+173
Introduce UnpackedKind This adds an `UnpackedKind` type as a typesafe counterpart to `Kind`. This should make future changes to kinds (such as const generics!) more resilient, as the type-checker will be able to catch more potential issues. r? @eddyb cc @yodaldevoid
2018-02-24Rollup merge of #48448 - nikomatsakis:default-binding-mode-issue-46688, ↵Manish Goregaokar-0/+38
r=cramertj reset default binding mode when we pass through a `&` pattern Fixes #46688. r? @cramertj
2018-02-24Rollup merge of #48441 - petrochenkov:exty, r=estebankManish Goregaokar-2/+8
Fix parsing of extern paths in types and poly-traits Fixes https://github.com/rust-lang/rust/issues/48262
2018-02-24Rollup merge of #48415 - QuietMisdreavus:traits-on-traits-on-traits, ↵Manish Goregaokar-3/+52
r=Manishearth rustdoc: don't crash when an external trait's docs needs to import another trait Fixes https://github.com/rust-lang/rust/issues/48414 When resolving intra-paths for an item, rustdoc needs to have information about their items on hand, for proper bookkeeping. When loading a path for an external item, it needs to load these items from their host crate, since their information isn't otherwise available. This includes resolving paths for those docs. which can cause this process to recurse. Rustdoc keeps a map of external traits in a `RefCell<HashMap<DefId, Trait>>`, and it keeps a borrow of this active when importing an external trait. In the linked crash, this led to a RefCell borrow error, panic, and ICE. This PR manually releases the borrow while importing the trait, and also keeps a list of traits being imported at the given moment. The latter keeps rustdoc from infinitely recursing as it tries to import the same trait repeatedly.
2018-02-24Rollup merge of #48404 - steveklabnik:second-edition-is-the-best-edition, ↵Manish Goregaokar-0/+0
r=QuietMisdreavus Update the book to promote second edition This updates the book repository, but mostly to include https://github.com/rust-lang/book/pull/1180 TL;DR: the second edition is close enough to done that we should universally recommend it over the first edition.
2018-02-24Rollup merge of #48392 - estebank:string, r=petrochenkovManish Goregaokar-27/+61
Handle custom diagnostic for `&str + String` Now all of `&str + &str`, `&str + String` and `String + String` have relevant diagnostic output.
2018-02-24Rollup merge of #48386 - withoutboats:nonstandard-style, r=ManishearthManish Goregaokar-0/+109
Add nonstandard_style alias for bad_style.
2018-02-24Rollup merge of #48296 - ishitatsuyuki:exp-unblow, r=nikomatsakisManish Goregaokar-151/+133
Fix exponential projection complexity on nested types This implements solution 1 from https://github.com/rust-lang/rust/issues/38528#issuecomment-366263076. The code quality is currently extremely poor, but we can improve them during review. Blocking issues: - we probably don't want a quadratic deduplication for obligations. - is there an alternative to deduplication? Based on #48315. Needs changelog. Noticable improvement on compile time is expected. Fix #38528 Close #39684 Close #43757
2018-02-24Rollup merge of #48197 - bobtwinkles:two_phase_borrow_on_ops, r=nikomatsakisManish Goregaokar-61/+54
Allow two-phase borrows of &mut self in ops We need two-phase borrows of ops to be in the initial NLL release since without them lots of existing code will break. Fixes #48129. CC @pnkfelix and @nikomatsakis r? @pnkfelix
2018-02-24Rollup merge of #48110 - Centril:stabilize/box_leak, r=alexcrichtonManish Goregaokar-6/+1
Stabilize Box::leak Stabilizes the following: + `Box::leak` (`box_leak`, in nightly since 2017-11-23) cc #46179 r? @rust-lang/libs