about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-11-06Rollup merge of #66106 - JOE1994:master, r=GuillaumeGomezMazdak Farrokhzad-1/+1
Fix typo in explanation of `E0080` Handling issue #66105 in Rust repo. `evaluate an constant expression` to `evaluate a constant expression`
2019-11-06Rollup merge of #66101 - estebank:break-tail-e0308, r=CentrilMazdak Farrokhzad-10/+44
Tweak type mismatch caused by break on tail expr When `break;` has a type mismatch because the `Destination` points at a tail expression with an obligation flowing from a return type, point at the return type. Fix #39968.
2019-11-06Rollup merge of #66098 - estebank:path-asciption-typo, r=CentrilMazdak Farrokhzad-4/+30
Detect `::` -> `:` typo when involving turbofish Fix #65569.
2019-11-06Rollup merge of #66093 - estebank:fmt-ice, r=CentrilMazdak Farrokhzad-5/+23
Do not ICE with a precision flag in formatting str and no format arguments Fix #66065.
2019-11-06Rollup merge of #66081 - RalfJung:ptr-offset, r=zackmdavisMazdak Farrokhzad-6/+13
let caller of check_ptr_access_align control the error message This is needed for https://github.com/rust-lang/miri/pull/1031
2019-11-06Rollup merge of #66068 - euclio:null-emitter, r=estebankMazdak Farrokhzad-79/+19
use silent emitter for rustdoc highlighting pass Partially addresses #63284.
2019-11-06Rollup merge of #66054 - petrochenkov:delspan, r=estebankMazdak Farrokhzad-46/+46
syntax: Avoid span arithmetic for delimiter tokens The +/-1 logic is from the time where the whole group had a single span and the delimiter spans had to be calculated from it. Now the delimiters have their own spans which are constructed by lexer or proc macro API and can be used directly. If those spans are not perfect, then it should be fixed by tweaking the corresponding lexer logic rather than by trying to add or substract `1` from the span boundaries. Fixes https://github.com/rust-lang/rust/issues/62524 r? @estebank
2019-11-06Rollup merge of #66027 - Mark-Simulacrum:panic-handler-query, r=alexcrichtonMazdak Farrokhzad-11/+6
Move has_panic_handler to query Moves us off of a global Once instead re-querying the lang item each time. The conditions on when we set it to true change a little (previously we'd make sure a few more lang items were `Some`) but I think they in practice don't matter, we won't compile later on if we don't have them.
2019-11-06Rollup merge of #66014 - dkadashev:47319-type-param-def-location, r=estebankMazdak Farrokhzad-44/+141
Show type parameter name and definition in type mismatch error messages Fixes #47319 r? estebank
2019-11-06Rollup merge of #65892 - pnkfelix:trim-special-derives, r=petrochenkovMazdak Farrokhzad-59/+14
Remove `PartialEq` and `Eq` from the `SpecialDerives`. Now that PR #65519 landed, this is the follow-on work of removing `PartialEq` and `Eq` from the set of `SpecialDerives` .
2019-11-05Tweak type mismatch caused by break on tail exprEsteban Küber-10/+44
When `break;` has a type mismatch because the `Destination` points at a tail expression with an obligation flowing from a return type, point at the return type. Fix #39968.
2019-11-05Auto merge of #66121 - pietroalbini:rollup-8zrwe7l, r=pietroalbinibors-102/+266
Rollup of 8 pull requests Successful merges: - #65948 (Improve MaybeUninit::get_{ref,mut} documentation) - #65953 (Allow specifying LLVM's MCTargetOptions::ABIName in target specification files) - #66012 (De-querify `trivial_dropck_outlives`.) - #66025 (`Span` cannot represent `span.hi < span.lo`) - #66047 (Don't double-count `simd_shuffle` promotion candidates) - #66053 (when Miri tests are not passing, do not add Miri component) - #66082 (clean highlightSourceLines code) - #66091 (Implemented the home_dir for VxWorks) Failed merges: r? @ghost
2019-11-05Do not ICE whith a precision flag in formatting str and no format argumentsEsteban Küber-5/+23
2019-11-05Account for typo in turbofish and suggest `::`Esteban Küber-5/+11
2019-11-05Review feedback: alpha-rename field from `copy_derives` to ↵Felix S. Klock II-4/+4
`containers_derving_copy`.
2019-11-05Review feedback: Remove more stuff! Simplify simplify simplify!Felix S. Klock II-41/+13
2019-11-05Remove `PartialEq` and `Eq` from the `SpecialDerives`.Felix S. Klock II-18/+1
2019-11-05Rollup merge of #66091 - Wind-River:master_xyz, r=cramertjPietro Albini-1/+2
Implemented the home_dir for VxWorks Use HOME's value if it is set; otherwise return NONE.
2019-11-05Rollup merge of #66082 - GuillaumeGomez:cleanup-highlightsourcelines, r=kinnisonPietro Albini-42/+54
clean highlightSourceLines code This is the first part of https://github.com/rust-lang/rust/issues/66046. Now that I've splitted the hashchange stuff and the source code lines highlighting, I'll be able to fix the whole issue once and for all. r? @kinnison
2019-11-05Rollup merge of #66053 - RalfJung:miri-toolstate, r=pietroalbiniPietro Albini-1/+23
when Miri tests are not passing, do not add Miri component Second attempt, this time based on the JSON files that exist since https://github.com/rust-lang/rust/pull/65274. Fixes https://github.com/rust-lang/rust/issues/60301 r? @pietroalbini @alexcrichton
2019-11-05Rollup merge of #66047 - ecstatic-morse:issue-66016, r=eddybPietro Albini-0/+2
Don't double-count `simd_shuffle` promotion candidates Resolves #66016. The `#[rustc_args_required_const]` attribute was added to `simd_shuffle*` in rust-lang/stdarch#825. This caused `promote_consts` to double-count its second argument when recording promotion candidates, which caused the promotion candidate compatibility check to fail. Once `stdarch` is updated in-tree to include rust-lang/stdarch#825, all special logic around `simd_shuffle` can and should be removed.
2019-11-05Rollup merge of #66025 - petrochenkov:lohi, r=eddybPietro Albini-25/+6
`Span` cannot represent `span.hi < span.lo` So we can remove the corresponding checks from various code
2019-11-05Rollup merge of #66012 - nnethercote:dequery-trivial_dropck_outlives, ↵Pietro Albini-22/+8
r=michaelwoerister De-querify `trivial_dropck_outlives`. It's sufficiently simple and fast that memoizing it is a slight pessimization. r? @michaelwoerister
2019-11-05Rollup merge of #65953 - keystone-enclave:llvm_abiname, r=alexcrichtonPietro Albini-3/+12
Allow specifying LLVM's MCTargetOptions::ABIName in target specification files This addresses #65024, as it allows RISC-V target specification files to set `"llvm-abiname": "lp64d"`. Other languages (read: C) usually expose this codegen parameter under a compiler argument like `-mabi=<XYZ>`.
2019-11-05Rollup merge of #65948 - danielhenrymantilla:doc/maybe_uninit_ref_mut, ↵Pietro Albini-8/+159
r=RalfJung Improve MaybeUninit::get_{ref,mut} documentation As mentioned in https://github.com/rust-lang/rust/issues/63568#issuecomment-544106668, `MaybeUninit`'s `get_{ref,mut}` documentation is lacking, so this PR attempts to fix that. That being said, and as @RalfJung mentions in that thread, > In particular, we should clarify that all the UB rules for these methods equally apply when calling the raw ptr methods and creating a reference manually. these other docs also need to be improved, which I can do in this PR ~~(hence the `[WIP]`)~~. Finally, since all these documentations are related to clearly establishing when dealing with uninitialized memory which patterns are known to be sound and which patterns are currently UB (that is, until, if ever, the rules around references to unintialized integers get relaxed, this documentation will treat them as UB, and advise against such patterns (_e.g._, it is not possible to use uninitialized buffers with the `Read` API)), I think that adding even more examples to the main documentation of `MaybeUninit` inherent definition wouldn't hurt either. ___ - [Rendered](http://dreamy-ritchie-99d637.netlify.com/core/mem/union.maybeuninit#method.get_ref)
2019-11-05Auto merge of #66083 - RalfJung:miri-offset-from, r=oli-obkbors-11/+85
fix Miri offset_from This is needed to make https://github.com/rust-lang/miri/pull/1032 pass.
2019-11-05expand comment explaining integer exceptionRalf Jung-2/+4
2019-11-05Auto merge of #66109 - pietroalbini:rollup-2npidna, r=pietroalbinibors-94/+468
Rollup of 10 pull requests Successful merges: - #65136 (Update codegen option documentation.) - #65574 (docs: improve disclaimer regarding LinkedList) - #65720 (Add FFI bindings for LLVM's Module::getInstructionCount()) - #65905 ([doc] fixes for unix/vxworks `OpenOptionsExt::mode`) - #65962 (Fix logic in example.) - #66019 (Improved std::iter::Chain documentation) - #66038 (doc(str): show example of chars().count() under len()) - #66042 (Suggest correct code when encountering an incorrect trait bound referencing the current trait) - #66073 (Do not needlessly write-lock) - #66096 (Add a failing UI test for multiple loops of all kinds in a `const`) Failed merges: r? @ghost
2019-11-05Rollup merge of #66096 - ecstatic-morse:const-loop-test, r=CentrilPietro Albini-0/+118
Add a failing UI test for multiple loops of all kinds in a `const` This simply demonstrates the current behavior and ensures we don't allow anything by accident. The new const checker will be able to improve the diagnostics here. While working on it, I didn't see very many tests with non-`while` loops in a `const`, and there were no tests with multiple loops.
2019-11-05Rollup merge of #66073 - Mark-Simulacrum:no-borrow-mut, r=CentrilPietro Albini-1/+1
Do not needlessly write-lock Just removes a needless `borrow_mut()` by using `borrow()` instead.
2019-11-05Rollup merge of #66042 - ↵Pietro Albini-4/+60
ohadravid:suggest-correct-code-when-ref-current-trait, r=estebank Suggest correct code when encountering an incorrect trait bound referencing the current trait Fixes #65985 and also improves the suggestion for code like this: ``` trait Grab { type Value; fn grab(&self) -> Grab::Value; } ``` To suggest `<Self as Grab>::Value`. I wasn't sure which of the syntax versions is better (`<Self as ..>::` vs `Self::`), so I used the former simply because it was less change to the existing code. r? @estebank
2019-11-05Rollup merge of #66038 - jdxcode:char-len, r=alexcrichtonPietro Albini-4/+9
doc(str): show example of chars().count() under len() the docs are great at explaining that .len() isn't like in other languages but stops short of explaining how to get the character length.
2019-11-05Rollup merge of #66019 - olegnn:fixed_std_iter_chain_docs, r=Mark-SimulacrumPietro Albini-1/+1
Improved std::iter::Chain documentation Replaces `strings two iterators` by `links two iterators` in `std::iter::Chain` documentation. I didn't find any meaning of `strings` which can be evaluated as `links` or `joins`. I don't think that `std::iter:Chain` works as a stringer or plays billiards. (https://www.lexico.com/en/definition/string).
2019-11-05Rollup merge of #65962 - kevincox:patch-1, r=sfacklerPietro Albini-5/+5
Fix logic in example. The example claims SuperiorThanZero and presumably Zero is not Superior than itself so it should not be allowed.
2019-11-05Rollup merge of #65905 - cuviper:doc-unix-mode, r=Dylan-DPCPietro Albini-4/+4
[doc] fixes for unix/vxworks `OpenOptionsExt::mode`
2019-11-05Rollup merge of #65720 - icefoxen:LLVMgetInstructionCount, r=rkruppePietro Albini-0/+9
Add FFI bindings for LLVM's Module::getInstructionCount() Just to make it usable for profiling and such inside rustc itself. It was vaguely useful in https://wiki.alopex.li/WhereRustcSpendsItsTime and I figured I might as well upstream it; I may or may not ever get around to doing more with it (hopefully I will), but it may be useful for others.
2019-11-05Rollup merge of #65574 - tshepang:linked-list-disclaimer, r=CentrilPietro Albini-7/+7
docs: improve disclaimer regarding LinkedList
2019-11-05Rollup merge of #65136 - ehuss:update-codegen-options, r=Dylan-DPCPietro Albini-68/+254
Update codegen option documentation. Some documentation updates: - Add more detail to codegen options. - Add missing options: - `force-frame-pointers` - `default-linker-libraries` - `linker-plugin-lto` - Add fragment anchors for all command-line-arguments. - Add some cross links between options.
2019-11-05Auto merge of #65938 - eddyb:fn-abi-rename, r=oli-obkbors-311/+311
rustc_target: rename {Fn,Arg}Type to {Fn,Arg}Abi. I was trying to tweak the API of `FnType` (now `FnAbi`) and the name kept bothering me. `FnAbi` is to a function signature a bit like a layout is to a type, so the name still isn't perfect yet, but at least it doesn't have the misleading `Type` in it anymore. If this can't land I think I can continue my original refactor without it, so I'm not strongly attached to it. r? @nagisa cc @oli-obk
2019-11-05Fix typo in explanation of `E0080`Youngsuk Kim-1/+1
Handling issue #66105 in Rust repo. `evaluate an constant expression` to `evaluate a constant expression`
2019-11-05Auto merge of #65911 - mati865:static-libstdcxx-mingw, r=alexcrichtonbors-6/+10
Statically link libstdc++ on windows-gnu Fixes https://github.com/rust-lang/rust/issues/61561 by not shipping `libstdc++-6.dll` which can conflict with the GCC.
2019-11-04Detect `::` -> `:` typo when involving turbofishEsteban Küber-1/+21
2019-11-04Add tests for loop constructs in constsDylan MacKenzie-0/+118
These errors are suboptimal, but they will be fixed by the new `check_consts` pass.
2019-11-04Auto merge of #65874 - Nadrieril:clarify-usefulness, r=varkorbors-798/+1047
Clarify pattern-matching usefulness algorithm This PR clarifies a bit the usefulness algorithm by emphasizing that each row of the matrix can be seen as a sort of stack from which we pop constructors. It also moves code around to increase separation of concerns. This is part of my splitting of https://github.com/rust-lang/rust/pull/65160 into smaller PRs.
2019-11-04Minor style improvementsDaniel Henry-Mantilla-13/+7
Co-Authored-By: Ralf Jung <post@ralfj.de>
2019-11-04Implemented the home_dir for VxWorksUmesh Kalappa-1/+2
2019-11-04also test different integersRalf Jung-1/+27
2019-11-04test offset_from with two integersRalf Jung-8/+37
2019-11-04Miri: ptr_offset_from: support offset_from with twice the same non-null integerRalf Jung-3/+20
2019-11-04Miri: offset_from: do int-to-ptr casts when neededRalf Jung-2/+2