Skip to content

Commit

Permalink
Auto merge of #65483 - Centril:rollup-txu60ss, r=Centril
Browse files Browse the repository at this point in the history
Rollup of 8 pull requests

Successful merges:

 - #65094 (Prefer statx on linux if available)
 - #65316 (make File::try_clone produce non-inheritable handles on Windows)
 - #65319 (InterpCx: make memory field public)
 - #65461 (Don't recommend ONCE_INIT in std::sync::Once)
 - #65465 (Move syntax::ext to a syntax_expand and refactor some attribute logic)
 - #65469 (Update libc to 0.2.64)
 - #65475 (add example for type_name)
 - #65478 (fmt::Write is about string slices, not byte slices)

Failed merges:

r? @ghost
  • Loading branch information
bors committed Oct 17, 2019
2 parents c8fa82c + c10e5c4 commit bd0b4f6
Show file tree
Hide file tree
Showing 133 changed files with 965 additions and 638 deletions.
31 changes: 29 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1713,9 +1713,9 @@ checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"

[[package]]
name = "libc"
version = "0.2.62"
version = "0.2.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba"
checksum = "74dfca3d9957906e8d1e6a0b641dc9a59848e793f1da2165889fd4f62d10d79c"
dependencies = [
"rustc-std-workspace-core",
]
Expand Down Expand Up @@ -3112,6 +3112,7 @@ dependencies = [
"serialize",
"smallvec",
"syntax",
"syntax_expand",
"syntax_pos",
]

