Skip to content

Commit 0b6c116

Browse files
committed
Auto merge of #68142 - Centril:rollup-dl232e9, r=Centril
Rollup of 6 pull requests Successful merges: - #67494 (Constify more of alloc::Layout) - #67867 (Correctly check for opaque types in `assoc_ty_def`) - #67948 (Galloping search for binary_search_util) - #68045 (Move more of `rustc::lint` into `rustc_lint`) - #68089 (Unstabilize `Vec::remove_item`) - #68108 (Add suggestions when encountering chained comparisons) Failed merges: r? @ghost
2 parents f363745 + 82c19b4 commit 0b6c116

Some content is hidden

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

65 files changed

+1404
-1092
lines changed

Cargo.lock

+2
Original file line numberDiff line numberDiff line change
@@ -3663,6 +3663,7 @@ dependencies = [
36633663
"log",
36643664
"rustc",
36653665
"rustc_data_structures",
3666+
"rustc_error_codes",
36663667
"rustc_errors",
36673668
"rustc_feature",
36683669
"rustc_hir",
@@ -3788,6 +3789,7 @@ dependencies = [
37883789
"rustc_error_codes",
37893790
"rustc_errors",
37903791
"rustc_hir",
3792+
"rustc_lint",
37913793
"rustc_metadata",
37923794
"rustc_span",
37933795
"syntax",

src/liballoc/tests/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#![feature(associated_type_bounds)]
1212
#![feature(binary_heap_into_iter_sorted)]
1313
#![feature(binary_heap_drain_sorted)]
14+
#![feature(vec_remove_item)]
1415

1516
use std::collections::hash_map::DefaultHasher;
1617
use std::hash::{Hash, Hasher};

src/liballoc/vec.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1696,13 +1696,14 @@ impl<T> Vec<T> {
16961696
/// # Examples
16971697
///
16981698
/// ```
1699+
/// # #![feature(vec_remove_item)]
16991700
/// let mut vec = vec![1, 2, 3, 1];
17001701
///
17011702
/// vec.remove_item(&1);
17021703
///
17031704
/// assert_eq!(vec, vec![2, 3, 1]);
17041705
/// ```
1705-
#[stable(feature = "vec_remove_item", since = "1.42.0")]
1706+
#[unstable(feature = "vec_remove_item", reason = "recently added", issue = "40062")]
17061707
pub fn remove_item<V>(&mut self, item: &V) -> Option<T>
17071708
where
17081709
T: PartialEq<V>,

src/libcore/alloc.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ impl Layout {
6464
/// must not overflow (i.e., the rounded value must be less than
6565
/// `usize::MAX`).
6666
#[stable(feature = "alloc_layout", since = "1.28.0")]
67+
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
6768
#[inline]
68-
pub fn from_size_align(size: usize, align: usize) -> Result<Self, LayoutErr> {
69+
pub const fn from_size_align(size: usize, align: usize) -> Result<Self, LayoutErr> {
6970
if !align.is_power_of_two() {
7071
return Err(LayoutErr { private: () });
7172
}
@@ -106,15 +107,17 @@ impl Layout {
106107

107108
/// The minimum size in bytes for a memory block of this layout.
108109
#[stable(feature = "alloc_layout", since = "1.28.0")]
110+
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
109111
#[inline]
110-
pub fn size(&self) -> usize {
112+
pub const fn size(&self) -> usize {
111113
self.size_
112114
}
113115

114116
/// The minimum byte alignment for a memory block of this layout.
115117
#[stable(feature = "alloc_layout", since = "1.28.0")]
118+
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
116119
#[inline]
117-
pub fn align(&self) -> usize {
120+
pub const fn align(&self) -> usize {
118121
self.align_.get()
119122
}
120123

@@ -181,8 +184,9 @@ impl Layout {
181184
/// address for the whole allocated block of memory. One way to
182185
/// satisfy this constraint is to ensure `align <= self.align()`.
183186
#[unstable(feature = "alloc_layout_extra", issue = "55724")]
187+
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
184188
#[inline]
185-
pub fn padding_needed_for(&self, align: usize) -> usize {
189+
pub const fn padding_needed_for(&self, align: usize) -> usize {
186190
let len = self.size();
187191

188192
// Rounded up value is:

src/libcore/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#![feature(bound_cloned)]
7171
#![feature(cfg_target_has_atomic)]
7272
#![feature(concat_idents)]
73+
#![feature(const_alloc_layout)]
7374
#![feature(const_if_match)]
7475
#![feature(const_panic)]
7576
#![feature(const_fn_union)]

src/librustc/hir/check_attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//! item.
66
77
use crate::hir::map::Map;
8-
use crate::lint::builtin::UNUSED_ATTRIBUTES;
98
use crate::ty::query::Providers;
109
use crate::ty::TyCtxt;
1110

@@ -16,6 +15,7 @@ use rustc_hir::def_id::DefId;
1615
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
1716
use rustc_hir::DUMMY_HIR_ID;
1817
use rustc_hir::{self, HirId, Item, ItemKind, TraitItem, TraitItemKind};
18+
use rustc_session::lint::builtin::UNUSED_ATTRIBUTES;
1919
use rustc_span::symbol::sym;
2020
use rustc_span::Span;
2121
use syntax::ast::Attribute;

src/librustc/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#![feature(thread_local)]
5050
#![feature(trace_macros)]
5151
#![feature(trusted_len)]
52+
#![feature(vec_remove_item)]
5253
#![feature(stmt_expr_attributes)]
5354
#![feature(integer_atomics)]
5455
#![feature(test)]
@@ -71,8 +72,6 @@ extern crate rustc_data_structures;
7172
#[macro_use]
7273
extern crate log;
7374
#[macro_use]
74-
extern crate syntax;
75-
#[macro_use]
7675
extern crate smallvec;
7776

7877
#[cfg(test)]

0 commit comments

Comments
 (0)