-
Notifications
You must be signed in to change notification settings - Fork 38
document Rust 1.90 changes #580
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
base: main
Are you sure you want to change the base?
Changes from all commits
6cecf63
f669cc9
b874b5d
a9fdd2d
af19a30
47ce8fd
00c1bfd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -370,6 +370,12 @@ When a :t:`path pattern` refers to an :t:`associated constant` or a | |
| :t:`constant`, the :t:`type` of the :t:`associated constant` or :t:`constant` | ||
| shall be :t:`structurally equal`. | ||
|
|
||
| :dp:`fls_wJ9f906BlBvg` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding some traceability here to the Reference PR portion which means the FLS need be updated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is meant by "need be updated" |
||
| When a :t:`path pattern` refers to an :t:`associated constant` or a | ||
| :t:`constant`, the :t:`constant` must not contain any references to | ||
| :t:`[mutable static]s`, :t:`[static]s` with :t:`interior mutability`, | ||
| or :t:`[external static]s`. | ||
|
|
||
| :dp:`fls_hF19K8sWU8FF` | ||
| When the type of the :t:`path pattern` is of an :t:`enum type` or | ||
| :t:`struct type`, then the :t:`enum type` or :t:`struct type` shall be subject | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,6 +95,9 @@ The :t:`type specification` of a :t:`constant` shall have ``'static`` | |
| The :t:`type` of a :t:`constant` shall implement the :std:`core::marker::Sized` | ||
| :t:`trait`. | ||
|
|
||
| :dp:`fls_ooOYxhVh8hZo` | ||
| The type of a :t:`constant` cannot be a :t:`mutable reference type`. | ||
|
|
||
|
Comment on lines
+98
to
+100
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two things. One, even with the other rule, this needs to talk about containing a mutable reference rather than being one. Two, it's not enough to talk about types here. We actually do this reasoning by value, not by type. trait Tr {}
impl<T: ?Sized> Tr for T {}
static mut X: u8 = 0;
const _: &dyn Tr = unsafe { &&mut X }; //~ ERROR
// ^^^^^^^
// This type does not contain any mutable references. |
||
| :dp:`fls_ndmfqxjpvsqy` | ||
| A :t:`constant initializer` is a :t:`construct` that provides the :t:`value` of | ||
| its related :t:`constant`. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| .. SPDX-License-Identifier: MIT OR Apache-2.0 | ||
| SPDX-FileCopyrightText: The Ferrocene Developers | ||
| SPDX-FileCopyrightText: The Rust Project Developers | ||
| .. |spec_version| replace:: 1.88.0 | ||
| .. |spec_version| replace:: 1.90.0 |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things. One, it's OK for the expression to be subject to drop scope extension. It's not OK for that extension to extend the scope outside of the initializer to the end of the program.
Two, the comma in "..., and which are either..." causes me to read it as a clause independent from "except...". I.e., this says (applying commutativity) "all forms of borrows 1) that are either mutable or result in values with interior mutability and 2) where the expression would not be subject to drop scope extension".