about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-10-01Auto merge of #74839 - alarsyo:multiple_return_terminators, r=oli-obkbors-122/+108
Implement multiple return terminator optimization Closes #72022
2020-10-01Bless mir-opt tests for 32 bitAntoine Martin-16/+12
2020-10-01Add test for multiple terminator optimizationAntoine Martin-0/+44
2020-10-01Bless mir-opt tests with new optAntoine Martin-106/+52
2020-10-01Auto merge of #77354 - ecstatic-morse:const-checking-moar-errors, r=oli-obkbors-355/+345
Overhaul const-checking diagnostics The primary purpose of this PR was to remove `NonConstOp::STOPS_CONST_CHECKING`, which causes any additional errors found by the const-checker to be silenced. I used this flag to preserve diagnostic parity with `qualify_min_const_fn.rs`, which has since been removed. However, simply removing the flag caused a deluge of errors in some cases, since an error would be emitted any time a local or temporary had a wrong type. To remedy this, I added an alternative system (`DiagnosticImportance`) to silence additional error messages that were likely to distract the user from the underlying issue. When an error of the highest importance occurs, all less important errors are silenced. When no error of the highest importance occurs, all less important errors are emitted after checking is complete. Following the suggestions from the important error is usually enough to fix the less important errors, so this should lead to better UX most of the time. There's also some unrelated diagnostics improvements in this PR isolated in their own commits. Splitting them out would be possible, but a bit of a pain. This isn't as tidy as some of my other PRs, but it should *only* affect diagnostics, never whether or not something passes const-checking. Note that there are a few trivial exceptions to this, like banning `Yield` in all const-contexts, not just `const fn`. As always, meant to be reviewed commit-by-commit. r? `@oli-obk`
2020-10-01Auto merge of #77379 - camelid:improve-wording-crate-resolution-error, ↵bors-2/+2
r=davidtwco Improve wording for external crate resolution error I think it reads better this way.
2020-10-01Rollup merge of #77371 - camelid:remove-extra-space-in-diagnostic, r=varkorDylan DPC-0/+18
Remove trailing space in error message - Add test for error message - Remove trailing space in error message
2020-10-01Rollup merge of #77360 - oli-obk:zst_const_pat_regression, r=RalfJungDylan DPC-0/+9
References to ZSTs may be at arbitrary aligned addresses fixes #77320 r? @RalfJung
2020-10-01Rollup merge of #77349 - ehuss:update-cargo, r=ehussDylan DPC-0/+0
Update cargo 8 commits in 05c611ae3c4255b7a2bcf4fcfa65b20286a07839..75615f8e69f748d7ef0df7bc0b064a9b1f5c78b2 2020-09-23 23:10:38 +0000 to 2020-09-29 18:42:19 +0000 - Correct mistake about supporting sub-makes and document CARGO_MAKEFLAGS (rust-lang/cargo#8741) - Properly set for_host for proc-macro tests. (rust-lang/cargo#8742) - Add Zsh completion for target triples (rust-lang/cargo#8740) - Reinitialize index on "Object not found" error. (rust-lang/cargo#8735) - Normalize raw string indentation. (rust-lang/cargo#8739) - Update links to rustup docs. (rust-lang/cargo#8738) - Add contributor guide. (rust-lang/cargo#8715) - Fix minor error in `cargo update` docs. (rust-lang/cargo#8737)
2020-10-01Rollup merge of #77343 - varkor:rustc_args_required_const-validation, r=lcnrDylan DPC-0/+74
Validate `rustc_args_required_const` Fixes https://github.com/rust-lang/rust/issues/74608.
2020-10-01Rollup merge of #77324 - Aaron1011:fix/const-item-mutation-ptr, r=petrochenkovDylan DPC-24/+35
Don't fire `const_item_mutation` lint on writes through a pointer Fixes #77321
2020-10-01Rollup merge of #77303 - lcnr:const-evaluatable-TooGeneric, r=oli-obk,varkorDylan DPC-41/+49
const evaluatable: improve `TooGeneric` handling Instead of emitting an error in `fulfill`, we now correctly stall on inference variables. As `const_eval_resolve` returns `ErrorHandled::TooGeneric` when encountering generic parameters on which we actually do want to error, we check for inference variables and eagerly emit an error if they don't exist, returning `ErrorHandled::Reported` instead. Also contains a small bugfix for `ConstEquate` where we previously only stalled on type variables. This is probably a leftover from when we did not yet support stalling on const inference variables. r? @oli-obk cc @varkor @eddyb
2020-10-01Rollup merge of #77202 - ehuss:defer-apple-sdkroot, r=petrochenkovDylan DPC-11/+8
Defer Apple SDKROOT detection to link time. This defers the detection of the SDKROOT for Apple iOS/tvOS targets to link time, instead of when the `Target` is defined. This allows commands that don't need to link to work (like `rustdoc` or `rustc --print=target-list`). This also makes `--print=target-list` a bit faster. This also removes the note in the platform support documentation about these targets being missing. When I wrote it, I misunderstood how the SDKROOT stuff worked. Notes: * This means that JSON spec targets can't explicitly override these flags. I think that is probably fine, as I believe the value is generally required, and can be set with the SDKROOT environment variable. * This changes `x86_64-apple-tvos` to use `appletvsimulator`. I think the original code was wrong (it was using `iphonesimulator`). Also, `x86_64-apple-tvos` seems broken in general, and I cannot build it locally. The `data_layout` does not appear to be correct (it is a copy of the arm64 layout instead of the x86_64 layout). I have not tried building Apple's LLVM to see if that helps, but I suspect it is just wrong (I'm uncertain since I don't know how the tvOS simulator works with its bitcode-only requirements). * I'm tempted to remove the use of `Result` for built-in target definitions, since I don't think they should be fallible. This was added in https://github.com/rust-lang/rust/pull/34980, but that only relates to JSON definitions. I think the built-in targets shouldn't fail. I can do this now, or not. Fixes #36156 Fixes #76584
2020-10-01Rollup merge of #77153 - Aaron1011:fix/better-recursive-expand, r=petrochenkovDylan DPC-0/+86
Fix recursive nonterminal expansion during pretty-print/reparse check Makes progress towards #43081 In PR #73084, we started recursively expanded nonterminals during the pretty-print/reparse check, allowing them to be properly compared against the reparsed tokenstream. Unfortunately, the recursive logic in that PR only handles the case where a nonterminal appears inside a `TokenTree::Delimited`. If a nonterminal appears directly in the expanded tokens of another nonterminal, the inner nonterminal will not be expanded. This PR fixes the recursive expansion of nonterminals, ensuring that they are expanded wherever they occur.
2020-09-30Improve wording for external crate resolution errorCamelid-2/+2
I think it reads better this way.
2020-09-30Auto merge of #77372 - jonas-schievink:rollup-e5bdzga, r=jonas-schievinkbors-2/+71
Rollup of 12 pull requests Successful merges: - #77037 (more tiny clippy cleanups) - #77233 (BTreeMap: keep an eye out on the size of the main components) - #77280 (Ensure that all LLVM components requested by tests are available on CI) - #77284 (library: Forward compiler-builtins "mem" feature) - #77296 (liveness: Use Option::None to represent absent live nodes) - #77322 (Add unstable book docs for `-Zunsound-mir-opts`) - #77328 (Use `rtassert!` instead of `assert!` from the child process after fork() in std::sys::unix::process::Command::spawn()) - #77331 (Add test for async/await combined with const-generics.) - #77338 (Fix typo in alloc vec comment) - #77340 (Alloc vec use imported path) - #77345 (Add test for issue #74761) - #77348 (Update books) Failed merges: r? `@ghost`
2020-09-30Rollup merge of #77348 - ehuss:update-books, r=ehussJonas Schievink-0/+0
Update books ## rust-by-example 5 commits in 19f0a0372af497b34369cf182d9d16156cab2969..7d3ff1c12db08a847a57a054be4a7951ce532d2d 2020-08-26 09:38:48 -0300 to 2020-09-28 15:54:25 -0300 - Prevent duplicated error information in "wrapping errors" example (rust-lang/rust-by-example#1375) - Avoid lifetime annotation in struct example (rust-lang/rust-by-example#1378) - Clone.md comment and variable name change (rust-lang/rust-by-example#1379) - Replace panic example with a simpler version (rust-lang/rust-by-example#1380) - Prefer `const` over `static` (rust-lang/rust-by-example#1381) ## embedded-book 1 commits in 0cd2ca116274b915924c3a7e07c1e046b6f19b77..dd310616308e01f6cf227f46347b744aa56b77d9 2020-08-19 10:33:15 +0000 to 2020-09-26 08:54:08 +0000 - Add instructions for ARM v8 instruction sets (rust-embedded/book#265)
2020-09-30Rollup merge of #77345 - samlich:test-issue-74761, r=lcnrJonas Schievink-0/+31
Add test for issue #74761 Adds test for and closes #74761 which previously crashed compiler.
2020-09-30Rollup merge of #77331 - hameerabbasi:issue-74906, r=lcnrJonas Schievink-0/+25
Add test for async/await combined with const-generics. Fixes #74906.
2020-09-30Rollup merge of #77322 - rust-lang:wesleywiser-patch-1, r=steveklabnikJonas Schievink-0/+8
Add unstable book docs for `-Zunsound-mir-opts` The `-Zunsound-mir-opts` flag was added in #76899.
2020-09-30Rollup merge of #77280 - petrochenkov:llvmcomp, r=Mark-SimulacrumJonas Schievink-2/+7
Ensure that all LLVM components requested by tests are available on CI Addresses https://github.com/rust-lang/rust/pull/75064#issuecomment-667722652 I used an environment variable because passing a command line option all the way from CI to compiletest would be just too much hassle for this task. I added a new variable, but any of the already existing ones defined by CI could be used instead. r? @Mark-Simulacrum
2020-09-30Remove trailing space in error messageCamelid-1/+1
2020-09-30Auto merge of #75810 - hug-dev:cmse-nonsecure-entry, r=jonas-schievinkbors-0/+175
Add support for cmse_nonsecure_entry attribute This pull request adds the `cmse_nonsecure_entry` attribute under an unstable feature. I was not sure if it was fine for me to send directly the pull-request or if I should submit a RFC first. I was told on Zulip that it was fine to do so but please close it if I need first submit a RFC or follow another process instead. The `cmse_nonsecure_entry` attribute is a LLVM attribute that will be available in LLVM 11. I plan to rebase on the [upgrade PR](https://github.com/rust-lang/rust/pull/73526) once merged to make this one compile. This attribute modifies code generation of the function as explained [here](https://developer.arm.com/documentation/ecm0359818/latest/) to make it work with the TrustZone-M hardware feature. This feature is only available on `thumbv8m` targets so I created an error for that if one tries to use this attribute for another target. I added this attribute in Rust as any other LLVM attribute are added but since this one is target-dependent I am not sure if it was the best thing to do. Please indicate me if you think of other ways, like isolating target-dependent attributes together. ---------------- Tracking issue: https://github.com/rust-lang/rust/issues/75835
2020-09-30Remove E0019, use E0015 for inline assembly in a constDylan MacKenzie-3/+3
2020-09-30Add test for error messageCamelid-0/+18
2020-09-30Add more tests and check for ABIHugues de Valon-4/+68
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2020-09-30Auto merge of #77298 - jyn514:bootstrap-config, r=Mark-Simulacrumbors-5/+7
Don't warn if the config file is somewhere other than `config.toml` Previously, `config.config` was always hardcoded as `"config.toml"`. I thought that it was being overridden with the actual value later, but it turns out `flags.config` was being completely discarded. This keeps `config.config` in sync with `flags.config`. Fixes https://github.com/rust-lang/rust/issues/77293 r? `@Mark-Simulacrum` cc `@davidtwco`
2020-09-30Add support for cmse_nonsecure_entry attributeHugues de Valon-0/+111
This patch adds support for the LLVM cmse_nonsecure_entry attribute. This is a target-dependent attribute that only has sense for the thumbv8m Rust targets. You can find more information about this attribute here: https://developer.arm.com/documentation/ecm0359818/latest/ Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2020-09-30Auto merge of #77281 - tmiasko:liveness-everybody, r=oli-obkbors-8/+146
Liveness analysis for everybody Perform liveness analysis for every body instead of limiting it to fns. Fixes #77169.
2020-09-30Validate `rustc_args_required_const`varkor-0/+74
2020-09-30Auto merge of #77356 - RalfJung:miri, r=RalfJungbors-7/+34
update miri Fixes https://github.com/rust-lang/rust/issues/77310 r? `@ghost` Cc `@rust-lang/miri`
2020-09-30update miriRalf Jung-7/+34
2020-09-30References to ZSTs may be at arbitrary aligned addressesOliver Scherer-0/+9
2020-09-30Auto merge of #77294 - shepmaster:try-anchors, r=pietroalbinibors-13/+13
Use YAML anchors for try builds r? `@pietroalbini`
2020-09-30Auto merge of #77069 - sexxi-goose:closure_print_2, r=nikomatsakisbors-50/+459
pretty.rs: Update Closure and Generator print More detailed outline: https://github.com/rust-lang/project-rfc-2229/pull/17 Closes: https://github.com/rust-lang/project-rfc-2229/issues/11 r? `@nikomatsakis` cc `@eddyb` `@davidtwco` `@estebank`
2020-09-29Update `compile-fail` testDylan MacKenzie-0/+2
2020-09-30Add test for issue #74761samlich-0/+31
2020-09-29Bless testsDylan MacKenzie-15/+55
2020-09-29Bless outputDylan MacKenzie-15/+95
2020-09-29Bless testsDylan MacKenzie-242/+71
2020-09-29Bless mut testsDylan MacKenzie-105/+173
2020-09-29Fix "unstable in stable" errorDylan MacKenzie-3/+12
The "otherwise" note is printed before the suggestion currently.
2020-09-29`delay_span_bug` if const-checking an `async` functionDylan MacKenzie-59/+21
This errors during AST lowering. Any errors we emit here are just noise.
2020-09-30Auto merge of #77133 - tmandry:bootstrap-host, r=Mark-Simulacrumbors-86/+52
bootstrap: Always build for host, even when target is given This changes the behavior from *not* building for host whenever an explicit target is specified. I find this much less confusing. You can still disable host steps by passing an explicit empty list for host. Fixes #76990. r? `@Mark-Simulacrum`
2020-09-29Update cargoEric Huss-0/+0
2020-09-29Filter out empty items in bootstrap::flags::splitTyler Mandry-1/+1
2020-09-29Update booksEric Huss-0/+0
2020-09-29Liveness analysis for everybodyTomasz Miąsko-8/+146
Perform liveness analysis for every body instead of limiting it to fns.
2020-09-29Use --host='' instead of --host ''Tyler Mandry-14/+14
Trying to fix a problem in CI. Maybe some version of Docker is not passing '' args correctly?
2020-09-29Auto merge of #77274 - tmiasko:liveness-cnd, r=lcnrbors-0/+53
Liveness refactoring continued * Move body_owner field from IrMaps to Liveness (the only user of the field). * Use upvars instead of FnKind to check for closures (avoids FnKind, will be useful when checking all bodies, not just fns). * Use visit_param to add variables corresponding to params. * Store upvars_mentioned inside Liveness struct. * Inline visitor implementation for IrMaps, avoiding unnecessary indirection. * Test interaction with automatically_derived attribute (not covered by any of existing tests). No functional changes intended.