Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #95552

Merged
merged 15 commits into from
Apr 1, 2022
Merged

Rollup of 6 pull requests #95552

merged 15 commits into from
Apr 1, 2022

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 15 commits March 23, 2022 21:46
Before:

```
Item { name: Some("Send"), attrs: Attributes { doc_strings: [DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:15:1: 15:60 (#0), parent_module: None, doc: " Types that can be transferred across thread boundaries.", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:16:1: 16:4 (#0), parent_module: None, doc: "", kind: SugaredDoc, indent: 0 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:17:1: 17:78 (#0), parent_module: None, doc: " This trait is automatically implemented when the compiler determines it's", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:18:1: 18:17 (#0), parent_module: None, doc: " appropriate.", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:19:1: 19:4 (#0), parent_module: None, doc: "", kind: SugaredDoc, indent: 0 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:20:1: 20:70 (#0), parent_module: None, doc: " An example of a non-`Send` type is the reference-counting pointer", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:21:1: 21:85 (#0), parent_module: None, doc: " [`rc::Rc`][`Rc`]. If two threads attempt to clone [`Rc`]s that point to the same", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:22:1: 22:81 (#0), parent_module: None, doc: " reference-counted value, they might try to update the reference count at the", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:23:1: 23:83 (#0), parent_module: None, doc: " same time, which is [undefined behavior][ub] because [`Rc`] doesn't use atomic", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:24:1: 24:84 (#0), parent_module: None, doc: " operations. Its cousin [`sync::Arc`][arc] does use atomic operations (incurring", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:25:1: 25:39 (#0), parent_module: None, doc: " some overhead) and thus is `Send`.", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:26:1: 26:4 (#0), parent_module: None, doc: "", kind: SugaredDoc, indent: 0 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:27:1: 27:74 (#0), parent_module: None, doc: " See [the Nomicon](../../nomicon/send-and-sync.html) for more details.", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:28:1: 28:4 (#0), parent_module: None, doc: "", kind: SugaredDoc, indent: 0 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:29:1: 29:40 (#0), parent_module: None, doc: " [`Rc`]: ../../std/rc/struct.Rc.html", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:30:1: 30:42 (#0), parent_module: None, doc: " [arc]: ../../std/sync/struct.Arc.html", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:31:1: 31:61 (#0), parent_module: None, doc: " [ub]: ../../reference/behavior-considered-undefined.html", kind: SugaredDoc, indent: 1 }], other_attrs: [Attribute { kind: Normal(AttrItem { path: Path { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:3: 32:9 (#0), segments: [PathSegment { ident: stable#0, id: NodeId(33577), args: None }], tokens: None }, args: Delimited(DelimSpan { open: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:9: 32:10 (#0), close: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:44: 32:45 (#0) }, Parenthesis, TokenStream([(Token(Token { kind: Ident("feature", false), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:10: 32:17 (#0) }), Alone), (Token(Token { kind: Eq, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:18: 32:19 (#0) }), Alone), (Token(Token { kind: Literal(Lit { kind: Str, symbol: "rust1", suffix: None }), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:20: 32:27 (#0) }), Joint), (Token(Token { kind: Comma, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:27: 32:28 (#0) }), Alone), (Token(Token { kind: Ident("since", false), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:29: 32:34 (#0) }), Alone), (Token(Token { kind: Eq, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:35: 32:36 (#0) }), Alone), (Token(Token { kind: Literal(Lit { kind: Str, symbol: "1.0.0", suffix: None }), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:37: 32:44 (#0) }), Alone)])), tokens: None }, None), id: AttrId(48), style: Outer, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:1: 32:46 (#0) }, Attribute { kind: Normal(AttrItem { path: Path { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:33:23: 33:44 (#0), segments: [PathSegment { ident: rustc_diagnostic_item#0, id: NodeId(33578), args: None }], tokens: None }, args: Eq(/rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:33:45: 33:46 (#0), Token { kind: Literal(Lit { kind: Str, symbol: "Send", suffix: None }), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:33:47: 33:53 (#0) }), tokens: None }, None), id: AttrId(49), style: Outer, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:33:23: 33:53 (#0) }, Attribute { kind: Normal(AttrItem { path: Path { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:34:3: 34:25 (#0), segments: [PathSegment { ident: rustc_on_unimplemented#0, id: NodeId(33580), args: None }], tokens: None }, args: Delimited(DelimSpan { open: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:34:25: 34:26 (#0), close: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:37:1: 37:2 (#0) }, Parenthesis, TokenStream([(Token(Token { kind: Ident("message", false), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:35:5: 35:12 (#0) }), Alone), (Token(Token { kind: Eq, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:35:13: 35:14 (#0) }), Alone), (Token(Token { kind: Literal(Lit { kind: Str, symbol: "`{Self}` cannot be sent between threads safely", suffix: None }), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:35:15: 35:63 (#0) }), Joint), (Token(Token { kind: Comma, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:35:63: 35:64 (#0) }), Alone), (Token(Token { kind: Ident("label", false), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:36:5: 36:10 (#0) }), Alone), (Token(Token { kind: Eq, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:36:11: 36:12 (#0) }), Alone), (Token(Token { kind: Literal(Lit { kind: Str, symbol: "`{Self}` cannot be sent between threads safely", suffix: None }), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:36:13: 36:61 (#0) }), Alone)])), tokens: None }, None), id: AttrId(50), style: Outer, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:34:1: 37:3 (#0) }] }, visibility: Public, kind: TraitItem(Trait { unsafety: Unsafe, items: [], generics: Generics { params: [], where_predicates: [] }, bounds: [], is_auto: true }), def_id: DefId(DefId(2:3027 ~ core[7f4a]::marker::Send)), cfg: None }
```

