Skip to content

Commit 51ae1fe

Browse files
committed
Auto merge of #3141 - rust-lang:rustup-2023-10-25, r=RalfJung
Automatic Rustup
2 parents 9c793e1 + 19c4fa6 commit 51ae1fe

File tree

215 files changed

+3155
-1410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+3155
-1410
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4525,6 +4525,7 @@ dependencies = [
45254525
"rustc_middle",
45264526
"rustc_span",
45274527
"rustc_target",
4528+
"scoped-tls",
45284529
"stable_mir",
45294530
"tracing",
45304531
]

compiler/rustc_attr/messages.ftl

+3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ attr_invalid_repr_hint_no_paren =
5858
attr_invalid_repr_hint_no_value =
5959
invalid representation hint: `{$name}` does not take a value
6060
61+
attr_invalid_since =
62+
'since' must be a Rust version number, such as "1.31.0"
63+
6164
attr_missing_feature =
6265
missing 'feature'
6366

compiler/rustc_attr/src/builtin.rs

+36-28
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use rustc_ast::{self as ast, attr};
44
use rustc_ast::{Attribute, LitKind, MetaItem, MetaItemKind, MetaItemLit, NestedMetaItem, NodeId};
55
use rustc_ast_pretty::pprust;
6+
use rustc_errors::ErrorGuaranteed;
67
use rustc_feature::{find_gated_cfg, is_builtin_attr_name, Features, GatedCfg};
78
use rustc_macros::HashStable_Generic;
89
use rustc_session::config::ExpectedValues;
@@ -361,25 +362,32 @@ fn parse_stability(sess: &Session, attr: &Attribute) -> Option<(Symbol, Stabilit
361362
}
362363
}
363364

364-
if let Some(s) = since
365-
&& s.as_str() == VERSION_PLACEHOLDER
366-
{
367-
since = Some(rust_version_symbol());
368-
}
365+
let feature = match feature {
366+
Some(feature) if rustc_lexer::is_ident(feature.as_str()) => Ok(feature),
367+
Some(_bad_feature) => {
368+
Err(sess.emit_err(session_diagnostics::NonIdentFeature { span: attr.span }))
369+
}
370+
None => Err(sess.emit_err(session_diagnostics::MissingFeature { span: attr.span })),
371+
};
372+
373+
let since = if let Some(since) = since {
374+
if since.as_str() == VERSION_PLACEHOLDER {
375+
Ok(rust_version_symbol())
376+
} else if parse_version(since.as_str(), false).is_some() {
377+
Ok(since)
378+
} else {
379+
Err(sess.emit_err(session_diagnostics::InvalidSince { span: attr.span }))
380+
}
381+
} else {
382+
Err(sess.emit_err(session_diagnostics::MissingSince { span: attr.span }))
383+
};
369384

370385
match (feature, since) {
371-
(Some(feature), Some(since)) => {
386+
(Ok(feature), Ok(since)) => {
372387
let level = StabilityLevel::Stable { since, allowed_through_unstable_modules: false };
373388
Some((feature, level))
374389
}
375-
(None, _) => {
376-
sess.emit_err(session_diagnostics::MissingFeature { span: attr.span });
377-
None
378-
}
379-
_ => {
380-
sess.emit_err(session_diagnostics::MissingSince { span: attr.span });
381-
None
382-
}
390+
(Err(ErrorGuaranteed { .. }), _) | (_, Err(ErrorGuaranteed { .. })) => None,
383391
}
384392
}
385393

@@ -451,12 +459,19 @@ fn parse_unstability(sess: &Session, attr: &Attribute) -> Option<(Symbol, Stabil
451459
}
452460
}
453461

