Skip to content

Commit 2d7be73

Browse files
committed
Auto merge of #119263 - matthiaskrgr:rollup-zxok9fb, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #112936 (Add illumos aarch64 target for rust.) - #119153 (stabilize `file_create_new`) - #119246 ([rustdoc] Add `is_object_safe` information for traits in JSON output) - #119254 (Remove an unused diagnostic struct) - #119255 (add a test for ICE #112822) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 520e30b + aa2e5fa commit 2d7be73

File tree

11 files changed

+81
-14
lines changed

11 files changed

+81
-14
lines changed

Diff for: compiler/rustc_middle/src/ty/diagnostics.rs

-8
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,3 @@ impl<'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for MakeSuggestableFolder<'tcx> {
628628
c.try_super_fold_with(self)
629629
}
630630
}
631-
632-
#[derive(Diagnostic)]
633-
#[diag(middle_const_not_used_in_type_alias)]
634-
pub(super) struct ConstNotUsedTraitAlias {
635-
pub ct: String,
636-
#[primary_span]
637-
pub span: Span,
638-
}

Diff for: compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,7 @@ supported_targets! {
15911591
("sparcv9-sun-solaris", sparcv9_sun_solaris),
15921592

15931593
("x86_64-unknown-illumos", x86_64_unknown_illumos),
1594+
("aarch64-unknown-illumos", aarch64_unknown_illumos),
15941595

15951596
("x86_64-pc-windows-gnu", x86_64_pc_windows_gnu),
15961597
("i686-pc-windows-gnu", i686_pc_windows_gnu),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
use crate::spec::{base, Cc, LinkerFlavor, SanitizerSet, Target};
2+
3+
pub fn target() -> Target {
4+
let mut base = base::illumos::opts();
5+
base.add_pre_link_args(LinkerFlavor::Unix(Cc::Yes), &["-std=c99"]);
6+
base.max_atomic_width = Some(128);
7+
base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::CFI;
8+
base.features = "+v8a".into();
9+
10+
Target {
11+
// LLVM does not currently have a separate illumos target,
12+
// so we still pass Solaris to it
13+
llvm_target: "aarch64-unknown-solaris2.11".into(),
14+
pointer_width: 64,
15+
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
16+
arch: "aarch64".into(),
17+
options: base,
18+
}
19+
}

Diff for: library/std/src/fs.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,6 @@ impl File {
411411
/// # Examples
412412
///
413413
/// ```no_run
414-
/// #![feature(file_create_new)]
415-
///
416414
/// use std::fs::File;
417415
/// use std::io::Write;
418416
///
@@ -422,7 +420,7 @@ impl File {
422420
/// Ok(())
423421
/// }
424422
/// ```
425-
#[unstable(feature = "file_create_new", issue = "105135")]
423+
#[stable(feature = "file_create_new", since = "CURRENT_RUSTC_VERSION")]
426424
pub fn create_new<P: AsRef<Path>>(path: P) -> io::Result<File> {
427425
OpenOptions::new().read(true).write(true).create_new(true).open(path.as_ref())
428426
}

Diff for: src/doc/rustc/src/platform-support.md

+1
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ target | std | host | notes
230230
[`aarch64-unknown-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | ARM64 QNX Neutrino 7.1 RTOS |
231231
`aarch64-unknown-freebsd` | ✓ | ✓ | ARM64 FreeBSD
232232
[`aarch64-unknown-hermit`](platform-support/hermit.md) | ✓ | | ARM64 Hermit
233+
`aarch64-unknown-illumos` | ✓ | ✓ | ARM64 illumos
233234
`aarch64-unknown-linux-gnu_ilp32` | ✓ | ✓ | ARM64 Linux (ILP32 ABI)
234235
[`aarch64-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | ARM64 NetBSD
235236
[`aarch64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | ARM64 OpenBSD

Diff for: src/librustdoc/json/conversions.rs

+2
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,12 @@ impl FromWithTcx<clean::Trait> for Trait {
648648
fn from_tcx(trait_: clean::Trait, tcx: TyCtxt<'_>) -> Self {
649649
let is_auto = trait_.is_auto(tcx);
650650
let is_unsafe = trait_.unsafety(tcx) == rustc_hir::Unsafety::Unsafe;
651+
let is_object_safe = trait_.is_object_safe(tcx);
651652
let clean::Trait { items, generics, bounds, .. } = trait_;
652653
Trait {
653654
is_auto,
654655
is_unsafe,
656+
is_object_safe,
655657
items: ids(items, tcx),
656658
generics: generics.into_tcx(tcx),
657659
bounds: bounds.into_tcx(tcx),

Diff for: src/rustdoc-json-types/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
88
use std::path::PathBuf;
99

1010
/// rustdoc format-version.
11-
pub const FORMAT_VERSION: u32 = 27;
11+
pub const FORMAT_VERSION: u32 = 28;
1212

1313
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
1414
/// about the language items in the local crate, as well as info about external items to allow
@@ -634,6 +634,7 @@ pub struct FnDecl {
634634
pub struct Trait {
635635
pub is_auto: bool,
636636
pub is_unsafe: bool,
637+
pub is_object_safe: bool,
637638
pub items: Vec<Id>,
638639
pub generics: Generics,
639640
pub bounds: Vec<GenericBound>,

Diff for: tests/rustdoc-json/traits/is_object_safe.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#![no_std]
2+
3+
// @has "$.index[*][?(@.name=='FooUnsafe')]"
4+
// @is "$.index[*][?(@.name=='FooUnsafe')].inner.trait.is_object_safe" false
5+
pub trait FooUnsafe {
6+
fn foo() -> Self;
7+
}
8+
9+
// @has "$.index[*][?(@.name=='BarUnsafe')]"
10+
// @is "$.index[*][?(@.name=='BarUnsafe')].inner.trait.is_object_safe" false
11+
pub trait BarUnsafe<T> {
12+
fn foo(i: T);
13+
}
14+
15+
// @has "$.index[*][?(@.name=='FooSafe')]"
16+
// @is "$.index[*][?(@.name=='FooSafe')].inner.trait.is_object_safe" true
17+
pub trait FooSafe {
18+
fn foo(&self);
19+
}

Diff for: tests/rustdoc/trait-object-safe.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ pub trait Safe {
2222
}
2323

2424
// @has 'foo/struct.Foo.html'
25-
// @!has - '//*[@class="object-safety-info"]' ''
26-
// @!has - '//*[@id="object-safety"]' ''
25+
// @count - '//*[@class="object-safety-info"]' 0
26+
// @count - '//*[@id="object-safety"]' 0
2727
pub struct Foo;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#![feature(const_trait_impl, effects)]
2+
3+
const fn test() -> impl ~const Fn() { //~ ERROR ~const can only be applied to `#[const_trait]` traits
4+
const move || { //~ ERROR const closures are experimental
5+
let sl: &[u8] = b"foo";
6+
7+
match sl {
8+
[first, remainder @ ..] => {
9+
assert_eq!(first, &b'f');
10+
}
11+
[] => panic!(),
12+
}
13+
}
14+
}
15+
16+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error[E0658]: const closures are experimental
2+
--> $DIR/ice-112822-expected-type-for-param.rs:4:5
3+
|
4+
LL | const move || {
5+
| ^^^^^
6+
|
7+
= note: see issue #106003 <https://github.com/rust-lang/rust/issues/106003> for more information
8+
= help: add `#![feature(const_closures)]` to the crate attributes to enable
9+
10+
error: ~const can only be applied to `#[const_trait]` traits
11+
--> $DIR/ice-112822-expected-type-for-param.rs:3:32
12+
|
13+
LL | const fn test() -> impl ~const Fn() {
14+
| ^^^^
15+
16+
error: aborting due to 2 previous errors
17+
18+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)