After:

```
Item { name: Some("Send"), visibility: Public, def_id: DefId(DefId(2:3027 ~ core[7f4a]::marker::Send)), kind: Trait, docs: "Types that can be transferred across thread boundaries.\n\nThis trait is automatically implemented when the compiler determines it's\nappropriate.\n\nAn example of a non-`Send` type is the reference-counting pointer\n[`rc::Rc`][`Rc`]. If two threads attempt to clone [`Rc`]s that point to the same\nreference-counted value, they might try to update the reference count at the\nsame time, which is [undefined behavior][ub] because [`Rc`] doesn't use atomic\noperations. Its cousin [`sync::Arc`][arc] does use atomic operations (incurring\nsome overhead) and thus is `Send`.\n\nSee [the Nomicon](../../nomicon/send-and-sync.html) for more details.\n\n[`Rc`]: ../../std/rc/struct.Rc.html\n[arc]: ../../std/sync/struct.Arc.html\n[ub]: ../../reference/behavior-considered-undefined.html" }
```
Clean up, categorize and sort unstable features in std.
Better suggestions for `Fn`-family trait selection errors

1. Suppress suggestions to add `std::ops::Fn{,Mut,Once}` bounds when a type already implements `Fn{,Mut,Once}`
2. Add a note that points out that a type does in fact implement `Fn{,Mut,Once}`, but the arguments vary (either by number or by actual arguments)
3. Add a note that points out that a type does in fact implement `Fn{,Mut,Once}`, but not the right one (e.g. implements `FnMut`, but `Fn` is required).

Fixes rust-lang#95147
suggest wrapping single-expr blocks in square brackets

Suggests a fix in cases like:

```diff
- const A: [i32; 1] = { 1 };

+ const A: [i32; 1] = [ 1 ];
                      ^   ^
```

Also edit the message for the same suggestion in the parser (e.g. `{ 1, 2 }`).

Fixes rust-lang#95289
Make `impl Debug for rustdoc::clean::Item` easier to read

Before:

