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 14 pull requests #53309

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
78a1c45
run-pass/simd-intrinsic-float-minmax: Force use of qNaN on Mips
Jul 31, 2018
b3d2346
unsized ManuallyDrop
RalfJung Aug 3, 2018
3dcdb8a
remove unnecessary CoerceUnsized impl
RalfJung Aug 6, 2018
d865adc
unconfuse @eddyb
RalfJung Aug 6, 2018
5ee5a7e
repr(transparent)
RalfJung Aug 9, 2018
c9aca02
Don't panic on std::env::vars() when env in null.
BurntPizza Aug 8, 2018
6563803
Don't set rlimit to a lower value than the current
varkor Aug 9, 2018
82a704a
Add a safety check for compiletest rlimit
varkor Aug 9, 2018
1aa6c23
Feature gate where clauses on associated type impls
varkor Aug 9, 2018
898950c
targets: aarch64: Add bare-metal aarch64 target
andre-richter Aug 9, 2018
763e721
rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5.
cuviper Aug 9, 2018
176f8c2
Removed `raw_identifiers` feature gate.
alexreg Aug 9, 2018
44af068
Remove statics field from CodegenCx
bjorn3 Aug 11, 2018
535bd13
A few cleanups for fmt_macros, graphviz, apfloat, target, serialize a…
ljedrz Aug 10, 2018
66fd1eb
Make LLVM emit assembly comments with -Z asm-comments.
whitequark Aug 12, 2018
5937048
Move SmallVec and ThinVec out of libsyntax
ljedrz Aug 5, 2018
40d9bd0
A few cleanups and minor improvements for the lexer
ljedrz Aug 12, 2018
5dd8ed0
Re-enable a bunch of debuginfo tests.
michaelwoerister Aug 7, 2018
ef90ad9
Rollup merge of #53085 - ljedrz:cleanup_syntax_structures, r=ljedrz
kennytm Aug 13, 2018
81b8fdd
Rollup merge of #53154 - michaelwoerister:reenable-some-debuginfo-tes…
kennytm Aug 13, 2018
cabe191
Rollup merge of #53208 - BurntPizza:protect-the-environment, r=alexcr…
kennytm Aug 13, 2018
08efa99
Rollup merge of #53229 - varkor:rlimits_min, r=nikomatsakis
kennytm Aug 13, 2018
f38fa90
Rollup merge of #53233 - andre-richter:master, r=alexcrichton
kennytm Aug 13, 2018
c6eebd9
Rollup merge of #53235 - varkor:gat_impl_where, r=estebank
kennytm Aug 13, 2018
5931aa7
Rollup merge of #53236 - alexreg:stabilise-raw-idents, r=cramertj
kennytm Aug 13, 2018
be77e34
Rollup merge of #53239 - cuviper:llvm5-closure-alloca, r=eddyb
kennytm Aug 13, 2018
de7b89d
Rollup merge of #53274 - bjorn3:remove_statics_field, r=nagisa
kennytm Aug 13, 2018
f6493dd
Rollup merge of #53289 - ljedrz:improve_lexer, r=michaelwoerister
kennytm Aug 13, 2018
203450f
Rollup merge of #53290 - whitequark:fix-35741, r=nagisa
kennytm Aug 13, 2018
c80cf1a
Rollup merge of #52895 - draganmladjenovic:minmax_qnan, r=alexcrichton
kennytm Aug 14, 2018
6212062
Rollup merge of #53033 - RalfJung:manually_dro, r=SimonSapin
kennytm Aug 14, 2018
092475f
Rollup merge of #53246 - ljedrz:cleanup_various, r=kennytm
kennytm Aug 14, 2018
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
1 change: 1 addition & 0 deletions src/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2049,6 +2049,7 @@ version = "0.0.0"
dependencies = [
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_errors 0.0.0",
"rustc_target 0.0.0",
"syntax 0.0.0",
Expand Down
9 changes: 6 additions & 3 deletions src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,8 @@ pub fn discriminant<T>(v: &T) -> Discriminant<T> {
#[stable(feature = "manually_drop", since = "1.20.0")]
#[lang = "manually_drop"]
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct ManuallyDrop<T> {
#[repr(transparent)]
pub struct ManuallyDrop<T: ?Sized> {
value: T,
}

Expand Down Expand Up @@ -990,7 +991,9 @@ impl<T> ManuallyDrop<T> {
pub fn into_inner(slot: ManuallyDrop<T>) -> T {
slot.value
}
}

impl<T: ?Sized> ManuallyDrop<T> {
/// Manually drops the contained value.
///
/// # Safety
Expand All @@ -1006,7 +1009,7 @@ impl<T> ManuallyDrop<T> {
}

#[stable(feature = "manually_drop", since = "1.20.0")]
impl<T> Deref for ManuallyDrop<T> {
impl<T: ?Sized> Deref for ManuallyDrop<T> {
type Target = T;
#[inline]
fn deref(&self) -> &Self::Target {
Expand All @@ -1015,7 +1018,7 @@ impl<T> Deref for ManuallyDrop<T> {
}

#[stable(feature = "manually_drop", since = "1.20.0")]
impl<T> DerefMut for ManuallyDrop<T> {
impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.value
Expand Down
5 changes: 5 additions & 0 deletions src/libcore/tests/manually_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ fn smoke() {

let x = ManuallyDrop::new(TypeWithDrop);
drop(x);

// also test unsizing
let x : Box<ManuallyDrop<[TypeWithDrop]>> =
Box::new(ManuallyDrop::new([TypeWithDrop, TypeWithDrop]));
drop(x);
}
12 changes: 5 additions & 7 deletions src/libfmt_macros/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ impl<'a> Parser<'a> {

// fill character
if let Some(&(_, c)) = self.cur.peek() {
match self.cur.clone().skip(1).next() {
match self.cur.clone().nth(1) {
Some((_, '>')) | Some((_, '<')) | Some((_, '^')) => {
spec.fill = Some(c);
self.cur.next();
Expand Down Expand Up @@ -504,13 +504,11 @@ impl<'a> Parser<'a> {
if word.is_empty() {
self.cur = tmp;
CountImplied
} else if self.consume('$') {
CountIsName(word)
} else {
if self.consume('$') {
CountIsName(word)
} else {
self.cur = tmp;
CountImplied
}
self.cur = tmp;
CountImplied
}
}
}
Expand Down
11 changes: 6 additions & 5 deletions src/libgraphviz/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ impl<'a> Id<'a> {
if !name.chars().all(|c| c.is_ascii_alphanumeric() || c == '_' ) {
return Err(());
}
return Ok(Id { name: name });

Ok(Id { name })
}

pub fn as_slice(&'a self) -> &'a str {
Expand Down Expand Up @@ -533,10 +534,10 @@ impl<'a> LabelText<'a> {
/// Renders text as string suitable for a label in a .dot file.
/// This includes quotes or suitable delimiters.
pub fn to_dot_string(&self) -> String {
match self {
&LabelStr(ref s) => format!("\"{}\"", s.escape_default()),
&EscStr(ref s) => format!("\"{}\"", LabelText::escape_str(&s)),
&HtmlStr(ref s) => format!("<{}>", s),
match *self {
LabelStr(ref s) => format!("\"{}\"", s.escape_default()),
EscStr(ref s) => format!("\"{}\"", LabelText::escape_str(&s)),
HtmlStr(ref s) => format!("<{}>", s),
}
}

Expand Down
25 changes: 13 additions & 12 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ use lint::builtin::{self, PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES,
ELIDED_LIFETIMES_IN_PATHS};
use middle::cstore::CrateStore;
use rustc_data_structures::indexed_vec::IndexVec;
use rustc_data_structures::small_vec::OneVector;
use rustc_data_structures::thin_vec::ThinVec;
use session::Session;
use util::common::FN_OUTPUT_NAME;
use util::nodemap::{DefIdMap, NodeMap};
Expand All @@ -71,7 +73,6 @@ use syntax::std_inject;
use syntax::symbol::{keywords, Symbol};
use syntax::tokenstream::{Delimited, TokenStream, TokenTree};
use syntax::parse::token::Token;
use syntax::util::small_vector::SmallVector;
use syntax::visit::{self, Visitor};
use syntax_pos::{Span, MultiSpan};

Expand Down Expand Up @@ -3136,12 +3137,12 @@ impl<'a> LoweringContext<'a> {
&mut self,
decl: &FnDecl,
header: &FnHeader,
ids: &mut SmallVector<hir::ItemId>,
ids: &mut OneVector<hir::ItemId>,
) {
if let Some(id) = header.asyncness.opt_return_id() {
ids.push(hir::ItemId { id });
}
struct IdVisitor<'a> { ids: &'a mut SmallVector<hir::ItemId> }
struct IdVisitor<'a> { ids: &'a mut OneVector<hir::ItemId> }
impl<'a, 'b> Visitor<'a> for IdVisitor<'b> {
fn visit_ty(&mut self, ty: &'a Ty) {
match ty.node {
Expand Down Expand Up @@ -3174,36 +3175,36 @@ impl<'a> LoweringContext<'a> {
}
}

fn lower_item_id(&mut self, i: &Item) -> SmallVector<hir::ItemId> {
fn lower_item_id(&mut self, i: &Item) -> OneVector<hir::ItemId> {
match i.node {
ItemKind::Use(ref use_tree) => {
let mut vec = SmallVector::one(hir::ItemId { id: i.id });
let mut vec = OneVector::one(hir::ItemId { id: i.id });
self.lower_item_id_use_tree(use_tree, i.id, &mut vec);
vec
}
ItemKind::MacroDef(..) => SmallVector::new(),
ItemKind::MacroDef(..) => OneVector::new(),
ItemKind::Fn(ref decl, ref header, ..) => {
let mut ids = SmallVector::one(hir::ItemId { id: i.id });
let mut ids = OneVector::one(hir::ItemId { id: i.id });
self.lower_impl_trait_ids(decl, header, &mut ids);
ids
},
ItemKind::Impl(.., None, _, ref items) => {
let mut ids = SmallVector::one(hir::ItemId { id: i.id });
let mut ids = OneVector::one(hir::ItemId { id: i.id });
for item in items {
if let ImplItemKind::Method(ref sig, _) = item.node {
self.lower_impl_trait_ids(&sig.decl, &sig.header, &mut ids);
}
}
ids
},
_ => SmallVector::one(hir::ItemId { id: i.id }),
_ => OneVector::one(hir::ItemId { id: i.id }),
}
}

fn lower_item_id_use_tree(&mut self,
tree: &UseTree,
base_id: NodeId,
vec: &mut SmallVector<hir::ItemId>)
vec: &mut OneVector<hir::ItemId>)
{
match tree.kind {
UseTreeKind::Nested(ref nested_vec) => for &(ref nested, id) in nested_vec {
Expand Down Expand Up @@ -4295,8 +4296,8 @@ impl<'a> LoweringContext<'a> {
}
}

fn lower_stmt(&mut self, s: &Stmt) -> SmallVector<hir::Stmt> {
SmallVector::one(match s.node {
fn lower_stmt(&mut self, s: &Stmt) -> OneVector<hir::Stmt> {
OneVector::one(match s.node {
StmtKind::Local(ref l) => Spanned {
node: hir::StmtKind::Decl(
P(Spanned {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ use syntax::ext::hygiene::SyntaxContext;
use syntax::ptr::P;
use syntax::symbol::{Symbol, keywords};
use syntax::tokenstream::TokenStream;
use syntax::util::ThinVec;
use syntax::util::parser::ExprPrecedence;
use ty::AdtKind;
use ty::query::Providers;

use rustc_data_structures::indexed_vec;
use rustc_data_structures::sync::{ParallelIterator, par_iter, Send, Sync, scope};
use rustc_data_structures::thin_vec::ThinVec;

use serialize::{self, Encoder, Encodable, Decoder, Decodable};
use std::collections::BTreeMap;
Expand Down
1 change: 1 addition & 0 deletions src/librustc_allocator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ test = false

[dependencies]
rustc = { path = "../librustc" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_errors = { path = "../librustc_errors" }
rustc_target = { path = "../librustc_target" }
syntax = { path = "../libsyntax" }
Expand Down
14 changes: 7 additions & 7 deletions src/librustc_allocator/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// except according to those terms.

use rustc::middle::allocator::AllocatorKind;
use rustc_data_structures::small_vec::OneVector;
use rustc_errors;
use syntax::{
ast::{
Expand All @@ -28,8 +29,7 @@ use syntax::{
fold::{self, Folder},
parse::ParseSess,
ptr::P,
symbol::Symbol,
util::small_vector::SmallVector,
symbol::Symbol
};
use syntax_pos::Span;

Expand Down Expand Up @@ -65,7 +65,7 @@ struct ExpandAllocatorDirectives<'a> {
}

impl<'a> Folder for ExpandAllocatorDirectives<'a> {
fn fold_item(&mut self, item: P<Item>) -> SmallVector<P<Item>> {
fn fold_item(&mut self, item: P<Item>) -> OneVector<P<Item>> {
debug!("in submodule {}", self.in_submod);

let name = if attr::contains_name(&item.attrs, "global_allocator") {
Expand All @@ -78,20 +78,20 @@ impl<'a> Folder for ExpandAllocatorDirectives<'a> {
_ => {
self.handler
.span_err(item.span, "allocators must be statics");
return SmallVector::one(item);
return OneVector::one(item);
}
}

if self.in_submod > 0 {
self.handler
.span_err(item.span, "`global_allocator` cannot be used in submodules");
return SmallVector::one(item);
return OneVector::one(item);
}

if self.found {
self.handler
.span_err(item.span, "cannot define more than one #[global_allocator]");
return SmallVector::one(item);
return OneVector::one(item);
}
self.found = true;

Expand Down Expand Up @@ -152,7 +152,7 @@ impl<'a> Folder for ExpandAllocatorDirectives<'a> {
let module = f.cx.monotonic_expander().fold_item(module).pop().unwrap();

// Return the item and new submodule
let mut ret = SmallVector::with_capacity(2);
let mut ret = OneVector::with_capacity(2);
ret.push(item);
ret.push(module);

Expand Down
1 change: 1 addition & 0 deletions src/librustc_allocator/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#[macro_use] extern crate log;
extern crate rustc;
extern crate rustc_data_structures;
extern crate rustc_errors;
extern crate rustc_target;
extern crate syntax;
Expand Down
Loading