Skip to content

Commit acb8934

Browse files
committed
Auto merge of rust-lang#102022 - matthiaskrgr:rollup-emwfjd1, r=matthiaskrgr
Rollup of 11 pull requests Successful merges: - rust-lang#101389 (Tone down explanation on RefCell::get_mut) - rust-lang#101798 (Make `from_waker`, `waker` and `from_raw` unstably `const`) - rust-lang#101881 (Remove an unused struct field `late_bound`) - rust-lang#101904 (Add help for invalid inline argument) - rust-lang#101966 (Add unit test for identifier Unicode emoji diagnostics) - rust-lang#101979 (Update release notes for 1.64) - rust-lang#101985 (interpret: expose generate_stacktrace without full InterpCx) - rust-lang#102004 (Try to clarify what's new in 1.64.0 ffi types) - rust-lang#102005 (rustdoc: remove unused CSS `td.summary-column`) - rust-lang#102017 (Add all submodules to the list of directories tidy skips) - rust-lang#102019 (Remove backed off PRs from relnotes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents a57a6ac + 683cf99 commit acb8934

File tree

18 files changed

+176
-98
lines changed

18 files changed

+176
-98
lines changed

RELEASES.md

+44-55
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,33 @@ Version 1.64.0 (2022-09-22)
33