```
Item { name: Some("Send"), attrs: Attributes { doc_strings: [DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:15:1: 15:60 (#0), parent_module: None, doc: " Types that can be transferred across thread boundaries.", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:16:1: 16:4 (#0), parent_module: None, doc: "", kind: SugaredDoc, indent: 0 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:17:1: 17:78 (#0), parent_module: None, doc: " This trait is automatically implemented when the compiler determines it's", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:18:1: 18:17 (#0), parent_module: None, doc: " appropriate.", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:19:1: 19:4 (#0), parent_module: None, doc: "", kind: SugaredDoc, indent: 0 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:20:1: 20:70 (#0), parent_module: None, doc: " An example of a non-`Send` type is the reference-counting pointer", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:21:1: 21:85 (#0), parent_module: None, doc: " [`rc::Rc`][`Rc`]. If two threads attempt to clone [`Rc`]s that point to the same", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:22:1: 22:81 (#0), parent_module: None, doc: " reference-counted value, they might try to update the reference count at the", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:23:1: 23:83 (#0), parent_module: None, doc: " same time, which is [undefined behavior][ub] because [`Rc`] doesn't use atomic", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:24:1: 24:84 (#0), parent_module: None, doc: " operations. Its cousin [`sync::Arc`][arc] does use atomic operations (incurring", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:25:1: 25:39 (#0), parent_module: None, doc: " some overhead) and thus is `Send`.", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:26:1: 26:4 (#0), parent_module: None, doc: "", kind: SugaredDoc, indent: 0 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:27:1: 27:74 (#0), parent_module: None, doc: " See [the Nomicon](../../nomicon/send-and-sync.html) for more details.", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:28:1: 28:4 (#0), parent_module: None, doc: "", kind: SugaredDoc, indent: 0 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:29:1: 29:40 (#0), parent_module: None, doc: " [`Rc`]: ../../std/rc/struct.Rc.html", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:30:1: 30:42 (#0), parent_module: None, doc: " [arc]: ../../std/sync/struct.Arc.html", kind: SugaredDoc, indent: 1 }, DocFragment { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:31:1: 31:61 (#0), parent_module: None, doc: " [ub]: ../../reference/behavior-considered-undefined.html", kind: SugaredDoc, indent: 1 }], other_attrs: [Attribute { kind: Normal(AttrItem { path: Path { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:3: 32:9 (#0), segments: [PathSegment { ident: stable#0, id: NodeId(33577), args: None }], tokens: None }, args: Delimited(DelimSpan { open: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:9: 32:10 (#0), close: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:44: 32:45 (#0) }, Parenthesis, TokenStream([(Token(Token { kind: Ident("feature", false), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:10: 32:17 (#0) }), Alone), (Token(Token { kind: Eq, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:18: 32:19 (#0) }), Alone), (Token(Token { kind: Literal(Lit { kind: Str, symbol: "rust1", suffix: None }), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:20: 32:27 (#0) }), Joint), (Token(Token { kind: Comma, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:27: 32:28 (#0) }), Alone), (Token(Token { kind: Ident("since", false), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:29: 32:34 (#0) }), Alone), (Token(Token { kind: Eq, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:35: 32:36 (#0) }), Alone), (Token(Token { kind: Literal(Lit { kind: Str, symbol: "1.0.0", suffix: None }), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:37: 32:44 (#0) }), Alone)])), tokens: None }, None), id: AttrId(48), style: Outer, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:32:1: 32:46 (#0) }, Attribute { kind: Normal(AttrItem { path: Path { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:33:23: 33:44 (#0), segments: [PathSegment { ident: rustc_diagnostic_item#0, id: NodeId(33578), args: None }], tokens: None }, args: Eq(/rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:33:45: 33:46 (#0), Token { kind: Literal(Lit { kind: Str, symbol: "Send", suffix: None }), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:33:47: 33:53 (#0) }), tokens: None }, None), id: AttrId(49), style: Outer, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:33:23: 33:53 (#0) }, Attribute { kind: Normal(AttrItem { path: Path { span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:34:3: 34:25 (#0), segments: [PathSegment { ident: rustc_on_unimplemented#0, id: NodeId(33580), args: None }], tokens: None }, args: Delimited(DelimSpan { open: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:34:25: 34:26 (#0), close: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:37:1: 37:2 (#0) }, Parenthesis, TokenStream([(Token(Token { kind: Ident("message", false), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:35:5: 35:12 (#0) }), Alone), (Token(Token { kind: Eq, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:35:13: 35:14 (#0) }), Alone), (Token(Token { kind: Literal(Lit { kind: Str, symbol: "`{Self}` cannot be sent between threads safely", suffix: None }), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:35:15: 35:63 (#0) }), Joint), (Token(Token { kind: Comma, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:35:63: 35:64 (#0) }), Alone), (Token(Token { kind: Ident("label", false), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:36:5: 36:10 (#0) }), Alone), (Token(Token { kind: Eq, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:36:11: 36:12 (#0) }), Alone), (Token(Token { kind: Literal(Lit { kind: Str, symbol: "`{Self}` cannot be sent between threads safely", suffix: None }), span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:36:13: 36:61 (#0) }), Alone)])), tokens: None }, None), id: AttrId(50), style: Outer, span: /rustc/37b55c8a0cafdb60b9168da34f904acc70157df8/library/core/src/marker.rs:34:1: 37:3 (#0) }] }, visibility: Public, kind: TraitItem(Trait { unsafety: Unsafe, items: [], generics: Generics { params: [], where_predicates: [] }, bounds: [], is_auto: true }), def_id: DefId(DefId(2:3027 ~ core[7f4a]::marker::Send)), cfg: None }
```

