-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #84206 - Dylan-DPC:rollup-knl2jgq, r=Dylan-DPC
Rollup of 7 pull requests Successful merges: - #82492 (Move `std::sys_common::alloc` to new module `std::sys::common`) - #84177 (Fix join_paths error display.) - #84185 (add more pat2021 tests) - #84191 (Update books) - #84192 (Fix typos in rustc_codegen_ssa/src/back/write.rs.) - #84196 (:arrow_up: rust-analyzer) - #84201 (rustdoc: Note that forbidding anchors in links to primitives is a bug) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
21 changed files
with
153 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
library/std/src/sys_common/alloc.rs → library/std/src/sys/common/alloc.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#![allow(dead_code)] | ||
|
||
use crate::alloc::{GlobalAlloc, Layout, System}; | ||
use crate::cmp; | ||
use crate::ptr; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// This module contains code that is shared between all platforms, mostly utility or fallback code. | ||
// This explicitly does not include code that is shared between only a few platforms, | ||
// such as when reusing an implementation from `unix` or `unsupported`. | ||
// In those cases the desired code should be included directly using the #[path] attribute, | ||
// not moved to this module. | ||
// | ||
// Currently `sys_common` contains a lot of code that should live in this module, | ||
// ideally `sys_common` would only contain platform-independent abstractions on top of `sys`. | ||
// Progress on this is tracked in #84187. | ||
|
||
#![allow(dead_code)] | ||
|
||
pub mod alloc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule embedded-book
updated
10 files
+10 −10 | src/intro/install.md | |
+1 −1 | src/intro/install/macos.md | |
+3 −3 | src/intro/install/verify.md | |
+2 −2 | src/intro/install/windows.md | |
+4 −4 | src/start/exceptions.md | |
+13 −13 | src/start/hardware.md | |
+1 −1 | src/start/panicking.md | |
+1 −1 | src/start/qemu.md | |
+4 −4 | src/start/semihosting.md | |
+2 −2 | src/unsorted/speed-vs-size.md |
Submodule reference
updated
10 files
+21 −34 | STYLE.md | |
+53 −2 | src/attributes/diagnostics.md | |
+15 −8 | src/behavior-considered-undefined.md | |
+5 −1 | src/const_eval.md | |
+29 −14 | src/expressions/tuple-expr.md | |
+1 −1 | src/introduction.md | |
+17 −16 | src/items/traits.md | |
+2 −2 | src/macros-by-example.md | |
+28 −27 | src/types/pointer.md | |
+20 −21 | src/types/tuple.md |
Submodule rustc-dev-guide
updated
7 files
+12 −8 | src/backend/updating-llvm.md | |
+3 −0 | src/building/how-to-build-and-run.md | |
+1 −1 | src/generics.md | |
+14 −23 | src/method-lookup.md | |
+49 −0 | src/mir/optimizations.md | |
+5 −4 | src/rustdoc.md | |
+21 −1 | src/tests/adding.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// edition:2021 | ||
#![allow(unused_macros)] | ||
macro_rules! foo { ($x:pat | $y:pat) => {} } //~ ERROR `$x:pat` is followed by `|`, which is not allowed for `pat` fragments | ||
macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } //~ ERROR `$x:pat` is followed by `|`, which is not allowed for `pat` fragments | ||
macro_rules! qux { ($x:pat, $y:pat) => {} } // should be ok | ||
macro_rules! match_any { | ||
( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { //~ ERROR `$pat:pat` may be followed by `|`, which is not allowed for `pat` fragments | ||
match $expr { | ||
$( | ||
$( $pat => $expr_arm, )+ | ||
)+ | ||
} | ||
}; | ||
} | ||
|
||
fn main() { | ||
let result: Result<i64, i32> = Err(42); | ||
let int: i64 = match_any!(result, Ok(i) | Err(i) => i.into()); | ||
assert_eq!(int, 42); | ||
} |
26 changes: 26 additions & 0 deletions
26
src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments | ||
--> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:3:28 | ||
| | ||
LL | macro_rules! foo { ($x:pat | $y:pat) => {} } | ||
| ^ not allowed after `pat` fragments | ||
| | ||
= note: allowed there are: `=>`, `,`, `=`, `if` or `in` | ||
|
||
error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments | ||
--> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:4:32 | ||
| | ||
LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } | ||
| ^ not allowed after `pat` fragments | ||
| | ||
= note: allowed there are: `=>`, `,`, `=`, `if` or `in` | ||
|
||
error: `$pat:pat` may be followed by `|`, which is not allowed for `pat` fragments | ||
--> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:7:36 | ||
| | ||
LL | ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { | ||
| ^ not allowed after `pat` fragments | ||
| | ||
= note: allowed there are: `=>`, `,`, `=`, `if` or `in` | ||
|
||
error: aborting due to 3 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// run-pass | ||
#![allow(unused_macros)] | ||
macro_rules! foo { ($x:pat | $y:pat) => {} } // should be ok | ||
macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } // should be ok | ||
macro_rules! qux { ($x:pat, $y:pat) => {} } // should be ok | ||
macro_rules! match_any { | ||
( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { // should be ok | ||
match $expr { | ||
$( | ||
$( $pat => $expr_arm, )+ | ||
)+ | ||
} | ||
}; | ||
} | ||
|
||
fn main() { | ||
let result: Result<i64, i32> = Err(42); | ||
let int: i64 = match_any!(result, Ok(i) | Err(i) => i.into()); | ||
assert_eq!(int, 42); | ||
} |
21 changes: 21 additions & 0 deletions
21
src/test/ui/macros/macro-pat2021-pattern-followed-by-or.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#![feature(edition_macro_pats)] | ||
#![allow(unused_macros)] | ||
macro_rules! foo { ($x:pat2021 | $y:pat2021) => {} } //~ ERROR `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments | ||
macro_rules! baz { ($x:pat2015 | $y:pat2015) => {} } // should be ok | ||
macro_rules! qux { ($x:pat2015 | $y:pat2021) => {} } // should be ok | ||
macro_rules! ogg { ($x:pat2021 | $y:pat2015) => {} } //~ ERROR `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments | ||
macro_rules! match_any { | ||
( $expr:expr , $( $( $pat:pat2021 )|+ => $expr_arm:pat2021 ),+ ) => { //~ ERROR `$pat:pat2021` may be followed by `|`, which is not allowed for `pat2021` fragments | ||
match $expr { | ||
$( | ||
$( $pat => $expr_arm, )+ | ||
)+ | ||
} | ||
}; | ||
} | ||
|
||
fn main() { | ||
let result: Result<i64, i32> = Err(42); | ||
let int: i64 = match_any!(result, Ok(i) | Err(i) => i.into()); | ||
assert_eq!(int, 42); | ||
} |
26 changes: 26 additions & 0 deletions
26
src/test/ui/macros/macro-pat2021-pattern-followed-by-or.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error: `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments | ||
--> $DIR/macro-pat2021-pattern-followed-by-or.rs:3:32 | ||
| | ||
LL | macro_rules! foo { ($x:pat2021 | $y:pat2021) => {} } | ||
| ^ not allowed after `pat2021` fragments | ||
| | ||
= note: allowed there are: `=>`, `,`, `=`, `if` or `in` | ||
|
||
error: `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments | ||
--> $DIR/macro-pat2021-pattern-followed-by-or.rs:6:32 | ||
| | ||
LL | macro_rules! ogg { ($x:pat2021 | $y:pat2015) => {} } | ||
| ^ not allowed after `pat2021` fragments | ||
| | ||
= note: allowed there are: `=>`, `,`, `=`, `if` or `in` | ||
|
||
error: `$pat:pat2021` may be followed by `|`, which is not allowed for `pat2021` fragments | ||
--> $DIR/macro-pat2021-pattern-followed-by-or.rs:8:40 | ||
| | ||
LL | ( $expr:expr , $( $( $pat:pat2021 )|+ => $expr_arm:pat2021 ),+ ) => { | ||
| ^ not allowed after `pat2021` fragments | ||
| | ||
= note: allowed there are: `=>`, `,`, `=`, `if` or `in` | ||
|
||
error: aborting due to 3 previous errors | ||
|
Submodule rust-analyzer
updated
from 19e09a to 7be061