Expand Down Expand Up @@ -3427,6 +3428,7 @@ dependencies = [
"rustc_target",
"serialize",
"syntax",
"syntax_expand",
"syntax_pos",
"tempfile",
]
Expand Down Expand Up @@ -3559,6 +3561,7 @@ dependencies = [
"serialize",
"smallvec",
"syntax",
"syntax_expand",
"syntax_ext",
"syntax_pos",
"tempfile",
Expand Down Expand Up @@ -3630,6 +3633,7 @@ dependencies = [
"smallvec",
"stable_deref_trait",
"syntax",
"syntax_expand",
"syntax_pos",
]

Expand Down Expand Up @@ -3678,6 +3682,7 @@ dependencies = [
"rustc_index",
"rustc_target",
"syntax",
"syntax_expand",
"syntax_pos",
]

Expand All @@ -3695,6 +3700,7 @@ dependencies = [
"rustc",
"rustc_metadata",
"syntax",
"syntax_expand",
"syntax_pos",
]

Expand Down Expand Up @@ -3723,6 +3729,7 @@ dependencies = [
"rustc_metadata",
"smallvec",
"syntax",
"syntax_expand",
"syntax_pos",
]

Expand Down Expand Up @@ -4336,6 +4343,25 @@ dependencies = [
"syntax_pos",
]

[[package]]
name = "syntax_expand"
version = "0.0.0"
dependencies = [
"bitflags",
"lazy_static 1.3.0",
"log",
"rustc_data_structures",
"rustc_errors",
"rustc_index",
"rustc_lexer",
"rustc_target",
"scoped-tls",
"serialize",
"smallvec",
"syntax",
"syntax_pos",
]

[[package]]
name = "syntax_ext"
version = "0.0.0"
Expand All @@ -4347,6 +4373,7 @@ dependencies = [
"rustc_target",
"smallvec",
"syntax",
"syntax_expand",
"syntax_pos",
]

Expand Down
9 changes: 9 additions & 0 deletions src/libcore/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,15 @@ impl TypeId {
///
/// The current implementation uses the same infrastructure as compiler
/// diagnostics and debuginfo, but this is not guaranteed.
///
/// # Example
///
/// ```rust
/// assert_eq!(
/// std::any::type_name::<Option<String>>(),
/// "core::option::Option<alloc::string::String>",
/// );
/// ```
#[stable(feature = "type_name", since = "1.38.0")]
#[rustc_const_unstable(feature = "const_type_name")]
pub const fn type_name<T: ?Sized>() -> &'static str {
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ pub struct Error;
/// [`io::Write`]: ../../std/io/trait.Write.html
#[stable(feature = "rust1", since = "1.0.0")]
pub trait Write {
/// Writes a slice of bytes into this writer, returning whether the write
/// Writes a string slice into this writer, returning whether the write
/// succeeded.
///
/// This method can only succeed if the entire byte slice was successfully
/// This method can only succeed if the entire string slice was successfully
/// written, and this method will not return until all data has been
/// written or an error occurs.
///
Expand Down
1 change: 1 addition & 0 deletions src/librustc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ rustc_index = { path = "../librustc_index" }
errors = { path = "../librustc_errors", package = "rustc_errors" }
rustc_serialize = { path = "../libserialize", package = "serialize" }
syntax = { path = "../libsyntax" }
syntax_expand = { path = "../libsyntax_expand" }
syntax_pos = { path = "../libsyntax_pos" }
backtrace = "0.3.3"
parking_lot = "0.9"
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::ty;
use crate::util::nodemap::DefIdMap;

use syntax::ast;
use syntax::ext::base::MacroKind;
use syntax_expand::base::MacroKind;
use syntax::ast::NodeId;
use syntax_pos::Span;
use rustc_macros::HashStable;
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ use syntax::ast;
use syntax::ptr::P as AstP;
use syntax::ast::*;
use syntax::errors;
use syntax::ext::base::SpecialDerives;
use syntax::ext::hygiene::ExpnId;
use syntax_expand::base::SpecialDerives;
use syntax::print::pprust;
use syntax::tokenstream::{TokenStream, TokenTree};
use syntax::parse::token::{self, Nonterminal, Token};
use syntax::tokenstream::{TokenStream, TokenTree};
use syntax::sess::ParseSess;
use syntax::source_map::{respan, ExpnData, ExpnKind, DesugaringKind, Spanned};
use syntax::symbol::{kw, sym, Symbol};
use syntax::visit::{self, Visitor};
use syntax_pos::hygiene::ExpnId;
use syntax_pos::Span;

const HIR_ID_COUNTER_LOCKED: u32 = 0xFFFFFFFF;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/lowering/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use smallvec::SmallVec;
use syntax::attr;
use syntax::ast::*;
use syntax::visit::{self, Visitor};
use syntax::ext::base::SpecialDerives;
use syntax_expand::base::SpecialDerives;
use syntax::source_map::{respan, DesugaringKind, Spanned};
use syntax::symbol::{kw, sym};
use syntax_pos::Span;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/map/def_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::hir::map::definitions::*;
use crate::hir::def_id::DefIndex;

use syntax::ast::*;
use syntax::ext::hygiene::ExpnId;
use syntax_expand::hygiene::ExpnId;
use syntax::visit;
use syntax::symbol::{kw, sym};
use syntax::parse::token::{self, Token};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/map/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::borrow::Borrow;
use std::fmt::Write;
use std::hash::Hash;
use syntax::ast;
use syntax::ext::hygiene::ExpnId;
use syntax_expand::hygiene::ExpnId;
use syntax::symbol::{Symbol, sym, InternedString};
use syntax_pos::{Span, DUMMY_SP};

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use rustc_data_structures::svh::Svh;
use rustc_index::vec::IndexVec;
use syntax::ast::{self, Name, NodeId};
use syntax::source_map::Spanned;
use syntax::ext::base::MacroKind;
use syntax_expand::base::MacroKind;
use syntax_pos::{Span, DUMMY_SP};

pub mod blocks;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ich/hcx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::cell::RefCell;

use syntax::ast;
use syntax::source_map::SourceMap;
use syntax::ext::hygiene::SyntaxContext;
use syntax_expand::hygiene::SyntaxContext;
use syntax::symbol::Symbol;
use syntax::tokenstream::DelimSpan;
use syntax_pos::{Span, DUMMY_SP};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ich/impls_syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl_stable_hash_for!(enum ::syntax::ast::AsmDialect {
Intel
});

impl_stable_hash_for!(enum ::syntax::ext::base::MacroKind {
impl_stable_hash_for!(enum ::syntax_expand::base::MacroKind {
Bang,
Attr,
Derive,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use syntax::ast;
use syntax::source_map::{MultiSpan, ExpnKind, DesugaringKind};
use syntax::early_buffered_lints::BufferedEarlyLintId;
use syntax::edition::Edition;
use syntax::ext::base::MacroKind;
use syntax_expand::base::MacroKind;
use syntax::symbol::{Symbol, sym};
use syntax_pos::Span;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use errors::emitter::HumanReadableErrorType;
use errors::annotate_snippet_emitter_writer::{AnnotateSnippetEmitterWriter};
use syntax::ast::{self, NodeId};
use syntax::edition::Edition;
use syntax::ext::allocator::AllocatorKind;
use syntax_expand::allocator::AllocatorKind;
use syntax::feature_gate::{self, AttributeType};
use syntax::json::JsonEmitter;
use syntax::source_map;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use std::{mem, ptr};
use std::ops::Range;
use syntax::ast::{self, Name, Ident, NodeId};
use syntax::attr;
use syntax::ext::hygiene::ExpnId;
use syntax_expand::hygiene::ExpnId;
use syntax::symbol::{kw, sym, Symbol, InternedString};
use syntax_pos::Span;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::ffi::CString;
use crate::attributes;
use libc::c_uint;
use rustc::ty::TyCtxt;
use syntax::ext::allocator::{AllocatorKind, AllocatorTy, ALLOCATOR_METHODS};
use syntax_expand::allocator::{AllocatorKind, AllocatorTy, ALLOCATOR_METHODS};

use crate::ModuleLlvm;
use crate::llvm::{self, False, True};
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_codegen_llvm/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ extern crate rustc_driver as _;

#[macro_use] extern crate log;
extern crate syntax;
extern crate syntax_expand;
extern crate syntax_pos;
extern crate rustc_errors as errors;

Expand All @@ -48,7 +49,7 @@ use rustc_codegen_ssa::back::lto::{SerializedModule, LtoModuleCodegen, ThinModul
use rustc_codegen_ssa::CompiledModule;
use errors::{FatalError, Handler};
use rustc::dep_graph::WorkProduct;
use syntax::ext::allocator::AllocatorKind;
use syntax_expand::allocator::AllocatorKind;
use syntax_pos::symbol::InternedString;
pub use llvm_util::target_features;
use std::any::Any;
Expand Down
1 change: 1 addition & 0 deletions src/librustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tempfile = "3.1"

rustc_serialize = { path = "../libserialize", package = "serialize" }
syntax = { path = "../libsyntax" }
syntax_expand = { path = "../libsyntax_expand" }
syntax_pos = { path = "../libsyntax_pos" }
rustc = { path = "../librustc" }
rustc_apfloat = { path = "../librustc_apfloat" }
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_ssa/back/symbol_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use rustc::ty::query::Providers;
use rustc::ty::subst::SubstsRef;
use rustc::util::nodemap::{FxHashMap, DefIdMap};
use rustc_index::vec::IndexVec;
use syntax::ext::allocator::ALLOCATOR_METHODS;
use syntax_expand::allocator::ALLOCATOR_METHODS;

pub type ExportedSymbols = FxHashMap<
CrateNum,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_ssa/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use rustc_errors::{Handler, Level, FatalError, DiagnosticId, SourceMapperDyn};
use rustc_errors::emitter::{Emitter};
use rustc_target::spec::MergeFunctions;
use syntax::attr;
use syntax::ext::hygiene::ExpnId;
use syntax_expand::hygiene::ExpnId;
use syntax_pos::symbol::{Symbol, sym};
use jobserver::{Client, Acquired};

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_ssa/traits/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc::ty::TyCtxt;
use rustc_codegen_utils::codegen_backend::CodegenBackend;
use std::sync::Arc;
use std::sync::mpsc;
use syntax::ext::allocator::AllocatorKind;
use syntax_expand::allocator::AllocatorKind;
use syntax_pos::symbol::InternedString;

pub trait BackendTypes {
Expand Down
1 change: 1 addition & 0 deletions src/librustc_interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ rayon = { version = "0.3.0", package = "rustc-rayon" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
syntax = { path = "../libsyntax" }
syntax_ext = { path = "../libsyntax_ext" }
syntax_expand = { path = "../libsyntax_expand" }
syntax_pos = { path = "../libsyntax_pos" }
rustc_serialize = { path = "../libserialize", package = "serialize" }
rustc = { path = "../librustc" }
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_interface/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use rustc_traits;
use rustc_typeck as typeck;
use syntax::{self, ast, visit};
use syntax::early_buffered_lints::BufferedEarlyLint;
use syntax::ext::base::{NamedSyntaxExtension, ExtCtxt};
use syntax_expand::base::{NamedSyntaxExtension, ExtCtxt};
use syntax::mut_visit::MutVisitor;
use syntax::parse::{self, PResult};
use syntax::util::node_count::NodeCounter;
Expand Down Expand Up @@ -397,12 +397,12 @@ fn configure_and_expand_inner<'a>(

// Create the config for macro expansion
let features = sess.features_untracked();
let cfg = syntax::ext::expand::ExpansionConfig {
let cfg = syntax_expand::expand::ExpansionConfig {
features: Some(&features),
recursion_limit: *sess.recursion_limit.get(),
trace_mac: sess.opts.debugging_opts.trace_macros,
should_test: sess.opts.test,
..syntax::ext::expand::ExpansionConfig::default(crate_name.to_string())
..syntax_expand::expand::ExpansionConfig::default(crate_name.to_string())
};

let mut ecx = ExtCtxt::new(&sess.parse_sess, cfg, &mut resolver);
Expand Down Expand Up @@ -559,7 +559,7 @@ pub fn lower_to_hir(

// Discard hygiene data, which isn't required after lowering to HIR.
if !sess.opts.debugging_opts.keep_hygiene_data {
syntax::ext::hygiene::clear_syntax_context_map();
syntax_expand::hygiene::clear_syntax_context_map();
}

Ok(hir_forest)
Expand Down
1 change: 1 addition & 0 deletions src/librustc_metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ rustc_index = { path = "../librustc_index" }
rustc_serialize = { path = "../libserialize", package = "serialize" }
stable_deref_trait = "1.0.0"
syntax = { path = "../libsyntax" }
syntax_expand = { path = "../libsyntax_expand" }
syntax_pos = { path = "../libsyntax_pos" }
2 changes: 1 addition & 1 deletion src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::{cmp, fs};

use syntax::ast;
use syntax::attr;
use syntax::ext::allocator::{global_allocator_spans, AllocatorKind};
use syntax_expand::allocator::{global_allocator_spans, AllocatorKind};
use syntax::symbol::{Symbol, sym};
use syntax::{span_err, span_fatal};
use syntax_pos::{Span, DUMMY_SP};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/cstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustc_index::vec::IndexVec;
use rustc::util::nodemap::FxHashMap;
use rustc_data_structures::sync::{Lrc, RwLock, Lock, MetadataRef, AtomicCell};
use syntax::ast;
use syntax::ext::base::SyntaxExtension;
use syntax_expand::base::SyntaxExtension;
use syntax_pos;
use proc_macro::bridge::client::ProcMacro;

Expand Down
4 changes: 2 additions & 2 deletions src/librustc_metadata/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ use syntax::attr;
use syntax::ast::{self, Ident};
use syntax::source_map::{self, respan, Spanned};
use syntax::symbol::{Symbol, sym};
use syntax::ext::base::{MacroKind, SyntaxExtensionKind, SyntaxExtension};
use syntax_expand::base::{MacroKind, SyntaxExtensionKind, SyntaxExtension};
use syntax_pos::{self, Span, BytePos, Pos, DUMMY_SP, symbol::{InternedString}};
use log::debug;
use proc_macro::bridge::client::ProcMacro;
use syntax::ext::proc_macro::{AttrProcMacro, ProcMacroDerive, BangProcMacro};
use syntax_expand::proc_macro::{AttrProcMacro, ProcMacroDerive, BangProcMacro};

crate struct DecodeContext<'a, 'tcx> {
opaque: opaque::Decoder<'a>,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use rustc_data_structures::sync::Lrc;
use std::u32;
use syntax::ast;
use syntax::attr;
use syntax::ext::proc_macro::is_proc_macro_attr;
use syntax_expand::proc_macro::is_proc_macro_attr;
use syntax::source_map::Spanned;
use syntax::symbol::{kw, sym, Ident, Symbol};
use syntax_pos::{self, FileName, SourceFile, Span};
Expand Down
Loading

0 comments on commit bd0b4f6

Please sign in to comment.