After:

```
Item { name: Some("Send"), visibility: Public, def_id: DefId(DefId(2:3027 ~ core[7f4a]::marker::Send)), kind: Trait, docs: "Types that can be transferred across thread boundaries.\n\nThis trait is automatically implemented when the compiler determines it's\nappropriate.\n\nAn example of a non-`Send` type is the reference-counting pointer\n[`rc::Rc`][`Rc`]. If two threads attempt to clone [`Rc`]s that point to the same\nreference-counted value, they might try to update the reference count at the\nsame time, which is [undefined behavior][ub] because [`Rc`] doesn't use atomic\noperations. Its cousin [`sync::Arc`][arc] does use atomic operations (incurring\nsome overhead) and thus is `Send`.\n\nSee [the Nomicon](../../nomicon/send-and-sync.html) for more details.\n\n[`Rc`]: ../../std/rc/struct.Rc.html\n[arc]: ../../std/sync/struct.Arc.html\n[ub]: ../../reference/behavior-considered-undefined.html" }
```

The previous output is still present if you really want it for some reason by using `{:#?}` instead of `{:?}`.

r? `@camelid`
interpret: make isize::MAX the limit for dynamic value sizes

We are currently enforcing `data_layout.obj_size_bound()` as the maximal dynamic size of a Rust value (including for `size_of_val_raw`), but that does not match the docs.

In particular, Miri currently falsely says that this code has UB:
```rust
#![feature(layout_for_ptr)]
fn main() {
    let size = isize::MAX as usize;
    // Creating a raw slice of size isize::MAX and asking for its size is okay.
    let s = std::ptr::slice_from_raw_parts(1usize as *const u8, size);
    assert_eq!(size, unsafe { std::mem::size_of_val_raw(s) });
}
```
@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Apr 1, 2022
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Apr 1, 2022

📌 Commit c6750e4 has been approved by matthiaskrgr

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 1, 2022
@bors
Copy link
Contributor

bors commented Apr 1, 2022

⌛ Testing commit c6750e4 with merge dfc72a01342dcf501dfd996d1e3f036d6c09299e...

@bors
Copy link
Contributor

bors commented Apr 1, 2022

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 1, 2022
@matthiaskrgr
Copy link
Member Author

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 1, 2022
@bors
Copy link
Contributor

bors commented Apr 1, 2022

⌛ Testing commit c6750e4 with merge 9f05ab25ff78615e9eca8dbb1ec4a5e1a56d6661...

@matthiaskrgr matthiaskrgr reopened this Apr 1, 2022
@matthiaskrgr
Copy link
Member Author

@bors retry

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Apr 1, 2022

⌛ Testing commit c6750e4 with merge 297a801...

@bors
Copy link
Contributor

bors commented Apr 1, 2022

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 297a801 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 1, 2022
@bors bors merged commit 297a801 into rust-lang:master Apr 1, 2022
@rustbot rustbot added this to the 1.61.0 milestone Apr 1, 2022
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #95552!

Tested on commit 297a801.
Direct link to PR: #95552

💔 miri on windows: test-pass → test-fail (cc @eddyb @RalfJung @oli-obk).
💔 miri on linux: test-pass → test-fail (cc @eddyb @RalfJung @oli-obk).

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (297a801): comparison url.

Summary: This benchmark run did not return any relevant results.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

@matthiaskrgr matthiaskrgr deleted the rollup-bxminn9 branch July 30, 2022 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet