Skip to content

Commit 905ddf8

Browse files
authored
Rollup merge of #137728 - Darksonn:no-tuple-unsize, r=oli-obk
Remove unsizing coercions for tuples See rust-lang/rust#42877 (comment) and below comments for justification. Tracking issue: #42877 Fixes: #135217
2 parents c8011e1 + 4d0c1ee commit 905ddf8

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

crates/ide-db/src/generated/lints.rs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12311,40 +12311,6 @@ fn main() {
1231112311
```
1231212312

1231312313
will unnecessarily extend the stack frame.
12314-
"##,
12315-
default_severity: Severity::Allow,
12316-
warn_since: None,
12317-
deny_since: None,
12318-
},
12319-
Lint {
12320-
label: "unsized_tuple_coercion",
12321-
description: r##"# `unsized_tuple_coercion`
12322-
12323-
The tracking issue for this feature is: [#42877]
12324-
12325-
[#42877]: https://github.com/rust-lang/rust/issues/42877
12326-
12327-
------------------------
12328-
12329-
This is a part of [RFC0401]. According to the RFC, there should be an implementation like this:
12330-
12331-
```rust,ignore (partial-example)
12332-
impl<..., T, U: ?Sized> Unsized<(..., U)> for (..., T) where T: Unsized<U> {}
12333-
```
12334-
12335-
This implementation is currently gated behind `#[feature(unsized_tuple_coercion)]` to avoid insta-stability. Therefore you can use it like this:
12336-
12337-
```rust
12338-
#![feature(unsized_tuple_coercion)]
12339-
12340-
fn main() {
12341-
let x : ([i32; 3], [i32; 3]) = ([1, 2, 3], [4, 5, 6]);
12342-
let y : &([i32; 3], [i32]) = &x;
12343-
assert_eq!(y.1[0], 4);
12344-
}
12345-
```
12346-
12347-
[RFC0401]: https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
1234812314
"##,
1234912315
default_severity: Severity::Allow,
1235012316
warn_since: None,

0 commit comments

Comments
 (0)