about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/crashes
AgeCommit message (Collapse)AuthorLines
2022-07-06fix miri-opt testsTakayuki Maeda-1/+1
2022-07-01Shorten def_span for more items.Camille GILLOT-1/+1
2022-06-07Auto merge of #95565 - jackh726:remove-borrowck-mode, r=nikomatsakisbors-13/+9
Remove migrate borrowck mode Closes #58781 Closes #43234 # Stabilization proposal This PR proposes the stabilization of `#![feature(nll)]` and the removal of `-Z borrowck`. Current borrow checking behavior of item bodies is currently done by first infering regions *lexically* and reporting any errors during HIR type checking. If there *are* any errors, then MIR borrowck (NLL) never occurs. If there *aren't* any errors, then MIR borrowck happens and any errors there would be reported. This PR removes the lexical region check of item bodies entirely and only uses MIR borrowck. Because MIR borrowck could never *not* be run for a compiled program, this should not break any programs. It does, however, change diagnostics significantly and allows a slightly larger set of programs to compile. Tracking issue: #43234 RFC: https://github.com/rust-lang/rfcs/blob/master/text/2094-nll.md Version: 1.63 (2022-06-30 => beta, 2022-08-11 => stable). ## Motivation Over time, the Rust borrow checker has become "smarter" and thus allowed more programs to compile. There have been three different implementations: AST borrowck, MIR borrowck, and polonius (well, in progress). Additionally, there is the "lexical region resolver", which (roughly) solves the constraints generated through HIR typeck. It is not a full borrow checker, but does emit some errors. The AST borrowck was the original implementation of the borrow checker and was part of the initially stabilized Rust 1.0. In mid 2017, work began to implement the current MIR borrow checker and that effort ompleted by the end of 2017, for the most part. During 2018, efforts were made to migrate away from the AST borrow checker to the MIR borrow checker - eventually culminating into "migrate" mode - where HIR typeck with lexical region resolving following by MIR borrow checking - being active by default in the 2018 edition. In early 2019, migrate mode was turned on by default in the 2015 edition as well, but with MIR borrowck errors emitted as warnings. By late 2019, these warnings were upgraded to full errors. This was followed by the complete removal of the AST borrow checker. In the period since, various errors emitted by the MIR borrow checker have been improved to the point that they are mostly the same or better than those emitted by the lexical region resolver. While there do remain some degradations in errors (tracked under the [NLL-diagnostics tag](https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3ANLL-diagnostics), those are sufficiently small and rare enough that increased flexibility of MIR borrow check-only is now a worthwhile tradeoff. ## What is stabilized As said previously, this does not fundamentally change the landscape of accepted programs. However, there are a [few](https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3ANLL-fixed-by-NLL) cases where programs can compile under `feature(nll)`, but not otherwise. There are two notable patterns that are "fixed" by this stabilization. First, the `scoped_threads` feature, which is a continutation of a pre-1.0 API, can sometimes emit a [weird lifetime error](https://github.com/rust-lang/rust/issues/95527) without NLL. Second, actually seen in the standard library. In the `Extend` impl for `HashMap`, there is an implied bound of `K: 'a` that is available with NLL on but not without - this is utilized in the impl. As mentioned before, there are a large number of diagnostic differences. Most of them are better, but some are worse. None are serious or happen often enough to need to block this PR. The biggest change is the loss of error code for a number of lifetime errors in favor of more general "lifetime may not live long enough" error. While this may *seem* bad, the former error codes were just attempts to somewhat-arbitrarily bin together lifetime errors of the same type; however, on paper, they end up being roughly the same with roughly the same kinds of solutions. ## What isn't stabilized This PR does not completely remove the lexical region resolver. In the future, it may be possible to remove that (while still keeping HIR typeck) or to remove it together with HIR typeck. ## Tests Many test outputs get updated by this PR. However, there are number of tests specifically geared towards NLL under `src/test/ui/nll` ## History * On 2017-07-14, [tracking issue opened](https://github.com/rust-lang/rust/issues/43234) * On 2017-07-20, [initial empty MIR pass added](https://github.com/rust-lang/rust/pull/43271) * On 2017-08-29, [RFC opened](https://github.com/rust-lang/rfcs/pull/2094) * On 2017-11-16, [Integrate MIR type-checker with NLL](https://github.com/rust-lang/rust/pull/45825) * On 2017-12-20, [NLL feature complete](https://github.com/rust-lang/rust/pull/46862) * On 2018-07-07, [Don't run AST borrowck on mir mode](https://github.com/rust-lang/rust/pull/52083) * On 2018-07-27, [Add migrate mode](https://github.com/rust-lang/rust/pull/52681) * On 2019-04-22, [Enable migrate mode on 2015 edition](https://github.com/rust-lang/rust/pull/59114) * On 2019-08-26, [Don't downgrade errors on 2015 edition](https://github.com/rust-lang/rust/pull/64221) * On 2019-08-27, [Remove AST borrowck](https://github.com/rust-lang/rust/pull/64790)
2022-06-04Merge commit 'd9ddce8a223cb9916389c039777b6966ea448dc8' into clippyupPhilipp Krones-0/+72
2022-06-03Fully stabilize NLLJack Huey-13/+9
2022-05-21Merge 'rust-clippy/master' into clippyupxFrednet-2/+20
2022-05-11Bless clippy.Camille GILLOT-1/+9
2022-05-05Merge commit '7c21f91b15b7604f818565646b686d90f99d1baf' into clippyupflip1995-11/+38
2022-04-08Merge commit '984330a6ee3c4d15626685d6dc8b7b759ff630bd' into clippyupflip1995-10/+6
2022-03-24update clippy stderr fileOli Scherer-0/+10
2022-03-05Do not point at whole file missing `fn main`Esteban Kuber-14/+6
Only point at the end of the crate. We could try making it point at the beginning of the crate, but that is confused with `DUMMY_SP`, causing the output to be *worse*. This change will make it so that VSCode will *not* underline the whole file when `main` is missing, so other errors will be visible.
2022-02-10Merge commit '57b3c4b90f4346b3990c1be387c3b3ca7b78412c' into clippyupflip1995-0/+28
2021-12-30Merge commit '0eff589afc83e21a03a168497bbab6b4dfbb4ef6' into clippyupflip1995-1/+1
2021-12-14Stabilize `destructuring_assignment`Jacob Pratt-13/+2
2021-12-06Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyupflip1995-0/+11
2021-11-27Only check for errors in predicate when skipping impl assemblyAaron Hill-7/+8
Prior to PR #91205, checking for errors in the overall obligation would check checking the `ParamEnv`, due to an incorrect `super_visit_with` impl. With this bug fixed, we will now bail out of impl candidate assembly if the `ParamEnv` contains any error types. In practice, this appears to be overly conservative - when an error occurs early in compilation, we end up giving up early for some predicates that we could have successfully evaluated without overflow. By only checking for errors in the predicate itself, we avoid causing additional spurious 'type annotations needed' errors after a 'real' error has already occurred. With this PR, the diagnostic changes caused by PR #91205 are reverted.
2021-11-26Auto merge of #91205 - Aaron1011:visit_param_env, r=lcnrbors-8/+7
Visit `param_env` field in Obligation's `TypeFoldable` impl This oversight appears to have gone unnoticed for a long time without causing issues, but it should still be fixed.
2021-11-25Visit `param_env` field in Obligation's `TypeFoldable` implAaron Hill-8/+7
This oversight appears to have gone unnoticed for a long time without causing issues, but it should still be fixed.
2021-11-25Fix clippy testEsteban Kuber-0/+3
2021-11-04Merge commit 'e18101137866b79045fee0ef996e696e68c920b4' into clippyupflip1995-33/+81
2021-10-15Fix clippy with changed macro statement spansCameron Steffen-1/+1
2021-10-13Update clippy ui outputOli Scherer-1/+1
2021-10-07Merge commit 'b7f3f7f6082679da2da9a0b3faf1b5adef3afd3b' into clippyupflip1995-1/+1
2021-10-02Add desugaring mark to while loopCameron Steffen-1/+0
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-6/+0
2021-08-15Introduce hir::ExprKind::Let - Take 2Caio-0/+2
2021-08-12Rollup merge of #87885 - m-ou-se:edition-guide-links, r=rylevGuillaume Gomez-3/+3
Link to edition guide instead of issues for 2021 lints. This changes the 2021 lints to not link to github issues, but to the edition guide instead. Fixes #86996
2021-08-12Bless clippy tests.Mara Bos-3/+3
2021-08-11update clippyEsteban Kuber-4/+4
2021-07-30Use multispan suggestions more oftenEsteban Küber-4/+6
* Use more accurate span for `async move` suggestion * Use more accurate span for deref suggestion * Use `multipart_suggestion` more often
2021-07-19Merge commit '4c41a222ca5d1325fb4b6709395bd06e766cc042' into clippyupflip1995-1/+38
2021-07-15Merge commit '54a20a02ecd0e1352a871aa0990bcc8b8b03173e' into clippyupflip1995-0/+13
2021-06-25Fix clippy testRyan Levick-3/+3
2021-06-03Merge commit '3ae8faff4d46ad92f194c2a4b941c3152a701b31' into clippyupflip1995-11/+26
2021-05-20Merge commit '9e3cd88718cd1912a515d26dbd9c4019fd5a9577' into clippyupflip1995-0/+10
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-1/+1
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-05-06Merge commit 'b71f3405606d49b9735606b479c3415a0ca9810f' into clippyupflip1995-0/+19
2021-05-04Auto merge of #83213 - rylev:update-lints-to-errors, r=nikomatsakisbors-0/+8
Update BARE_TRAIT_OBJECT and ELLIPSIS_INCLUSIVE_RANGE_PATTERNS to errors in Rust 2021 This addresses https://github.com/rust-lang/rust/pull/81244 by updating two lints to errors in the Rust 2021 edition. r? `@estebank`
2021-04-29Fix clippy errorRyan Levick-0/+8
2021-04-27Merge commit '7c7683c8efe447b251d6c5ca6cce51233060f6e8' into clippyupflip1995-0/+14
2021-04-22Merge commit '98e2b9f25b6db4b2680a3d388456d9f95cb28344' into clippyupflip1995-0/+19
2021-04-19fix suggestion for unsized function parameterslcnr-2/+2
2021-04-08Merge commit 'b40ea209e7f14c8193ddfc98143967b6a2f4f5c9' into clippyupflip1995-0/+17
2021-03-12Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyupflip1995-3/+78
2021-02-25Merge commit '928e72dd10749875cbd412f74bfbfd7765dbcd8a' into clippyupflip1995-0/+21
2021-01-30Merge commit '95c0459217d1661edfa794c8bb122452b92fb485' into clippyupflip1995-3/+20
2020-12-15Auto merge of #78399 - vn-ki:gsgdt-graphviz, r=oli-obkbors-3/+2
make MIR graphviz generation use gsgdt gsgdt [https://crates.io/crates/gsgdt] is a crate which provides an interface for stringly typed graphs. It also provides generation of graphviz dot format from said graph. This is the first in a series of PRs on moving graphviz code out of rustc into normal crates and then implementating graph diffing on top of these crates. r? `@oli-obk`
2020-12-05fix clippy testVishnunarayan K I-3/+2
2020-11-30Auto merge of #79329 - camelid:int-lit-suffix-error, r=davidtwcobors-2/+2
Update error to reflect that integer literals can have float suffixes For example, `1` is parsed as an integer literal, but it can be turned into a float with the suffix `f32`. Now the error calls them "numeric literals" and notes that you can add a float suffix since they can be either integers or floats.
2020-11-27Update error to reflect that integer literals can have float suffixesCamelid-2/+2
For example, `1` is parsed as an integer literal, but it can be turned into a float with the suffix `f32`. Now the error calls them "numeric literals" and notes that you can add a float suffix since they can be either integers or floats.