ruff/crates
David Peter c6ce52c29e
[red-knot] Treat empty intersection as 'object', fix intersection simplification (#13880)
## Summary

- Properly treat the empty intersection as being of type `object`.
- Consequently, change the simplification method to explicitly add
`Never` to the positive side of the intersection when collapsing a type
such as `int & str` to `Never`, as opposed to just clearing both the
positive and the negative side.
- Minor code improvement in `bindings_ty`: use `peekable()` to check
whether the iterator over constraints is empty, instead of handling
first and subsequent elements separately.

fixes #13870

## Test Plan

- New unit tests for `IntersectionBuilder` to make sure the empty
intersection represents `object`.
- Markdown-based regression test for the original issue in #13870
2024-10-22 21:02:46 +02:00
..
red_knot Upgrade salsa (#13757) 2024-10-15 11:06:32 +00:00
red_knot_python_semantic [red-knot] Treat empty intersection as 'object', fix intersection simplification (#13880) 2024-10-22 21:02:46 +02:00
red_knot_server Upgrade to Rust 1.82 (#13816) 2024-10-19 16:05:50 +02:00
red_knot_test [red-knot] Report line numbers in mdtest relative to the markdown file, not the test snippet (#13804) 2024-10-22 07:42:40 +00:00
red_knot_vendored Modernize build scripts (#13837) 2024-10-20 22:35:35 +01:00
red_knot_wasm Use backticks for code in red-knot messages (#13599) 2024-10-02 03:14:28 +00:00
red_knot_workspace [red-knot] Infer target types for unpacked tuple assignment (#13316) 2024-10-15 19:07:11 +00:00
ruff Modernize build scripts (#13837) 2024-10-20 22:35:35 +01:00
ruff_benchmark Bump MSRV to Rust 1.80 (#13826) 2024-10-20 10:55:36 +02:00
ruff_cache Fix cache key collisions for paths with separators (#12159) 2024-07-03 07:36:46 -05:00
ruff_db Speed up mdtests (#13832) 2024-10-21 20:06:41 +01:00
ruff_dev Harmonise methods for distinguishing different Python source types (#13682) 2024-10-09 13:18:52 +00:00
ruff_diagnostics [Minor typo] Fix article in "an fix" (#12797) 2024-08-10 21:22:00 -04:00
ruff_formatter Use backticks for code in red-knot messages (#13599) 2024-10-02 03:14:28 +00:00
ruff_graph Bump MSRV to Rust 1.80 (#13826) 2024-10-20 10:55:36 +02:00
ruff_index [red-knot] small efficiency improvements and bugfixes to use-def map building (#12373) 2024-07-18 09:24:58 -07:00
ruff_linter Fix D204's documentation to correctly mention the conventions when it is enabled (#13867) 2024-10-22 16:51:57 +02:00
ruff_macros Upgrade to Rust 1.82 (#13816) 2024-10-19 16:05:50 +02:00
ruff_notebook Bump MSRV to Rust 1.80 (#13826) 2024-10-20 10:55:36 +02:00
ruff_python_ast Simplify iteration idioms (#13834) 2024-10-20 22:25:27 +01:00
ruff_python_ast_integration_tests [internal] ComparableExpr (f)strings and bytes made invariant under concatenation (#13301) 2024-09-25 16:58:57 +02:00
ruff_python_codegen Simplify iteration idioms (#13834) 2024-10-20 22:25:27 +01:00
ruff_python_formatter formatter: Introduce QuoteMetadata (#13858) 2024-10-21 20:23:46 +01:00
ruff_python_index Enable token-based rules on source with syntax errors (#11950) 2024-07-02 08:57:46 +00:00
ruff_python_literal Remove some unused pub functions (#11576) 2024-05-28 09:56:51 -04:00
ruff_python_parser Short circuit lex_identifier if the name is longer or shorter than any known keyword (#13815) 2024-10-19 11:07:15 +00:00
ruff_python_resolver chore(deps): update rust crate insta to v1.38.0 (#10701) 2024-04-01 15:44:30 +00:00
ruff_python_semantic Simplify iteration idioms (#13834) 2024-10-20 22:25:27 +01:00
ruff_python_stdlib Harmonise methods for distinguishing different Python source types (#13682) 2024-10-09 13:18:52 +00:00
ruff_python_trivia [red-knot] Report line numbers in mdtest relative to the markdown file, not the test snippet (#13804) 2024-10-22 07:42:40 +00:00
ruff_python_trivia_integration_tests Build CommentRanges outside the parser (#11792) 2024-06-09 09:55:17 +00:00
ruff_server Upgrade to Rust 1.82 (#13816) 2024-10-19 16:05:50 +02:00
ruff_source_file [red-knot] Report line numbers in mdtest relative to the markdown file, not the test snippet (#13804) 2024-10-22 07:42:40 +00:00
ruff_text_size [red-knot] type inference/checking test framework (#13636) 2024-10-08 12:33:19 -07:00
ruff_wasm Changelog for Ruff v0.7 (#13794) 2024-10-17 16:14:21 +00:00
ruff_workspace Simplify iteration idioms (#13834) 2024-10-20 22:25:27 +01:00