Skip to content

Commit

Permalink
Rollup merge of rust-lang#65106 - Mark-Simulacrum:unused-attr-allow, …
Browse files Browse the repository at this point in the history
…r=Centril

Allow unused attributes to avoid incremental bug

cc rust-lang#65023

This isn't labeled as fixing that issue because it's not really a fix, just a patch.
  • Loading branch information
tmandry authored Oct 6, 2019
2 parents 2c8cbcc + d0a6805 commit f80656c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libcore/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ impl<T> [T] {
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
// SAFETY: const sound because we transmute out the length field as a usize (which it must be)
#[allow(unused_attributes)]
#[allow_internal_unstable(const_fn_union)]
pub const fn len(&self) -> usize {
unsafe {
Expand Down
1 change: 1 addition & 0 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2167,6 +2167,7 @@ impl str {
#[stable(feature = "rust1", since = "1.0.0")]
#[inline(always)]
// SAFETY: const sound because we transmute two types with the same layout
#[allow(unused_attributes)]
#[allow_internal_unstable(const_fn_union)]
pub const fn as_bytes(&self) -> &[u8] {
#[repr(C)]
Expand Down

0 comments on commit f80656c

Please sign in to comment.