about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-12-03add clobber_abi("C") to may_unwind inline-asm testscynecx-2/+2
2021-12-03add tests for asm's options(may_unwind)cynecx-0/+95
2021-12-03add `unwind_asm` feature gate for `may_unwind` optioncynecx-0/+20
2021-12-03Update unstable-book with recent asm changes (`may_unwind`)cynecx-1/+2
2021-12-03Add initial AST and MIR support for unwinding from inline assemblyAmanieu d'Antras-49/+47
2021-12-03Auto merge of #90737 - eholk:intofuture, r=tmandrybors-4/+74
Reintroduce `into_future` in `.await` desugaring This is a reintroduction of the remaining parts from https://github.com/rust-lang/rust/pull/65244 that have not been relanded yet. This isn't quite ready to merge yet. The last attempt was reverting due to performance regressions, so we need to make sure this does not introduce those issues again. Issues #67644, #67982 /cc `@yoshuawuyts`
2021-12-03Revert "Auto merge of #91354 - fee1-dead:const_env, r=spastorino"Santiago Pastorino-9/+9
This reverts commit 18bb8c61a975fff6424cda831ace5b0404277145, reversing changes made to d9baa361902b172be716f96619b909f340802dea.
2021-12-03Rollup merge of #91483 - calebcartwright:sync-rustfmt-subtree, r=calebcartwrightMatthias Krüger-435/+1730
Sync rustfmt subtree
2021-12-03Rollup merge of #91462 - b-naber:use-try-normalize-erasing-regions, r=jackh726Matthias Krüger-0/+50
Use try_normalize_erasing_regions in needs_drop Fixes https://github.com/rust-lang/rust/issues/81199 r? ``@jackh726``
2021-12-03Rollup merge of #91273 - Badel2:ice-index-str, r=estebankMatthias Krüger-0/+59
Fix ICE #91268 by checking that the snippet ends with a `)` Fix #91268 Previously it was assumed that the last character of `snippet` will be a `)`, so using `snippet.len() - 1` as an index should be safe. However as we see in the test, it is possible to enter that branch without a closing `)`, and it will trigger the panic if the last character happens to be multibyte. The fix is to ensure that the snippet ends with `)`, and skip the suggestion otherwise.
2021-12-03Rollup merge of #91170 - jsha:preload-fonts, r=GuillaumeGomezMatthias Krüger-0/+6
rustdoc: preload fonts Follow-up from #82315. I noticed that font loading was so slow that even when loading from local disk, we get a flash of unstyled text (FOUT) followed by a reflow when the fonts load. With this change, we reliably get the appropriate fonts in the first render pass when loading locally, and we get it some of the time when loading from a website. This only preloads woff2 versions. According to https://caniuse.com/?search=preload and https://caniuse.com/?search=woff2, all browsers that support preload also support woff2, so this is fine; we will never load two copies of a font. Don't preload italic font faces because they aren't used on all pages. Demo: https://rustdoc.crud.net/jsha/preload-fonts/std/string/struct.String.html
2021-12-03Rollup merge of #90854 - sanxiyn:unsized-and-uninhabited, r=estebankMatthias Krüger-0/+21
Type can be unsized and uninhabited Fix #88150.
2021-12-02Merge commit '8da837185714cefbb261e93e9846afb11c1dc60e' into ↵Caleb Cartwright-435/+1730
sync-rustfmt-subtree
2021-12-02Merge remote-tracking branch 'upstream/master' into subtree-sync-2021-12-02Caleb Cartwright-375/+443
2021-12-02Update .stderr filesEric Holk-0/+3
2021-12-02use try_normalize_erasing_regions in needs_dropb-naber-0/+50
2021-12-02Auto merge of #91469 - matthiaskrgr:rollup-xom3j55, r=matthiaskrgrbors-10/+286
Rollup of 12 pull requests Successful merges: - #89954 (Fix legacy_const_generic doc arguments display) - #91321 (Handle placeholder regions in NLL type outlive constraints) - #91329 (Fix incorrect usage of `EvaluatedToOk` when evaluating `TypeOutlives`) - #91364 (Improve error message for incorrect field accesses through raw pointers) - #91387 (Clarify and tidy up explanation of E0038) - #91410 (Move `#![feature(const_precise_live_drops)]` checks earlier in the pipeline) - #91435 (Improve diagnostic for missing half of binary operator in `if` condition) - #91444 (disable tests in Miri that take too long) - #91457 (Add additional test from rust issue number 91068) - #91460 (Document how `last_os_error` should be used) - #91464 (Document file path case sensitivity) - #91466 (Improve the comments in `Symbol::interner`.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-02Rollup merge of #91457 - steffahn:additional_test_from_91068, r=jackh726Matthias Krüger-0/+22
Add additional test from rust issue number 91068 see rust-lang/rust#91068 r? ``@jackh726``
2021-12-02Rollup merge of #91435 - FabianWolff:issue-91421-if-then, r=lcnrMatthias Krüger-1/+36
Improve diagnostic for missing half of binary operator in `if` condition Fixes #91421. I've also changed it so that it doesn't consume the `else` token in the error case, because it will try to consume it again afterwards, leading to this incorrect error message (where the `else` reported as missing is actually there): ``` error: expected one of `.`, `;`, `?`, `else`, or an operator, found `{` --> src/main.rs:4:12 | 4 | } else { 4 }; | ^ expected one of `.`, `;`, `?`, `else`, or an operator ``` r? `@lcnr`
2021-12-02Rollup merge of #91410 - ecstatic-morse:const-precise-live-drops-take-2, ↵Matthias Krüger-8/+34
r=oli-obk Move `#![feature(const_precise_live_drops)]` checks earlier in the pipeline Should mitigate the issues found during MCP on #73255. Once this is done, we should clean up the queries a bit, since I think `mir_drops_elaborated_and_const_checked` can be merged back into `mir_promoted`. Fixes #90770. cc ``@rust-lang/wg-const-eval`` r? ``@nikomatsakis`` (since they reviewed #71824)
2021-12-02Rollup merge of #91364 - FabianWolff:issue-91210-ptr-field, r=oli-obkMatthias Krüger-0/+41
Improve error message for incorrect field accesses through raw pointers Fixes #91210.
2021-12-02Rollup merge of #91329 - Aaron1011:modulo-regions-test, r=jackh726Matthias Krüger-0/+77
Fix incorrect usage of `EvaluatedToOk` when evaluating `TypeOutlives` A global predicate is not guarnatenteed to outlive all regions. If the predicate involves late-bound regions, then it may fail to outlive other regions (e.g. `for<'b> &'b bool: 'static` does not hold) We now only produce `EvaluatedToOk` when a global predicate has no late-bound regions - in that case, the ony region that can be present in the type is 'static
2021-12-02Rollup merge of #91321 - matthewjasper:constaint-placeholders, r=jackh726Matthias Krüger-0/+19
Handle placeholder regions in NLL type outlive constraints Closes #76168
2021-12-02Rollup merge of #89954 - GuillaumeGomez:legacy-const-generic-doc, r=AmanieuMatthias Krüger-1/+57
Fix legacy_const_generic doc arguments display Fixes https://github.com/rust-lang/rust/issues/83167. cc ``@Amanieu``
2021-12-02Code review feedbackEric Holk-4/+9
Add a note about `IntoFuture` in error messages where T is not a future. Change await-into-future.rs to be a run-pass test.
2021-12-02Auto merge of #91318 - eggyal:reduce-boilerplate-around-infallible-folders, ↵bors-5/+4
r=jackh726 Reduce boilerplate around infallible folders Further to https://github.com/rust-lang/rust/pull/91230#issuecomment-981059666 r? `@jackh726`
2021-12-02Change to check-passJack Huey-1/+1
2021-12-02Add additional test from rust issue number 91068Frank Steffahn-0/+22
2021-12-02Reduce boilerplate around infallible foldersAlan Egerton-5/+4
2021-12-02Auto merge of #91455 - matthiaskrgr:rollup-gix2hy6, r=matthiaskrgrbors-388/+460
Rollup of 4 iffy pull requests Successful merges: - #89234 (Disallow non-c-like but "fieldless" ADTs from being casted to integer if they use arbitrary enum discriminant) - #91045 (Issue 90702 fix: Stop treating some crate loading failures as fatal errors) - #91394 (Bump stage0 compiler) - #91411 (Enable svh tests on msvc) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-02Rollup merge of #91411 - ChrisDenton:valid-paths, r=petrochenkovMatthias Krüger-24/+8
Enable svh tests on msvc These tests were ignored for msvc in #30778 because of additional notes that were being added for some reason. I'm fairly confident this has been fixed in the intervening years so lets try re-enabling these tests. Fixes #31306
2021-12-02Rollup merge of #91394 - Mark-Simulacrum:bump-stage0, r=pietroalbiniMatthias Krüger-339/+337
Bump stage0 compiler r? `@pietroalbini` (or anyone else)
2021-12-02Rollup merge of #91045 - mjptree:issue-90702-fix, r=petrochenkovMatthias Krüger-12/+93
Issue 90702 fix: Stop treating some crate loading failures as fatal errors Surface mulitple `extern crate` resolution errors at a time. This is achieved by creating a dummy crate, instead of aborting directly after the resolution error. The `ExternCrateError` has been added to allow propagating the resolution error from `rustc_metadata` crate to the `rustc_resolve` with a minimal public surface. The `import_extern_crate` function is a block that was factored out from `build_reduced_graph_for_item` for better organization. The only added functionality made to it where the added error handling in the `process_extern_crate` call. The remaining bits in this function are the same as before. Resolves #90702 r? `@petrochenkov`
2021-12-02Rollup merge of #89234 - nbdd0121:discr, r=jackh726Matthias Krüger-13/+22
Disallow non-c-like but "fieldless" ADTs from being casted to integer if they use arbitrary enum discriminant Code like ```rust #[repr(u8)] enum Enum { Foo /* = 0 */, Bar(), Baz{} } let x = Enum::Bar() as u8; ``` seems to be unintentionally allowed so we couldn't disallow them now ~~, but we could disallow them if arbitrary enum discriminant is used before 1.56 hits stable~~ (stabilization was reverted). Related: #88621 `@rustbot` label +T-lang
2021-12-02Auto merge of #91354 - fee1-dead:const_env, r=spastorinobors-9/+9
Cleanup: Eliminate ConstnessAnd This is almost a behaviour-free change and purely a refactoring. "almost" because we appear to be using the wrong ParamEnv somewhere already, and this is now exposed by failing a test using the unstable `~const` feature. We most definitely need to review all `without_const` and at some point should probably get rid of many of them by using `TraitPredicate` instead of `TraitRef`. This is a continuation of https://github.com/rust-lang/rust/pull/90274. r? `@oli-obk` cc `@spastorino` `@ecstatic-morse`
2021-12-02Add test for legacy-const-generic argumentsGuillaume Gomez-0/+16
2021-12-02Transform const generics if the function uses rustc_legacy_const_genericsGuillaume Gomez-1/+41
2021-12-02Auto merge of #91291 - GuillaumeGomez:const-deref-method, r=camelidbors-35/+122
Fix const deref methods display Fixes https://github.com/rust-lang/rust/issues/90855 (more information in the issue). r? `@camelid`
2021-12-02Auto merge of #91003 - psumbera:sparc64-abi, r=nagisabors-1/+121
fix sparc64 ABI for aggregates with floating point members Fixes #86163
2021-12-01Determine when new comment lines are needed for itemized blocksYacin Tmimi-6/+37
Fixes 5088 Previously, rustfmt would add a new comment line anytime it reformatted an itemized block within a comment when ``wrap_comments=true``. This would lead to rustfmt adding empty comments with trailing whitespace. Now, new comment lines are only added if the original comment spanned multiple lines, if the comment needs to be wrapped, or if the comment originally started with an empty comment line.
2021-12-01Auto merge of #90446 - cjgillot:late-elided, r=jackh726bors-46/+178
Lint elided lifetimes in path during lifetime resolution. The lifetime elision lint is known to be brittle and can be redundant with later lifetime resolution errors. This PR aims to remove the redundancy by performing the lint after lifetime resolution. This PR proposes to carry the information that an elision should be linted against by using a special `LifetimeName`. I am not certain this is the best solution, but it is certainly the easiest. Fixes https://github.com/rust-lang/rust/issues/60199 Fixes https://github.com/rust-lang/rust/issues/55768 Fixes https://github.com/rust-lang/rust/issues/63110 Fixes https://github.com/rust-lang/rust/issues/71957
2021-12-01Improve suggestion for extern crate self error messageMichael-6/+41
2021-12-01Improve diagnostic for missing half of binary operator in `if` conditionFabian Wolff-1/+36
2021-12-01Stop treating extern crate loading failures as fatal errorsMichael-6/+52
2021-12-01Auto merge of #91433 - matthiaskrgr:rollup-118ql06, r=matthiaskrgrbors-25/+74
Rollup of 5 pull requests Successful merges: - #88502 (Add slice take methods) - #91313 (expand: Turn `ast::Crate` into a first class expansion target) - #91424 (Update LLVM with patches for better llvm-cov diagnostics) - #91425 (Include lint errors in error count for `-Ztreat-err-as-bug`) - #91430 (Add tests for `normalize-docs` overflow errors) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-01Disallow non-c-like but "fieldless" ADTs from being casted to integer...Gary Guo-13/+22
... if they use arbitrary enum discriminant. Code like ```rust enum Enum { Foo = 1, Bar(), Baz{} } ``` seems to be unintentionally allowed so we couldn't disallow them now, but we could disallow them if arbitrary enum discriminant is used before 1.56 hits stable.
2021-12-01Rollup merge of #91430 - jyn514:normalize-fallible, r=jackh726Matthias Krüger-13/+51
Add tests for `normalize-docs` overflow errors `@b-naber` do you understand why using `try_normalize_erasing_regions` doesn't silence these cycle errors? Rustdoc isn't emitting them, rustc is aborting before returning an error, even though the function has `try_` in the name. cc https://github.com/rust-lang/rust/issues/82692, https://github.com/rust-lang/rust/pull/91255
2021-12-01Rollup merge of #91424 - richkadel:llvm-patch-instrproferror, r=tmandryMatthias Krüger-0/+0
Update LLVM with patches for better llvm-cov diagnostics Cherry-picks https://github.com/llvm/llvm-project/commit/ee88b8d63e475a75ae525563edfa95f6fcaac83a and https://github.com/llvm/llvm-project/commit/126e7611c70ca41782aa851c2bec132607eb8127 These patches to LLVM were added to help debug occasional errors that cause coverage reporting to fail. Prior to this patch, the only messaging was that the coverage data was malformed. Hopefully the improved messaging will help identify the root cause of these errors, when they arise, so we can make corrections to coverage output from Rust. r? `@tmandry`
2021-12-01Rollup merge of #91313 - petrochenkov:cratexp, r=Aaron1011Matthias Krüger-12/+23
expand: Turn `ast::Crate` into a first class expansion target And stop creating a fake `mod` item for the crate root when expanding a crate, thus addressing FIXMEs left in https://github.com/rust-lang/rust/pull/82238, and making a step towards a proper support for crate-level macro attributes (cc #54726). I haven't added token collection support for the whole crate in this PR, maybe later. r? `@Aaron1011`
2021-12-01Use `try_normalize_erasing_regions` instead of a custom infer contextJoshua Nelson-13/+51
This unfortunately is still giving an unsilenceable overflow error :(