44
Language
55
--------
6-
- [make `const_err` show up in future breakage reports](https://github.com/rust-lang/rust/pull/97743/)
7-
- [allow unions with mutable references and tuples of allowed types](https://github.com/rust-lang/rust/pull/97995/)
6+
- [Unions with mutable references or tuples of allowed types are now allowed](https://github.com/rust-lang/rust/pull/97995/)
87
- It is now considered valid to deallocate memory pointed to by a shared reference `&T` [if every byte in `T` is inside an `UnsafeCell`](https://github.com/rust-lang/rust/pull/98017/)
98
- Unused tuple struct fields are now warned against in an allow-by-default lint, [`unused_tuple_struct_fields`](https://github.com/rust-lang/rust/pull/95977/), similar to the existing warning for unused struct fields. This lint will become warn-by-default in the future.
109

1110
Compiler
1211
--------
13-
- The minimum required versions for all `-linux-gnu` targets are now at least kernel 3.2 and glibc 2.17, for targets that previously supported older versions: [Increase the minimum linux-gnu versions](https://github.com/rust-lang/rust/pull/95026/)
14-
- [Keep unstable target features for asm feature checking](https://github.com/rust-lang/rust/pull/99155/)
1512
- [Add Nintendo Switch as tier 3 target](https://github.com/rust-lang/rust/pull/88991/)
1613
- Refer to Rust's [platform support page][platform-support-doc] for more
1714
information on Rust's tiered platform support.
18-
- [Only compile #[used] as llvm.compiler.used for ELF targets](https://github.com/rust-lang/rust/pull/93718/)
19-
- [sess: stabilize `-Zterminal-width` as `--diagnostic-width`](https://github.com/rust-lang/rust/pull/95635/)
20-
- [Fix repr(align) enum handling](https://github.com/rust-lang/rust/pull/96814/)
21-
- [Suggest defining variable as mutable on `&mut _` type mismatch in pats](https://github.com/rust-lang/rust/pull/98431/)
22-
- [Emit warning when named arguments are used positionally in format](https://github.com/rust-lang/rust/pull/98580/)
23-
- [Add support for link-flavor rust-lld for iOS, tvOS and watchOS](https://github.com/rust-lang/rust/pull/98771/)
24-
- [Do not mention private types from other crates as impl candidates](https://github.com/rust-lang/rust/pull/99091/)
15+
- [Only compile `#[used]` as llvm.compiler.used for ELF targets](https://github.com/rust-lang/rust/pull/93718/)
16+
- [Add the `--diagnostic-width` compiler flag to define the terminal width.](https://github.com/rust-lang/rust/pull/95635/)
17+
- [Add support for link-flavor `rust-lld` for iOS, tvOS and watchOS](https://github.com/rust-lang/rust/pull/98771/)
2518

2619
Libraries
2720
---------
28-
- [Implement network primitives with ideal Rust layout, not C system layout](https://github.com/rust-lang/rust/pull/78802/)
2921
- [Remove restrictions on compare-exchange memory ordering.](https://github.com/rust-lang/rust/pull/98383/)
3022
- You can now `write!` or `writeln!` into an `OsString`: [Implement `fmt::Write` for `OsString`](https://github.com/rust-lang/rust/pull/97915/)
31-
- [Enforce that layout size fits in isize in Layout](https://github.com/rust-lang/rust/pull/95295/)
3223
- [Make RwLockReadGuard covariant](https://github.com/rust-lang/rust/pull/96820/)
3324
- [Implement `FusedIterator` for `std::net::[Into]Incoming`](https://github.com/rust-lang/rust/pull/97300/)
3425
- [`impl<T: AsRawFd> AsRawFd for {Arc,Box}<T>`](https://github.com/rust-lang/rust/pull/97437/)
35-
- [ptr::copy and ptr::swap are doing untyped copies](https://github.com/rust-lang/rust/pull/97712/)
36-
- [Add assertion that `transmute_copy`'s U is not larger than T](https://github.com/rust-lang/rust/pull/98839/)
37-
- [A soundness bug in `BTreeMap` was fixed](https://github.com/rust-lang/rust/pull/99413/) that allowed data it was borrowing to be dropped before the container.
26+
- [`ptr::copy` and `ptr::swap` are doing untyped copies](https://github.com/rust-lang/rust/pull/97712/)
3827
- [Add cgroupv1 support to `available_parallelism`](https://github.com/rust-lang/rust/pull/97925/)
39-
- [mem::uninitialized: mitigate many incorrect uses of this function](https://github.com/rust-lang/rust/pull/99182/)
28+
- [Mitigate many incorrect uses of `mem::uninitialized`](https://github.com/rust-lang/rust/pull/99182/)
4029

4130
Stabilized APIs
4231
---------------
4332

44-
- [`ffi::CStr`](https://doc.rust-lang.org/stable/std/ffi/struct.CStr.html)
45-
- [`ffi::CString`](https://doc.rust-lang.org/stable/std/ffi/struct.CString.html)
46-
- [`ffi::FromBytesWithNulError`](https://doc.rust-lang.org/stable/std/ffi/struct.FromBytesWithNulError.html)
47-
- [`ffi::FromVecWithNulError`](https://doc.rust-lang.org/stable/std/ffi/struct.FromVecWithNulError.html)
48-
- [`ffi::IntoStringError`](https://doc.rust-lang.org/stable/std/ffi/struct.IntoStringError.html)
49-
- [`ffi::NulError`](https://doc.rust-lang.org/stable/std/ffi/struct.NulError.html)
50-
- [`ffi::c_char`](https://doc.rust-lang.org/stable/std/ffi/type.c_char.html)
51-
- [`ffi::c_double`](https://doc.rust-lang.org/stable/std/ffi/type.c_double.html)
52-
- [`ffi::c_float`](https://doc.rust-lang.org/stable/std/ffi/type.c_float.html)
53-
- [`ffi::c_int`](https://doc.rust-lang.org/stable/std/ffi/type.c_int.html)
54-
- [`ffi::c_long`](https://doc.rust-lang.org/stable/std/ffi/type.c_long.html)
55-
- [`ffi::c_longlong`](https://doc.rust-lang.org/stable/std/ffi/type.c_longlong.html)
56-
- [`ffi::c_schar`](https://doc.rust-lang.org/stable/std/ffi/type.c_schar.html)
57-
- [`ffi::c_short`](https://doc.rust-lang.org/stable/std/ffi/type.c_short.html)
58-
- [`ffi::c_uchar`](https://doc.rust-lang.org/stable/std/ffi/type.c_uchar.html)
59-
- [`ffi::c_uint`](https://doc.rust-lang.org/stable/std/ffi/type.c_uint.html)
60-
- [`ffi::c_ulong`](https://doc.rust-lang.org/stable/std/ffi/type.c_ulong.html)
61-
- [`ffi::c_ulonglong`](https://doc.rust-lang.org/stable/std/ffi/type.c_ulonglong.html)
62-
- [`ffi::c_ushort`](https://doc.rust-lang.org/stable/std/ffi/type.c_ushort.html)
6333
- [`future::IntoFuture`](https://doc.rust-lang.org/stable/std/future/trait.IntoFuture.html)
6434
- [`future::poll_fn`](https://doc.rust-lang.org/stable/std/future/fn.poll_fn.html)
6535
- [`task::ready!`](https://doc.rust-lang.org/stable/std/task/macro.ready.html)
@@ -80,46 +50,65 @@ Stabilized APIs
8050
- [`os::windows::fs::FileTypeExt::is_symlink_dir`](https://doc.rust-lang.org/stable/std/os/windows/fs/trait.FileTypeExt.html#tymethod.is_symlink_dir)
8151
- [`os::windows::fs::FileTypeExt::is_symlink_file`](https://doc.rust-lang.org/stable/std/os/windows/fs/trait.FileTypeExt.html#tymethod.is_symlink_file)
8252

53+
These types were previously stable in `std::ffi`, but are now also available in `core` and `alloc`:
54+
55+
- [`core::ffi::CStr`](https://doc.rust-lang.org/stable/core/ffi/struct.CStr.html)
56+
- [`core::ffi::FromBytesWithNulError`](https://doc.rust-lang.org/stable/core/ffi/struct.FromBytesWithNulError.html)
57+
- [`alloc::ffi::CString`](https://doc.rust-lang.org/stable/alloc/ffi/struct.CString.html)
58+
- [`alloc::ffi::FromVecWithNulError`](https://doc.rust-lang.org/stable/alloc/ffi/struct.FromVecWithNulError.html)
59+
- [`alloc::ffi::IntoStringError`](https://doc.rust-lang.org/stable/alloc/ffi/struct.IntoStringError.html)
60+
- [`alloc::ffi::NulError`](https://doc.rust-lang.org/stable/alloc/ffi/struct.NulError.html)
61+
62+
These types were previously stable in `std::os::raw`, but are now also available in `core::ffi` and `std::ffi`:
63+
64+
- [`ffi::c_char`](https://doc.rust-lang.org/stable/std/ffi/type.c_char.html)
65+
- [`ffi::c_double`](https://doc.rust-lang.org/stable/std/ffi/type.c_double.html)
66+
- [`ffi::c_float`](https://doc.rust-lang.org/stable/std/ffi/type.c_float.html)
67+
- [`ffi::c_int`](https://doc.rust-lang.org/stable/std/ffi/type.c_int.html)
68+
- [`ffi::c_long`](https://doc.rust-lang.org/stable/std/ffi/type.c_long.html)
69+
- [`ffi::c_longlong`](https://doc.rust-lang.org/stable/std/ffi/type.c_longlong.html)
70+
- [`ffi::c_schar`](https://doc.rust-lang.org/stable/std/ffi/type.c_schar.html)
71+
- [`ffi::c_short`](https://doc.rust-lang.org/stable/std/ffi/type.c_short.html)
72+
- [`ffi::c_uchar`](https://doc.rust-lang.org/stable/std/ffi/type.c_uchar.html)
73+
- [`ffi::c_uint`](https://doc.rust-lang.org/stable/std/ffi/type.c_uint.html)
74+
- [`ffi::c_ulong`](https://doc.rust-lang.org/stable/std/ffi/type.c_ulong.html)
75+
- [`ffi::c_ulonglong`](https://doc.rust-lang.org/stable/std/ffi/type.c_ulonglong.html)
76+
- [`ffi::c_ushort`](https://doc.rust-lang.org/stable/std/ffi/type.c_ushort.html)
77+
8378
These APIs are now usable in const contexts:
8479

8580
- [`slice::from_raw_parts`](https://doc.rust-lang.org/stable/core/slice/fn.from_raw_parts.html)
8681

8782
Cargo
8883
-----
89-
- Packages can now inherit settings from the workspace so that the settings
90-
can be centralized in one place. See
84+
- [Packages can now inherit settings from the workspace so that the settings
85+
can be centralized in one place.](https://github.com/rust-lang/cargo/pull/10859) See
9186
[`workspace.package`](https://doc.rust-lang.org/nightly/cargo/reference/workspaces.html#the-workspacepackage-table)
9287
and
9388
[`workspace.dependencies`](https://doc.rust-lang.org/nightly/cargo/reference/workspaces.html#the-workspacedependencies-table)
9489
for more details on how to define these common settings.
95-
[#10859](https://github.com/rust-lang/cargo/pull/10859)
96-
- Cargo commands can now accept multiple `--target` flags to build for
97-
multiple targets at once, and the
90+
- [Cargo commands can now accept multiple `--target` flags to build for
91+
multiple targets at once](https://github.com/rust-lang/cargo/pull/10766), and the
9892
[`build.target`](https://doc.rust-lang.org/nightly/cargo/reference/config.html#buildtarget)
9993
config option may now take an array of multiple targets.
100-
[#10766](https://github.com/rust-lang/cargo/pull/10766)
101-
- The `--jobs` argument can now take a negative number to count backwards from
102-
the max CPUs.
103-
[#10844](https://github.com/rust-lang/cargo/pull/10844)
104-
- `cargo add` will now update `Cargo.lock`.
105-
[#10902](https://github.com/rust-lang/cargo/pull/10902)
106-
- Added the
94+
- [The `--jobs` argument can now take a negative number to count backwards from
95+
the max CPUs.](https://github.com/rust-lang/cargo/pull/10844)
96+
- [`cargo add` will now update `Cargo.lock`.](https://github.com/rust-lang/cargo/pull/10902)
97+
- [Added](https://github.com/rust-lang/cargo/pull/10838) the
10798
[`--crate-type`](https://doc.rust-lang.org/nightly/cargo/commands/cargo-rustc.html#option-cargo-rustc---crate-type)
10899
flag to `cargo rustc` to override the crate type.
109-
[#10838](https://github.com/rust-lang/cargo/pull/10838)
110-
- Significantly improved the performance fetching git dependencies from GitHub
111-
when using a hash in the `rev` field.
112-
[#10079](https://github.com/rust-lang/cargo/pull/10079)
100+
- [Significantly improved the performance fetching git dependencies from GitHub
101+
when using a hash in the `rev` field.](https://github.com/rust-lang/cargo/pull/10079)
113102

114103
Misc
115104
----
116-
- [Let rust-analyzer ship on stable, non-preview](https://github.com/rust-lang/rust/pull/98640/)
105+
- [The `rust-analyzer` rustup component is now available on the stable channel.](https://github.com/rust-lang/rust/pull/98640/)
117106

118107
Compatibility Notes
119108
-------------------
120109
- The minimum required versions for all `-linux-gnu` targets are now at least kernel 3.2 and glibc 2.17, for targets that previously supported older versions: [Increase the minimum linux-gnu versions](https://github.com/rust-lang/rust/pull/95026/)
121-
- [Implement network primitives with ideal Rust layout, not C system layout](https://github.com/rust-lang/rust/pull/78802/)
122-
- [Add assertion that `transmute_copy`'s U is not larger than T](https://github.com/rust-lang/rust/pull/98839/)
110+
- [Network primitives are now implemented with the ideal Rust layout, not the C system layout](https://github.com/rust-lang/rust/pull/78802/). This can cause problems when transmuting the types.
111+
- [Add assertion that `transmute_copy`'s `U` is not larger than `T`](https://github.com/rust-lang/rust/pull/98839/)
123112
- [A soundness bug in `BTreeMap` was fixed](https://github.com/rust-lang/rust/pull/99413/) that allowed data it was borrowing to be dropped before the container.
124113
- [The Drop behavior of C-like enums cast to ints has changed](https://github.com/rust-lang/rust/pull/96862/). These are already discouraged by a compiler warning.
125114
- [Relate late-bound closure lifetimes to parent fn in NLL](https://github.com/rust-lang/rust/pull/98835/)

compiler/rustc_const_eval/src/interpret/eval_context.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -929,11 +929,13 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
929929
}
930930

931931
#[must_use]
932-
pub fn generate_stacktrace(&self) -> Vec<FrameInfo<'tcx>> {
932+
pub fn generate_stacktrace_from_stack(
933+
stack: &[Frame<'mir, 'tcx, M::Provenance, M::FrameExtra>],
934+
) -> Vec<FrameInfo<'tcx>> {
933935
let mut frames = Vec::new();
934936
// This deliberately does *not* honor `requires_caller_location` since it is used for much
935937
// more than just panics.
936-
for frame in self.stack().iter().rev() {
938+
for frame in stack.iter().rev() {
937939
let lint_root = frame.current_source_info().and_then(|source_info| {
938940
match &frame.body.source_scopes[source_info.scope].local_data {
939941
mir::ClearCrossCrate::Set(data) => Some(data.lint_root),
@@ -947,6 +949,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
947949
trace!("generate stacktrace: {:#?}", frames);
948950
frames
949951
}
952+
953+
#[must_use]
954+
pub fn generate_stacktrace(&self) -> Vec<FrameInfo<'tcx>> {
955+
Self::generate_stacktrace_from_stack(self.stack())
956+
}
950957
}
951958

952959
#[doc(hidden)]

compiler/rustc_middle/src/middle/resolve_lifetime.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::ty;
44

5-
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
5+
use rustc_data_structures::fx::FxHashMap;
66
use rustc_hir::def_id::{DefId, LocalDefId};
77
use rustc_hir::ItemLocalId;
88
use rustc_macros::HashStable;
@@ -51,10 +51,5 @@ pub struct ResolveLifetimes {
5151
/// `Region` describing how that region is bound
5252
pub defs: FxHashMap<LocalDefId, FxHashMap<ItemLocalId, Region>>,
5353

54-
/// Set of lifetime def ids that are late-bound; a region can
55-
/// be late-bound if (a) it does NOT appear in a where-clause and
56-
/// (b) it DOES appear in the arguments.
57-
pub late_bound: FxHashMap<LocalDefId, FxHashSet<LocalDefId>>,
58-
5954
pub late_bound_vars: FxHashMap<LocalDefId, FxHashMap<ItemLocalId, Vec<ty::BoundVariableKind>>>,
6055
}

compiler/rustc_typeck/src/collect.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3154,6 +3154,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: DefId) -> CodegenFnAttrs {
31543154
E0535,
31553155
"invalid argument"
31563156
)
3157+
.help("valid inline arguments are `always` and `never`")
31573158
.emit();
31583159

31593160
InlineAttr::None

library/alloc/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
#![feature(core_intrinsics)]
110110
#![feature(const_eval_select)]
111111
#![feature(const_pin)]
112+
#![feature(const_waker)]
112113
#![feature(cstr_from_bytes_until_nul)]
113114
#![feature(dispatch_from_dyn)]
114115
#![cfg_attr(not(bootstrap), feature(error_generic_member_access))]

library/core/src/cell.rs

+12-9
Original file line numberDiff line numberDiff line change
@@ -1021,15 +1021,18 @@ impl<T: ?Sized> RefCell<T> {
10211021

10221022
/// Returns a mutable reference to the underlying data.
10231023
///
1024-
/// This call borrows `RefCell` mutably (at compile-time) so there is no
1025-
/// need for dynamic checks.
1026-
///
1027-
/// However be cautious: this method expects `self` to be mutable, which is
1028-
/// generally not the case when using a `RefCell`. Take a look at the
1029-
/// [`borrow_mut`] method instead if `self` isn't mutable.
1030-
///
1031-
/// Also, please be aware that this method is only for special circumstances and is usually
1032-
/// not what you want. In case of doubt, use [`borrow_mut`] instead.
1024+
/// Since this method borrows `RefCell` mutably, it is statically guaranteed
1025+
/// that no borrows to the underlying data exist. The dynamic checks inherent
1026+
/// in [`borrow_mut`] and most other methods of `RefCell` are therefor
1027+
/// unnecessary.
1028+
///
1029+
/// This method can only be called if `RefCell` can be mutably borrowed,
1030+
/// which in general is only the case directly after the `RefCell` has
1031+
/// been created. In these situations, skipping the aforementioned dynamic
1032+
/// borrowing checks may yield better ergonomics and runtime-performance.
1033+
///
1034+
/// In most situations where `RefCell` is used, it can't be borrowed mutably.
1035+
/// Use [`borrow_mut`] to get mutable access to the underlying data then.
10331036
///
10341037
/// [`borrow_mut`]: RefCell::borrow_mut()
10351038
///

library/core/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
#![feature(const_default_impls)]
146146
#![feature(const_unicode_case_lookup)]
147147
#![feature(const_unsafecell_get_mut)]
148+
#![feature(const_waker)]
148149
#![feature(core_panic)]
149150
#![feature(duration_consts_float)]
150151
#![feature(maybe_uninit_uninit_array)]

library/core/src/task/wake.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,19 @@ pub struct Context<'a> {
186186
impl<'a> Context<'a> {
187187
/// Create a new `Context` from a [`&Waker`](Waker).
188188
#[stable(feature = "futures_api", since = "1.36.0")]
189+
#[rustc_const_unstable(feature = "const_waker", issue = "102012")]
189190
#[must_use]
190191
#[inline]
191-
pub fn from_waker(waker: &'a Waker) -> Self {
192+
pub const fn from_waker(waker: &'a Waker) -> Self {
192193
Context { waker, _marker: PhantomData }
193194
}
194195

195196
/// Returns a reference to the [`Waker`] for the current task.
196197
#[stable(feature = "futures_api", since = "1.36.0")]
198+
#[rustc_const_unstable(feature = "const_waker", issue = "102012")]
197199
#[must_use]
198200
#[inline]
199-
pub fn waker(&self) -> &'a Waker {
201+
pub const fn waker(&self) -> &'a Waker {
200202
&self.waker
201203
}
202204
}
@@ -311,7 +313,8 @@ impl Waker {
311313
#[inline]
312314
#[must_use]
313315
#[stable(feature = "futures_api", since = "1.36.0")]
314-
pub unsafe fn from_raw(waker: RawWaker) -> Waker {
316+
#[rustc_const_unstable(feature = "const_waker", issue = "102012")]
317+
pub const unsafe fn from_raw(waker: RawWaker) -> Waker {
315318
Waker { waker }
316319
}
317320

library/core/tests/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
#![feature(iterator_try_reduce)]
7575
#![feature(const_mut_refs)]
7676
#![feature(const_pin)]
77+
#![feature(const_waker)]
7778
#![feature(never_type)]
7879
#![feature(unwrap_infallible)]
7980
#![feature(pointer_byte_offsets)]

library/core/tests/task.rs

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use core::task::Poll;
1+
use core::task::{Context, Poll, RawWaker, RawWakerVTable, Waker};
22

33
#[test]
44
fn poll_const() {
@@ -12,3 +12,18 @@ fn poll_const() {
1212
const IS_PENDING: bool = POLL.is_pending();
1313
assert!(IS_PENDING);
1414
}
15+
16+
#[test]
17+
fn waker_const() {
18+
const VOID_TABLE: RawWakerVTable = RawWakerVTable::new(|_| VOID_WAKER, |_| {}, |_| {}, |_| {});
19+
20+
const VOID_WAKER: RawWaker = RawWaker::new(&(), &VOID_TABLE);
21+
22+
static WAKER: Waker = unsafe { Waker::from_raw(VOID_WAKER) };
23+
24+
static CONTEXT: Context<'static> = Context::from_waker(&WAKER);
25+
26+
static WAKER_REF: &'static Waker = CONTEXT.waker();
27+
28+
WAKER_REF.wake_by_ref();
29+
}

library/std/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@
315315
#![feature(strict_provenance)]
316316
#![feature(maybe_uninit_uninit_array)]
317317
#![feature(const_maybe_uninit_uninit_array)]
318+
#![feature(const_waker)]
318319
//
319320
// Library features (alloc):
320321
#![feature(alloc_layout_extra)]

src/librustdoc/html/static/css/rustdoc.css

-4
Original file line numberDiff line numberDiff line change
@@ -1152,10 +1152,6 @@ so that we can apply CSS-filters to change the arrow color in themes */
11521152
font-size: 1rem;
11531153
}
11541154

1155-
td.summary-column {
1156-
width: 100%;
1157-
}
1158-
11591155
.summary {
11601156
padding-right: 0px;
11611157
}

src/test/ui/invalid/invalid-inline.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
#![allow(dead_code)]
22

3-
#[inline(please_no)] //~ ERROR invalid argument
4-
fn a() {
5-
}
6-
73
#[inline(please,no)] //~ ERROR expected one argument
8-
fn b() {
4+
fn a() {
95
}
106

117
#[inline()] //~ ERROR expected one argument
12-
fn c() {
8+
fn b() {
139
}
1410

1511
fn main() {
1612
a();
1713
b();
18-
c();
1914
}
+4-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
1-
error[E0535]: invalid argument
2-
--> $DIR/invalid-inline.rs:3:10
3-
|
4-
LL | #[inline(please_no)]
5-
| ^^^^^^^^^
6-
71
error[E0534]: expected one argument
8-
--> $DIR/invalid-inline.rs:7:1
2+
--> $DIR/invalid-inline.rs:3:1
93
|
104
LL | #[inline(please,no)]
115
| ^^^^^^^^^^^^^^^^^^^^
126

137
error[E0534]: expected one argument
14-
--> $DIR/invalid-inline.rs:11:1
8+
--> $DIR/invalid-inline.rs:7:1
159
|
1610
LL | #[inline()]
1711
| ^^^^^^^^^^^
1812

19-
error: aborting due to 3 previous errors
13+
error: aborting due to 2 previous errors
2014

21-
Some errors have detailed explanations: E0534, E0535.
22-
For more information about an error, try `rustc --explain E0534`.
15+
For more information about this error, try `rustc --explain E0534`.

0 commit comments

Comments
 (0)