Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #68142

Merged
merged 25 commits into from
Jan 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5e92625
Correctly check for opaque types in `assoc_ty_def`
matthewjasper Jan 4, 2020
088a180
Add suggestions when encountering chained comparisons
varkor Jan 11, 2020
7ba25ac
Revert "Rollup merge of #67727 - Dylan-DPC:stabilise/remove_item, r=a…
tesuji Jan 10, 2020
3a2af32
canonicalize some lint imports
Centril Jan 5, 2020
b93addb
move in_derive_expansion as Span method
Centril Jan 9, 2020
c151782
reduce diversity in linting methods
Centril Jan 9, 2020
6f1a79c
GlobalCtxt: Erase `LintStore` type.
Centril Jan 9, 2020
03bdfe9
move logic to LintLevelsBuilder
Centril Jan 9, 2020
f577b44
move LintSource to levels
Centril Jan 9, 2020
eee84fe
move struct_lint_level to levels.rs
Centril Jan 9, 2020
16bf278
inline maybe_lint_level_root
Centril Jan 9, 2020
03dfa64
lints: promote levels.rs to lint.rs & extract passes.rs
Centril Jan 9, 2020
8c12c42
{rustc::lint -> rustc_lint}::internal
Centril Jan 9, 2020
f58db20
move rustc::lint::{context, passes} to rustc_lint.
Centril Jan 9, 2020
b592359
lints: move a comment
Centril Jan 9, 2020
8be2a04
pacify the parallel compiler
Centril Jan 9, 2020
51078ce
fix ui-fulldeps & tests fallout
Centril Jan 10, 2020
c5a9a14
Constify alloc::Layout
lukaslueg Dec 31, 2019
0e1cd59
Galloping search for binary_search_util
llogiq Jan 6, 2020
019790c
Rollup merge of #67494 - lukaslueg:const_alloc, r=oli-obk
Centril Jan 12, 2020
1d9c69f
Rollup merge of #67867 - matthewjasper:opaque-assoc-lookup, r=oli-obk
Centril Jan 12, 2020
1b208b1
Rollup merge of #67948 - llogiq:gallop, r=Mark-Simulacrum
Centril Jan 12, 2020
cc51d03
Rollup merge of #68045 - Centril:liberate-lints, r=Mark-Simulacrum
Centril Jan 12, 2020
bbd210e
Rollup merge of #68089 - lzutao:revert-remote_item, r=sfackler
Centril Jan 12, 2020
82c19b4
Rollup merge of #68108 - varkor:chained-comparison-suggestions, r=Cen…
Centril Jan 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3663,6 +3663,7 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_hir",
Expand Down Expand Up @@ -3788,6 +3789,7 @@ dependencies = [
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_lint",
"rustc_metadata",
"rustc_span",
"syntax",
Expand Down
1 change: 1 addition & 0 deletions src/liballoc/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#![feature(associated_type_bounds)]
#![feature(binary_heap_into_iter_sorted)]
#![feature(binary_heap_drain_sorted)]
#![feature(vec_remove_item)]

use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
Expand Down
3 changes: 2 additions & 1 deletion src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1696,13 +1696,14 @@ impl<T> Vec<T> {
/// # Examples
///
/// ```
/// # #![feature(vec_remove_item)]
/// let mut vec = vec![1, 2, 3, 1];
///
/// vec.remove_item(&1);
///
/// assert_eq!(vec, vec![2, 3, 1]);
/// ```
#[stable(feature = "vec_remove_item", since = "1.42.0")]
#[unstable(feature = "vec_remove_item", reason = "recently added", issue = "40062")]
pub fn remove_item<V>(&mut self, item: &V) -> Option<T>
where
T: PartialEq<V>,
Expand Down
12 changes: 8 additions & 4 deletions src/libcore/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ impl Layout {
/// must not overflow (i.e., the rounded value must be less than
/// `usize::MAX`).
#[stable(feature = "alloc_layout", since = "1.28.0")]
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
#[inline]
pub fn from_size_align(size: usize, align: usize) -> Result<Self, LayoutErr> {
pub const fn from_size_align(size: usize, align: usize) -> Result<Self, LayoutErr> {
if !align.is_power_of_two() {
return Err(LayoutErr { private: () });
}
Expand Down Expand Up @@ -106,15 +107,17 @@ impl Layout {

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

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

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

// Rounded up value is:
Expand Down
1 change: 1 addition & 0 deletions src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#![feature(bound_cloned)]
#![feature(cfg_target_has_atomic)]
#![feature(concat_idents)]
#![feature(const_alloc_layout)]
#![feature(const_if_match)]
#![feature(const_panic)]
#![feature(const_fn_union)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//! item.

use crate::hir::map::Map;
use crate::lint::builtin::UNUSED_ATTRIBUTES;
use crate::ty::query::Providers;
use crate::ty::TyCtxt;

Expand All @@ -16,6 +15,7 @@ use rustc_hir::def_id::DefId;
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc_hir::DUMMY_HIR_ID;
use rustc_hir::{self, HirId, Item, ItemKind, TraitItem, TraitItemKind};
use rustc_session::lint::builtin::UNUSED_ATTRIBUTES;
use rustc_span::symbol::sym;
use rustc_span::Span;
use syntax::ast::Attribute;
Expand Down
3 changes: 1 addition & 2 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#![feature(thread_local)]
#![feature(trace_macros)]
#![feature(trusted_len)]
#![feature(vec_remove_item)]
#![feature(stmt_expr_attributes)]
#![feature(integer_atomics)]
#![feature(test)]
Expand All @@ -71,8 +72,6 @@ extern crate rustc_data_structures;
#[macro_use]
extern crate log;
#[macro_use]
extern crate syntax;
#[macro_use]
extern crate smallvec;

#[cfg(test)]
Expand Down
Loading