Skip to content

Commit 085bdc2

Browse files
committed
Auto merge of #145719 - cuviper:beta-next, r=cuviper
[beta] backports - Gate const trait syntax #144956 - Demote x86_64-apple-darwin to Tier 2 with host tools #145252 - Do not use effective_visibilities query for Adt types of a local trait while proving a where-clause #145642 r? cuviper
2 parents 49fc0cc + f0f182d commit 085bdc2

File tree

11 files changed

+83
-38
lines changed

11 files changed

+83
-38
lines changed

compiler/rustc_parse/src/parser/item.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,9 @@ impl<'a> Parser<'a> {
885885
/// Parses `unsafe? auto? trait Foo { ... }` or `trait Foo = Bar;`.
886886
fn parse_item_trait(&mut self, attrs: &mut AttrVec, lo: Span) -> PResult<'a, ItemKind> {
887887
let constness = self.parse_constness(Case::Sensitive);
888+
if let Const::Yes(span) = constness {
889+
self.psess.gated_spans.gate(sym::const_trait_impl, span);
890+
}
888891
let safety = self.parse_safety(Case::Sensitive);
889892
// Parse optional `auto` prefix.
890893
let is_auto = if self.eat_keyword(exp!(Auto)) {

compiler/rustc_target/src/spec/targets/x86_64_apple_darwin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub(crate) fn target() -> Target {
77
llvm_target,
88
metadata: TargetMetadata {
99
description: Some("x86_64 Apple macOS (10.12+, Sierra+)".into()),
10-
tier: Some(1),
10+
tier: Some(2),
1111
host_tools: Some(true),
1212
std: Some(true),
1313
},

compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2876,7 +2876,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
28762876
// we check if `TraitB` can be reachable from `S`
28772877
// to determine whether to note `TraitA` is sealed trait.
28782878
if let ty::Adt(adt, _) = ty.kind() {
2879-
let visibilities = tcx.effective_visibilities(());
2879+
let visibilities = &tcx.resolutions(()).effective_visibilities;
28802880
visibilities.effective_vis(local).is_none_or(|v| {
28812881
v.at_level(Level::Reexported)
28822882
.is_accessible_from(adt.did(), tcx)

src/ci/github-actions/jobs.yml

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ runners:
2323
<<: *base-job
2424

2525
- &job-macos
26-
os: macos-13
27-
<<: *base-job
28-
29-
- &job-macos-m1
3026
os: macos-14
3127
<<: *base-job
3228

@@ -68,17 +64,6 @@ runners:
6864
<<: *base-job
6965

7066
envs:
71-
env-x86_64-apple-tests: &env-x86_64-apple-tests
72-
SCRIPT: ./x.py check compiletest --set build.compiletest-use-stage0-libtest=true && ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc -- --exact
73-
RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc
74-
# Ensure that host tooling is tested on our minimum supported macOS version.
75-
MACOSX_DEPLOYMENT_TARGET: 10.12
76-
MACOSX_STD_DEPLOYMENT_TARGET: 10.12
77-
SELECT_XCODE: /Applications/Xcode_15.2.app
78-
NO_LLVM_ASSERTIONS: 1
79-
NO_DEBUG_ASSERTIONS: 1
80-
NO_OVERFLOW_CHECKS: 1
81-
8267
production:
8368
&production
8469
DEPLOY_BUCKET: rust-lang-ci2
@@ -449,8 +434,19 @@ auto:
449434

450435
- name: dist-x86_64-apple
451436
env:
452-
SCRIPT: ./x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin
453-
RUST_CONFIGURE_ARGS: --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set rust.lto=thin --set rust.codegen-units=1
437+
SCRIPT: >-
438+
./x.py dist bootstrap
439+
--include-default-paths
440+
--host=x86_64-apple-darwin
441+
--target=x86_64-apple-darwin
442+
RUST_CONFIGURE_ARGS: >-
443+
--enable-full-tools
444+
--enable-sanitizers
445+
--enable-profiler
446+
--disable-docs
447+
--set rust.jemalloc
448+
--set rust.lto=thin
449+
--set rust.codegen-units=1
454450
# Ensure that host tooling is built to support our minimum support macOS version.
455451
MACOSX_DEPLOYMENT_TARGET: 10.12
456452
MACOSX_STD_DEPLOYMENT_TARGET: 10.12
@@ -476,17 +472,6 @@ auto:
476472
NO_LLVM_ASSERTIONS: 1
477473
NO_DEBUG_ASSERTIONS: 1
478474
NO_OVERFLOW_CHECKS: 1
479-
<<: *job-macos-m1
480-
481-
- name: x86_64-apple-1
482-
env:
483-
<<: *env-x86_64-apple-tests
484-
<<: *job-macos
485-
486-
- name: x86_64-apple-2
487-
env:
488-
SCRIPT: ./x.py --stage 2 test tests/ui tests/rustdoc
489-
<<: *env-x86_64-apple-tests
490475
<<: *job-macos
491476

492477
- name: dist-aarch64-apple
@@ -511,7 +496,7 @@ auto:
511496
NO_OVERFLOW_CHECKS: 1
512497
DIST_REQUIRE_ALL_TOOLS: 1
513498
CODEGEN_BACKENDS: llvm,cranelift
514-
<<: *job-macos-m1
499+
<<: *job-macos
515500

516501
- name: aarch64-apple
517502
env:
@@ -531,7 +516,7 @@ auto:
531516
NO_LLVM_ASSERTIONS: 1
532517
NO_DEBUG_ASSERTIONS: 1
533518
NO_OVERFLOW_CHECKS: 1
534-
<<: *job-macos-m1
519+
<<: *job-macos
535520

536521
######################
537522
# Windows Builders #

src/doc/rustc/src/platform-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ target | notes
3636
`aarch64-unknown-linux-gnu` | ARM64 Linux (kernel 4.1+, glibc 2.17+)
3737
[`i686-pc-windows-msvc`](platform-support/windows-msvc.md) | 32-bit MSVC (Windows 10+, Windows Server 2016+, Pentium 4) [^x86_32-floats-return-ABI] [^win32-msvc-alignment]
3838
`i686-unknown-linux-gnu` | 32-bit Linux (kernel 3.2+, glibc 2.17+, Pentium 4) [^x86_32-floats-return-ABI]
39-
[`x86_64-apple-darwin`](platform-support/apple-darwin.md) | 64-bit macOS (10.12+, Sierra+)
4039
[`x86_64-pc-windows-gnu`](platform-support/windows-gnu.md) | 64-bit MinGW (Windows 10+, Windows Server 2016+)
4140
[`x86_64-pc-windows-msvc`](platform-support/windows-msvc.md) | 64-bit MSVC (Windows 10+, Windows Server 2016+)
4241
`x86_64-unknown-linux-gnu` | 64-bit Linux (kernel 3.2+, glibc 2.17+)
@@ -105,6 +104,7 @@ target | notes
105104
[`riscv64gc-unknown-linux-gnu`](platform-support/riscv64gc-unknown-linux-gnu.md) | RISC-V Linux (kernel 4.20+, glibc 2.29)
106105
[`riscv64gc-unknown-linux-musl`](platform-support/riscv64gc-unknown-linux-musl.md) | RISC-V Linux (kernel 4.20+, musl 1.2.3)
107106
[`s390x-unknown-linux-gnu`](platform-support/s390x-unknown-linux-gnu.md) | S390x Linux (kernel 3.2+, glibc 2.17)
107+
[`x86_64-apple-darwin`](platform-support/apple-darwin.md) | 64-bit macOS (10.12+, Sierra+)
108108
[`x86_64-unknown-freebsd`](platform-support/freebsd.md) | 64-bit x86 FreeBSD
109109
[`x86_64-unknown-illumos`](platform-support/illumos.md) | illumos
110110
`x86_64-unknown-linux-musl` | 64-bit Linux with musl 1.2.3

src/doc/rustc/src/platform-support/apple-darwin.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ Apple macOS targets.
44

55
**Tier: 1**
66

7-
- `x86_64-apple-darwin`: macOS on 64-bit x86.
87
- `aarch64-apple-darwin`: macOS on ARM64 (M1-family or later Apple Silicon CPUs).
98

9+
**Tier: 2**
10+
11+
- `x86_64-apple-darwin`: macOS on 64-bit x86.
12+
1013
## Target maintainers
1114

1215
[@thomcc](https://github.com/thomcc)

src/tools/build-manifest/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static TARGETS: &[&str] = &[
203203
///
204204
/// The order here matters, more specific entries should be first.
205205
static DOCS_FALLBACK: &[(&str, &str)] = &[
206-
("-apple-", "x86_64-apple-darwin"),
206+
("-apple-", "aarch64-apple-darwin"),
207207
("aarch64", "aarch64-unknown-linux-gnu"),
208208
("arm-", "aarch64-unknown-linux-gnu"),
209209
("", "x86_64-unknown-linux-gnu"),
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// This test is for regression of issue #145611
2+
// There should not be cycle error in effective_visibilities query.
3+
4+
trait LocalTrait {}
5+
struct SomeType;
6+
fn impls_trait<T: LocalTrait>() {}
7+
fn foo() -> impl Sized {
8+
impls_trait::<SomeType>(); //~ ERROR the trait bound `SomeType: LocalTrait` is not satisfied [E0277]
9+
}
10+
11+
fn main() {}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error[E0277]: the trait bound `SomeType: LocalTrait` is not satisfied
2+
--> $DIR/trait-bound-adt-issue-145611.rs:8:19
3+
|
4+
LL | impls_trait::<SomeType>();
5+
| ^^^^^^^^ the trait `LocalTrait` is not implemented for `SomeType`
6+
|
7+
help: this trait has no implementations, consider adding one
8+
--> $DIR/trait-bound-adt-issue-145611.rs:4:1
9+
|
10+
LL | trait LocalTrait {}
11+
| ^^^^^^^^^^^^^^^^
12+
note: required by a bound in `impls_trait`
13+
--> $DIR/trait-bound-adt-issue-145611.rs:6:19
14+
|
15+
LL | fn impls_trait<T: LocalTrait>() {}
16+
| ^^^^^^^^^^ required by this bound in `impls_trait`
17+
18+
error: aborting due to 1 previous error
19+
20+
For more information about this error, try `rustc --explain E0277`.

tests/ui/traits/const-traits/feature-gate.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ impl const T for S {}
1313
const fn f<A: [const] T>() {} //[stock]~ ERROR const trait impls are experimental
1414
fn g<A: const T>() {} //[stock]~ ERROR const trait impls are experimental
1515

16+
const trait Trait {} //[stock]~ ERROR const trait impls are experimental
17+
#[cfg(false)] const trait Trait {} //[stock]~ ERROR const trait impls are experimental
18+
1619
macro_rules! discard { ($ty:ty) => {} }
1720

1821
discard! { impl [const] T } //[stock]~ ERROR const trait impls are experimental

0 commit comments

Comments
 (0)