454-
match (feature, reason, issue) {
455-
(Some(feature), reason, Some(_)) => {
456-
if !rustc_lexer::is_ident(feature.as_str()) {
457-
sess.emit_err(session_diagnostics::NonIdentFeature { span: attr.span });
458-
return None;
459-
}
462+
let feature = match feature {
463+
Some(feature) if rustc_lexer::is_ident(feature.as_str()) => Ok(feature),
464+
Some(_bad_feature) => {
465+
Err(sess.emit_err(session_diagnostics::NonIdentFeature { span: attr.span }))
466+
}
467+
None => Err(sess.emit_err(session_diagnostics::MissingFeature { span: attr.span })),
468+
};
469+
470+
let issue =
471+
issue.ok_or_else(|| sess.emit_err(session_diagnostics::MissingIssue { span: attr.span }));
472+
473+
match (feature, issue) {
474+
(Ok(feature), Ok(_)) => {
460475
let level = StabilityLevel::Unstable {
461476
reason: UnstableReason::from_opt_reason(reason),
462477
issue: issue_num,
@@ -465,14 +480,7 @@ fn parse_unstability(sess: &Session, attr: &Attribute) -> Option<(Symbol, Stabil
465480
};
466481
Some((feature, level))
467482
}
468-
(None, _, _) => {
469-
sess.emit_err(session_diagnostics::MissingFeature { span: attr.span });
470-
return None;
471-
}
472-
_ => {
473-
sess.emit_err(session_diagnostics::MissingIssue { span: attr.span });
474-
return None;
475-
}
483+
(Err(ErrorGuaranteed { .. }), _) | (_, Err(ErrorGuaranteed { .. })) => None,
476484
}
477485
}
478486

compiler/rustc_attr/src/session_diagnostics.rs

+7
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,13 @@ pub(crate) struct ExpectsFeatures {
370370
pub name: String,
371371
}
372372

373+
#[derive(Diagnostic)]
374+
#[diag(attr_invalid_since)]
375+
pub(crate) struct InvalidSince {
376+
#[primary_span]
377+
pub span: Span,
378+
}
379+
373380
#[derive(Diagnostic)]
374381
#[diag(attr_soft_no_args)]
375382
pub(crate) struct SoftNoArgs {

compiler/rustc_borrowck/src/renumber.rs

+4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ impl<'a, 'tcx> MutVisitor<'tcx> for RegionRenumberer<'a, 'tcx> {
8181

8282
#[instrument(skip(self), level = "debug")]
8383
fn visit_ty(&mut self, ty: &mut Ty<'tcx>, ty_context: TyContext) {
84+
if matches!(ty_context, TyContext::ReturnTy(_)) {
85+
// We will renumber the return ty when called again with `TyContext::LocalDecl`
86+
return;
87+
}
8488
*ty = self.renumber_regions(*ty, || RegionCtxt::TyContext(ty_context));
8589

8690
debug!(?ty);

compiler/rustc_codegen_cranelift/.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
]
3434
},
3535
{
36-
"sysroot_src": "./download/sysroot/sysroot_src/library",
36+
"sysroot_src": "./build/stdlib/library",
3737
"crates": [
3838
{
3939
"root_module": "./example/std_example.rs",

compiler/rustc_codegen_cranelift/Cargo.lock

+26-26
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
4545

4646
[[package]]
4747
name = "cranelift-bforest"
48-
version = "0.101.0"
48+
version = "0.101.1"
4949
source = "registry+https://github.com/rust-lang/crates.io-index"
50-
checksum = "8e5e1df0da8488dd03b34afc134ba84b754d61862cc465932a9e5d07952f661e"
50+
checksum = "c1512c3bb6b13018e7109fc3ac964bc87b329eaf3a77825d337558d0c7f6f1be"
5151
dependencies = [
5252
"cranelift-entity",
5353
]
5454

5555
[[package]]
5656
name = "cranelift-codegen"
57-
version = "0.101.0"
57+
version = "0.101.1"
5858
source = "registry+https://github.com/rust-lang/crates.io-index"
59-
checksum = "77a17ca4e699a0aaf49a0c88f6311a864f321048aa63f6b787cab20eb5f93f10"
59+
checksum = "16cb8fb9220a6ea7a226705a273ab905309ee546267bdf34948d57932d7f0396"
6060
dependencies = [
6161
"bumpalo",
6262
"cranelift-bforest",
@@ -75,39 +75,39 @@ dependencies = [
7575

7676
[[package]]
7777
name = "cranelift-codegen-meta"
78-
version = "0.101.0"
78+
version = "0.101.1"
7979
source = "registry+https://github.com/rust-lang/crates.io-index"
80-
checksum = "022f2793cdade1d37a1f755ac42938a3f832f533eac6cafc8b26b209544c3c06"
80+
checksum = "ab3a8d3b0d4745b183da5ea0792b13d79f5c23d6e69ac04761728e2532b56649"
8181
dependencies = [
8282
"cranelift-codegen-shared",
8383
]
8484

8585
[[package]]
8686
name = "cranelift-codegen-shared"
87-
version = "0.101.0"
87+
version = "0.101.1"
8888
source = "registry+https://github.com/rust-lang/crates.io-index"
89-
checksum = "a4d72dbb83c2ad788dec4ad0843070973cb48c35a3ca19b1e7437ac40834fd9c"
89+
checksum = "524141c8e68f2abc2043de4c2b31f6d9dd42432738c246431d0572a1422a4a84"
9090

9191
[[package]]
9292
name = "cranelift-control"
93-
version = "0.101.0"
93+
version = "0.101.1"
9494
source = "registry+https://github.com/rust-lang/crates.io-index"
95-
checksum = "ae07cf26dcc90d546826d747ac63b6c40c916f34b03e92a6ae0422c28d771b8a"
95+
checksum = "97513b57c961c713789a03886a57b43e14ebcd204cbaa8ae50ca6c70a8e716b3"
9696
dependencies = [
9797
"arbitrary",
9898
]
9999

100100
[[package]]
101101
name = "cranelift-entity"
102-
version = "0.101.0"
102+
version = "0.101.1"
103103
source = "registry+https://github.com/rust-lang/crates.io-index"
104-
checksum = "c2fe6b7e49820893691aea497f36257e9d6f52061d8c4758d61d802d5f101a3d"
104+
checksum = "e3f23d3cf3afa7e45f239702612c76d87964f652a55e28d13ed6d7e20f3479dd"
105105

106106
[[package]]
107107
name = "cranelift-frontend"
108-
version = "0.101.0"
108+
version = "0.101.1"
109109
source = "registry+https://github.com/rust-lang/crates.io-index"
110-
checksum = "44f497576ca3674581581601b6a55ccc1b43447217648c880e5bce70db3cf659"
110+
checksum = "554cd4947ec9209b58bf9ae5bf83581b5ddf9128bd967208e334b504a57db54e"
111111
dependencies = [
112112
"cranelift-codegen",
113113
"log",
@@ -117,15 +117,15 @@ dependencies = [
117117

118118
[[package]]
119119
name = "cranelift-isle"
120-
version = "0.101.0"
120+
version = "0.101.1"
121121
source = "registry+https://github.com/rust-lang/crates.io-index"
122-
checksum = "b96aa02eac00fffee13b0cd37d17874ccdb3d5458983041accd825ef78ce6454"
122+
checksum = "6c1892a439696b6413cb54083806f5fd9fc431768b8de74864b3d9e8b93b124f"
123123

124124
[[package]]
125125
name = "cranelift-jit"
126-
version = "0.101.0"
126+
version = "0.101.1"
127127
source = "registry+https://github.com/rust-lang/crates.io-index"
128-
checksum = "b1d6e0e308c873eefc185745a6b21daec2a10f7554c9fb67e334c2d7d756d979"
128+
checksum = "32209252fb38acaf1662ccd0397907bbe0e92bdb13b6ddbfd2f74e437f83e685"
129129
dependencies = [
130130
"anyhow",
131131
"cranelift-codegen",
@@ -143,9 +143,9 @@ dependencies = [
143143

144144
[[package]]
145145
name = "cranelift-module"
146-
version = "0.101.0"
146+
version = "0.101.1"
147147
source = "registry+https://github.com/rust-lang/crates.io-index"
148-
checksum = "c1aa8ebb06eced4e478c3f94f1d65d4e7c93493f4640057912b27a3e34b84841"
148+
checksum = "bf42656f5f6df7bfafc4dd7b63a1888b0627c07b43b2cb9aa54e13843fed39eb"
149149
dependencies = [
150150
"anyhow",
151151
"cranelift-codegen",
@@ -154,9 +154,9 @@ dependencies = [
154154

155155
[[package]]
156156
name = "cranelift-native"
157-
version = "0.101.0"
157+
version = "0.101.1"
158158
source = "registry+https://github.com/rust-lang/crates.io-index"
159-
checksum = "2870170ca44054b202c737626607b87be6e35655084bd94a6ff807a5812ba7df"
159+
checksum = "e0c2d3badd4b9690865f5bb68a71fa94de592fa2df3f3d11a5a062c60c0a107a"
160160
dependencies = [
161161
"cranelift-codegen",
162162
"libc",
@@ -165,9 +165,9 @@ dependencies = [
165165

166166
[[package]]
167167
name = "cranelift-object"
168-
version = "0.101.0"
168+
version = "0.101.1"
169169
source = "registry+https://github.com/rust-lang/crates.io-index"
170-
checksum = "20647761742d17dabac8205da958910ede78599550e06418a16711a3ee2fc897"
170+
checksum = "88eca54bbecea3170035168357306e9c779d4a63d8bf036c9e16bd21fdaa69b5"
171171
dependencies = [
172172
"anyhow",
173173
"cranelift-codegen",
@@ -374,9 +374,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
374374

375375
[[package]]
376376
name = "wasmtime-jit-icache-coherence"
377-
version = "14.0.0"
377+
version = "14.0.1"
378378
source = "registry+https://github.com/rust-lang/crates.io-index"
379-
checksum = "a3a5dda53ad6993f9b0a2d65fb49e0348a7232a27a8794064122870d6ee19eb2"
379+
checksum = "9aaf2fa8fd2d6b65abae9b92edfe69254cc5d6b166e342364036c3e347de8da9"
380380
dependencies = [
381381
"cfg-if",
382382
"libc",

compiler/rustc_codegen_cranelift/Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ crate-type = ["dylib"]
88

99
[dependencies]
1010
# These have to be in sync with each other
11-
cranelift-codegen = { version = "0.101", features = ["unwind", "all-arch"] }
12-
cranelift-frontend = { version = "0.101" }
13-
cranelift-module = { version = "0.101" }
14-
cranelift-native = { version = "0.101" }
15-
cranelift-jit = { version = "0.101", optional = true }
16-
cranelift-object = { version = "0.101" }
11+
cranelift-codegen = { version = "0.101.1", features = ["unwind", "all-arch"] }
12+
cranelift-frontend = { version = "0.101.1" }
13+
cranelift-module = { version = "0.101.1" }
14+
cranelift-native = { version = "0.101.1" }
15+
cranelift-jit = { version = "0.101.1", optional = true }
16+
cranelift-object = { version = "0.101.1" }
1717
target-lexicon = "0.12.0"
1818
gimli = { version = "0.28", default-features = false, features = ["write"]}
1919
object = { version = "0.32", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }

compiler/rustc_codegen_cranelift/Readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ If not please open an issue.
88
## Building and testing
99

1010
```bash
11-
$ git clone https://github.com/bjorn3/rustc_codegen_cranelift
11+
$ git clone https://github.com/rust-lang/rustc_codegen_cranelift
1212
$ cd rustc_codegen_cranelift
1313
$ ./y.sh prepare
1414
$ ./y.sh build
@@ -29,7 +29,7 @@ Extract the `dist` directory in the archive anywhere you want.
2929
If you want to use `cargo clif build` instead of having to specify the full path to the `cargo-clif` executable, you can add the `bin` subdirectory of the extracted `dist` directory to your `PATH`.
3030
(tutorial [for Windows](https://stackoverflow.com/a/44272417), and [for Linux/MacOS](https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path/26059#26059)).
3131

32-
[releases]: https://github.com/bjorn3/rustc_codegen_cranelift/releases/tag/dev
32+
[releases]: https://github.com/rust-lang/rustc_codegen_cranelift/releases/tag/dev
3333

3434
## Usage
3535

@@ -78,7 +78,7 @@ configuration options.
7878

7979
* Inline assembly ([no cranelift support](https://github.com/bytecodealliance/wasmtime/issues/1041))
8080
* On UNIX there is support for invoking an external assembler for `global_asm!` and `asm!`.
81-
* SIMD ([tracked here](https://github.com/bjorn3/rustc_codegen_cranelift/issues/171), `std::simd` fully works, `std::arch` is partially supported)
81+
* SIMD ([tracked here](https://github.com/rust-lang/rustc_codegen_cranelift/issues/171), `std::simd` fully works, `std::arch` is partially supported)
8282
* Unwinding on panics ([no cranelift support](https://github.com/bytecodealliance/wasmtime/issues/1677), `-Cpanic=abort` is enabled by default)
8383

8484
## License

compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs

+11
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,17 @@ fn main() {
353353

354354
let f = V([0.0, 1.0]);
355355
let _a = f.0[0];
356+
357+
stack_val_align();
358+
}
359+
360+
#[inline(never)]
361+
fn stack_val_align() {
362+
#[repr(align(8192))]
363+
struct Foo(u8);
364+
365+
let a = Foo(0);
366+
assert_eq!(&a as *const Foo as usize % 8192, 0);
356367
}
357368

358369
#[cfg(all(

compiler/rustc_codegen_cranelift/patches/0001-regex-Ignore-test-which-gets-miscompiled-with-llvm-sysroot.patch

-25
This file was deleted.

0 commit comments

Comments
 (0)