about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-11-05Account for typo in turbofish and suggest `::`Esteban Küber-5/+11
2019-11-04Detect `::` -> `:` typo when involving turbofishEsteban Küber-1/+21
2019-10-29Auto merge of #65927 - eddyb:eval-always-considered-harmful, r=michaelwoeristerbors-2/+0
Don't use eval_always for miri queries used from codegen. This should fix the [massive incremental perf regression](https://perf.rust-lang.org/compare.html?start=95f437b3cfb2fec966d7eaf69d7c2e36f9c274d1&end=9285d401a6070094747465962bc49969b93e14c5&stat=instructions:u) introduced in #65664. It seems that `eval_always` was mistakenly(?) added to `const_field` and then it ended up on `const_caller_location` (which is used much more often than `const_field` is). r? @michaelwoerister cc @oli-obk @nnethercote
2019-10-29Don't use eval_always for miri queries used from codegen.Eduard-Mihai Burtescu-2/+0
2019-10-29Auto merge of #65435 - michaelwoerister:fix-issue-64153, r=alexcrichtonbors-21/+68
Fix #64153 This PR changes how the compiler detects if an object file from an upstream crate is a Rust object file or not. Instead of checking if the name starts with the crate name and ends with `.o` (which is not always the case, as described in #64153), it now just checks if the filename ends with `.rcgu.o`. This fixes #64153. However, ideally we'd clean up the code around filename generation some more. Then this check could be made more robust. r? @alexcrichton
2019-10-29Rollup merge of #65809 - roblabla:eficall-abi, r=nagisaMazdak Farrokhzad-82/+203
Add new EFIAPI ABI Fixes #54527 Adds a new ABI, "efiapi", which reflects the calling convention as specified by [the current spec UEFI spec](https://uefi.org/sites/default/files/resources/UEFI%20Spec%202_7_A%20Sept%206.pdf#G6.999903). When compiling for x86_64, we should select the `win64` ABI, while on all other architectures (Itanium, x86, ARM and ARM64 and RISC-V), we should select the `C` ABI. Currently, this is done by just turning it into the C ABI everywhere except on x86_64, where it's turned into the win64 ABI. Should we prevent this ABI from being used on unsupported architectures, and if so, how would this be done?
2019-10-29Rollup merge of #65562 - Patryk27:master, r=estebankMazdak Farrokhzad-44/+57
Improve the "try using a variant of the expected type" hint. Fix https://github.com/rust-lang/rust/issues/65494. - Change type-printing output. - Use `span_to_snippet` when possible. - Change the message to `try using a variant of the expected enum`
2019-10-29Rollup merge of #65531 - tmandry:bump-backtrace, r=cramertjMazdak Farrokhzad-1/+5
Update backtrace to 0.3.40 Diff: https://github.com/rust-lang/backtrace-rs/compare/0.3.37...b5cc5b12fa4fd03cb83546a7c62b9fff40086b63 Pretty low risk, considering the only changes are in low-tier targets. r? @cramertj cc @alexcrichton
2019-10-29Rollup merge of #65318 - estebank:coherence, r=varkorMazdak Farrokhzad-250/+467
Call out the types that are non local on E0117 CC #24745.
2019-10-29Rollup merge of #65294 - varkor:lint-inline-prototype, r=matthewjasperMazdak Farrokhzad-205/+459
Lint ignored `#[inline]` on function prototypes Fixes https://github.com/rust-lang/rust/issues/51280. - Adds a `unused_attribute` lint for `#[inline]` on function prototypes. - As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).
2019-10-28Update backtrace to 0.3.40Tyler Mandry-1/+5
2019-10-28Auto merge of #65907 - Centril:rollup-9i8ev23, r=Centrilbors-215/+342
Rollup of 9 pull requests Successful merges: - #65563 (Add long error explanation for E0587) - #65640 (Use heuristics to recover parsing of missing `;`) - #65643 (Correct handling of type flags with `ConstValue::Placeholder`) - #65825 (rustc: use IndexVec<DefIndex, T> instead of Vec<T>.) - #65858 (suggest `const_in_array_repeat_expression` flag) - #65877 (doc: introduce `once` in `iter::chain` document) - #65887 (doc: mention `get(_mut)` in Vec) - #65891 (self-profiling: Record something more useful for crate metadata generation event.) - #65893 (Output previous stable error messaging when using stable build.) Failed merges: r? @ghost
2019-10-28Rollup merge of #65893 - jafern14:let-expr-stable-error-messaging, r=CentrilMazdak Farrokhzad-5/+14
Output previous stable error messaging when using stable build. Fixes #65254 As I had mentioned previously there I have the logic running right now however I'm not getting the exact same syntax highlighting as there was originally for this error. I'm currently getting the following: ``` error: expected expression, found statement (`let`) --> src/main.rs:2:14 | 2 | let x = (let y = 6); | ^^^^^^^^^ | = note: variable declaration using `let` is a statement ``` I'd like to get the following instead: ``` | let x = (let y = 6); | ^^^ ``` My current understanding is that the `span` being passed into `lower_expr_let` is coming from `lowering.rs`. I still don't know how the byte range is calculated for the erroneous syntax and need to look into it a bit more. In the meantime does anybody have any hints/tips regarding this??
2019-10-28Rollup merge of #65891 - michaelwoerister:sp-crate-metadata, r=wesleywiserMazdak Farrokhzad-2/+1
self-profiling: Record something more useful for crate metadata generation event. Before this commit, we had an event that would only track the compression step for proc-macros and Rust dylibs. After the commit we measure the time for acutally generating the crate metadata bytes. r? @wesleywiser
2019-10-28Rollup merge of #65887 - lzutao:doc-vec-get, r=rkruppeMazdak Farrokhzad-2/+4
doc: mention `get(_mut)` in Vec
2019-10-28Rollup merge of #65877 - lzutao:iter-chain-once, r=CentrilMazdak Farrokhzad-3/+18
doc: introduce `once` in `iter::chain` document I find it hard to find which one to use with `chain` when I only need to chain one value. Also [`once`][1] talks about `chain`. [1]: https://doc.rust-lang.org/nightly/std/iter/fn.once.html
2019-10-28Rollup merge of #65858 - davidtwco:rfc-2203-feature-gate-in-error, ↵Mazdak Farrokhzad-14/+83
r=ecstatic-morse suggest `const_in_array_repeat_expression` flag This PR adds a suggestion to add the `#![feature(const_in_array_repeat_expression)]` attribute to the crate when a promotable expression is used in a repeat expression and the feature gate is not enabled. Unfortunately, this ended up being a little bit more complex than I anticipated, which may not have been worth it given that this would all be removed when the feature is stabilized. However, with #65732 and #65737 being open, and the feature gate having not been being suggested to potential users, the feature might not be stabilized in a while, so maybe this is worth landing. cc @Centril (addresses [this comment](https://github.com/rust-lang/rust/pull/61749#discussion_r307863857)) r? @ecstatic-morse (opened issues related to RFC 2203 recently)
2019-10-28Rollup merge of #65825 - eddyb:def-index-vec, r=varkorMazdak Farrokhzad-23/+17
rustc: use IndexVec<DefIndex, T> instead of Vec<T>. Now that `DefIndex` is a proper index type, we can do that. There was also an unnecessary `Option` I removed, I wonder if that has perf implications.
2019-10-28Rollup merge of #65643 - varkor:remove-free-regions-from-const-placeholder, ↵Mazdak Farrokhzad-7/+9
r=eddyb Correct handling of type flags with `ConstValue::Placeholder` This fixes a mistake, but not https://github.com/rust-lang/rust/issues/65623. r? @eddyb
2019-10-28Rollup merge of #65640 - estebank:recover-missing-semi, r=CentrilMazdak Farrokhzad-157/+175
Use heuristics to recover parsing of missing `;` - Detect `,` and `:` typos where `;` was intended. - When the next token could have been the start of a new statement, detect a missing semicolon. Fix #48160, fix #44767 (after adding note about statements).
2019-10-28Rollup merge of #65563 - GuillaumeGomez:long-err-explanation-E0587, r=Dylan-DPCMazdak Farrokhzad-2/+21
Add long error explanation for E0587 Part of #61137. r? @kinnison
2019-10-28Output previous stable error messaging when using stable build.Agustin Fernandez-5/+14
2019-10-28suggest `const_in_array_repeat_expression` flagDavid Wood-14/+83
This commit adds a suggestion to add the `#![feature(const_in_array_repeat_expression)]` attribute to the crate when a promotable expression is used in a repeat expression. Signed-off-by: David Wood <david@davidtw.co>
2019-10-28review commentsEsteban Küber-44/+41
2019-10-28Tweak unexpected token wordingEsteban Küber-41/+42
2019-10-28Use heuristics to recover parsing of missing `;`Esteban Küber-100/+120
- Detect `,` and `:` typos where `;` was intended. - When the next token could have been the start of a new statement, detect a missing semicolon.
2019-10-28Improve pretty-printing for compound qualified paths.Patryk Wychowaniec-3/+13
2019-10-28Fix a previously forgotten pretty-printing test after a change to the ↵Patryk Wychowaniec-1/+1
pretty-printing mechanism.
2019-10-28Improve the "try using a variant of the expected type" hint.Patryk Wychowaniec-44/+47
2019-10-28Fix rebaseEsteban Küber-5/+5
2019-10-28Auto merge of #65202 - pietroalbini:scriptify-ci-config, r=alexcrichtonbors-281/+453
ci: move most of the prepare config into scripts This PR moves most of the configuration from the CI yamls into bash scripts, driven by a small Python script (which understands and emulates the two `##vso[` commands we use). There are two reasons why we'd want to do this: * Being able to prepare the build environment locally by just running `src/ci/prepare.py` simplifies a lot setting up a local VM similar to CI (software pre-installed in the CI images won't be prepared, but it's a start anyway). * When we'll switch to GitHub Actions we'll need to either duplicate code in multiple workflows or write a preprocessor. Having all the prepare steps in a single one is going to simplify the implementation of both options. Along with the move I did a few changes to the actual scripts: * Mirrored all the remaining external URLs we download (except chocolatey) to the `rust-lang-ci-mirrors` bucket, to increase reliability and reduce the chance of supply chain attacks. I didn't audit and mirror the CI scripts outside this PR though. * Extracted CI-specific behavior (like issuing `##vso[` commands and detecting the host platform) into `shared.sh` and included it in most of the scripts. This way a switch to another CI provider will be less painful. It's possible (and easier) to review this commit-by-commit. r? @alexcrichton cc @rust-lang/infra
2019-10-28add commentEsteban Küber-1/+1
2019-10-28Do not display ADT type arguments and fix rebaseEsteban Küber-73/+106
2019-10-28Account for tuples in explanationEsteban Küber-25/+26
2019-10-28Talk about specific types and remove lifetimes from outputEsteban Küber-43/+100
2019-10-28Further tweak spans for better readabilityEsteban Küber-18/+18
2019-10-28Use more targeted spans for orphan rule errorsEsteban Küber-199/+312
2019-10-28Call out the types that are non local on E0117Esteban Küber-61/+74
2019-10-28Ignore issue-64153 run-make test on Windows since supporting a Windows ↵Michael Woerister-0/+4
version is not worth the trouble.
2019-10-28ci: fix wrong path for wix being setPietro Albini-2/+2
2019-10-28Auto merge of #65421 - estebank:variants, r=petrochenkovbors-331/+600
Point at local similarly named element and tweak references to variants Partially address #65386.
2019-10-28self-profiling: Record something more useful for crate metadata generation ↵Michael Woerister-2/+1
event. Before this commit, we had an event that would only track the compression step for proc-macros and Rust dylibs. After the commit we measure the time for acutally generating the crate metadata bytes.
2019-10-28rustc: use IndexVec<DefIndex, T> instead of Vec<T>.Eduard-Mihai Burtescu-23/+17
2019-10-28ci: fix execution condition for install-clangPietro Albini-1/+1
2019-10-28Auto merge of #65188 - matthewjasper:stabilize-const-constructor, r=Centrilbors-109/+45
Stabilize `const_constructor` # Stabilization proposal I propose that we stabilize `#![feature(const_constructor)]`. Tracking issue: https://github.com/rust-lang/rust/issues/61456 Version target: 1.40 (2019-11-05 => beta, 2019-12-19 => stable). ## What is stabilized ### User guide Tuple struct and tuple variant constructors are now considered to be constant functions. As such a call expression where the callee has a tuple struct or variant constructor "function item" type can be called: ```rust const fn make_options() { // These already work because they are special cased: Some(0); (Option::Some)(1); // These also work now: let f = Option::Some; f(2); {Option::Some}(3); <Option<_>>::Some(5); } ``` ### Motivation Consistency with other `const fn`. Consistency between syntactic path forms. This should also ensure that constructors implement `const Fn` traits and can be coerced to `const fn` function pointers, if they are introduced. ## Tests * [ui/consts/const_constructor/const-construct-call.rs](https://github.com/rust-lang/rust/blob/0d75ab2293a106eb674ac01860910cfc1580837e/src/test/ui/consts/const_constructor/const-construct-call.rs) - Tests various syntactic forms, use in both `const fn` and `const` items, and constructors in both the current and extern crates. * [ui/consts/const_constructor/const_constructor_qpath.rs](https://github.com/rust-lang/rust/blob/1850dfcdabf8258a1f023f26c2c59e96b869dd95/src/test/ui/consts/const_constructor/const_constructor_qpath.rs) - Tests that type qualified paths to enum variants are also considered to be `const fn`.(#64247) r? @oli-obk Closes #61456 Closes #64247
2019-10-28doc: mention `get(_mut)` in VecLzu Tao-2/+4
2019-10-28Rollup merge of #65880 - Nadrieril:gather-usefulness-tests, r=varkorMazdak Farrokhzad-3/+6
Gather together usefulness tests I took most tests that were testing only for match exhaustiveness, pattern refutability or match arm reachability, and put them in the same test folder. I found it helpful to have them all in the same place when working on the usefulness algorithm.
2019-10-28Rollup merge of #65873 - lzutao:doc-vec-from-raw-parts, r=rkruppeMazdak Farrokhzad-1/+5
doc: explain why it is unsafe to construct Vec<u8> from Vec<u16>
2019-10-28Rollup merge of #65849 - popzxc:document-librustc_lexer, r=petrochenkovMazdak Farrokhzad-24/+225
librustc_lexer: Enhance documentation This PR enhances documentation state of the `librustc_lexer` (as initiative caused by [rustc-guide#474](https://github.com/rust-lang/rustc-guide/issues/474)), by adding: - Module documentation. - Doc-comments (and a bit of usual comments) in non-obvious (as for me) places. r? @petrochenkov cc @Centril
2019-10-28Rollup merge of #65792 - Centril:split-syntax-2, r=petrochenkovMazdak Farrokhzad-120/+130
rustc, rustc_passes: reduce deps on rustc_expand Part of #65324. r? @petrochenkov