Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
962bf69
Take substs into account in `conservative_is_privately_uninhabited`
varkor Jun 30, 2019
5397dfc
Remove obsolete “should not have to exist” reasons
SimonSapin Jul 8, 2019
01d93bf
Split the SliceConcat trait into Concat and Join
SimonSapin Jul 8, 2019
283f676
Take separator by value in `[T]::join`
SimonSapin Jul 8, 2019
b62a77b
Add joining slices of slices with a slice separator, not just a singl…
SimonSapin Jul 8, 2019
d0635ee
Update src/liballoc/slice.rs
SimonSapin Jul 9, 2019
bbc9366
Update src/liballoc/slice.rs
SimonSapin Jul 9, 2019
5f7768a
Update src/liballoc/str.rs
SimonSapin Jul 9, 2019
dee3d27
allow clippy::unreadable_literal in unicode tables
euclio Jun 23, 2019
3427a14
Remove support for -Zlower-128bit-ops
bjorn3 Jul 19, 2019
e8a1e73
Update compiler_builtins to 0.1.18
bjorn3 Jul 20, 2019
21b502b
warn that raw pointers must be aligned when used, and that writes cau…
RalfJung Jul 20, 2019
2e6b13a
references must be aligned; also move up the warning that fn ptrs mus…
RalfJung Jul 20, 2019
93de733
Remove tests for -Zlower-128bit-ops
bjorn3 Jul 20, 2019
f502bf7
sync with nomicon: raw ptr must be non-dangling and aligned every tim…
RalfJung Jul 21, 2019
4081222
apply feedback
RalfJung Jul 21, 2019
a7b9246
weasle, weasle
RalfJung Jul 22, 2019
9196781
account for non-drop-glue types
RalfJung Jul 22, 2019
f78cd4d
Fix building_llvm in sanity check, add swig sanity check.
golddranks Jun 16, 2019
ba78db3
libsyntax: factor out file path resolving
jonas-schievink May 14, 2019
138e08c
Make #[doc(include)] paths behave like other paths
jonas-schievink May 18, 2019
1cc7c21
Adjust docs to new #[doc(include)] behaviour
jonas-schievink May 19, 2019
8ccf52c
stage0 -> bootstrap
jonas-schievink Jun 22, 2019
edb2187
Make path::resolve a method on ExtCtxt
jonas-schievink Jun 22, 2019
7c42259
Update stdarch submodule
jonas-schievink Jul 17, 2019
dd5045e
Apply suggestions from code review
RalfJung Jul 23, 2019
65cf10d
word things more like we usually do
RalfJung Jul 23, 2019
218ab4c
Update test
jonas-schievink Jul 23, 2019
fe4cdd3
Disable d32 on armv6 hf targets
nikic Jul 23, 2019
71717b9
Initialize the MSP430 AsmParser if available
nikic Jul 23, 2019
bd8813e
Add method disambiguation help for trait implementation
iluuu1994 Jul 23, 2019
be510db
Adjust tests for method disambiguation help
iluuu1994 Jul 24, 2019
a93fdfe
Merge `rustc_allocator` into `libsyntax_ext`
petrochenkov Jul 16, 2019
4330241
syntax_ext: Turn `#[global_allocator]` into a regular attribute macro
petrochenkov Jul 18, 2019
76b1ffa
syntax_ext: Reuse built-in attribute template checking for macro attr…
petrochenkov Jul 18, 2019
bf8fc8a
syntax_ext: Improve and simplify code generated by `#[global_allocator]`
petrochenkov Jul 18, 2019
6e4f161
Demote template check error to a lint for `#[test]` and `#[bench]`
petrochenkov Jul 20, 2019
a0c2c64
Fix rebase
petrochenkov Jul 20, 2019
c091818
Use match ergonomics in Condvar documentation
KevinWMatthews Jul 24, 2019
49e111a
Rollup merge of #60938 - jonas-schievink:doc-include-paths, r=petroch…
Centril Jul 24, 2019
a3a4c7c
Rollup merge of #61890 - golddranks:fix_sanity_check_llvm, r=Dylan-DPC
Centril Jul 24, 2019
59fb997
Rollup merge of #62084 - euclio:unicode-table-tweak, r=kennytm
Centril Jul 24, 2019
c82c77d
Rollup merge of #62261 - varkor:conservative_is_privately_uninhabited…
Centril Jul 24, 2019
7a308b8
Rollup merge of #62528 - SimonSapin:concat, r=alexcrichton
Centril Jul 24, 2019
1072458
Rollup merge of #62735 - petrochenkov:galloc, r=alexcrichton
Centril Jul 24, 2019
14a2161
Rollup merge of #62801 - bjorn3:remove_lower_128bit_ops, r=alexcrichton
Centril Jul 24, 2019
a6a0122
Rollup merge of #62822 - RalfJung:pointers, r=Centril
Centril Jul 24, 2019
a8acd87
Rollup merge of #62904 - nikic:arm-d32, r=alexcrichton
Centril Jul 24, 2019
fc18744
Rollup merge of #62907 - nikic:msp430-asmparser, r=alexcrichton
Centril Jul 24, 2019
17fd31b
Rollup merge of #62921 - iluuu1994:improve-help-for-method-disambigua…
Centril Jul 24, 2019
5647078
Rollup merge of #62942 - KevinWMatthews:condvar_docs_match_ergo, r=sf…
Centril Jul 24, 2019
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
Prev Previous commit
Next Next commit
Merge rustc_allocator into libsyntax_ext
  • Loading branch information
petrochenkov committed Jul 24, 2019
commit a93fdfedf36dcb909d90cbf963b087c5873bec1d
18 changes: 0 additions & 18 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2751,20 +2751,6 @@ dependencies = [
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "rustc_allocator"
version = "0.0.0"
dependencies = [
"log 0.4.6 (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",
"smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
"syntax 0.0.0",
"syntax_pos 0.0.0",
]

[[package]]
name = "rustc_apfloat"
version = "0.0.0"
Expand Down Expand Up @@ -2822,7 +2808,6 @@ dependencies = [
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_allocator 0.0.0",
"rustc_apfloat 0.0.0",
"rustc_codegen_utils 0.0.0",
"rustc_data_structures 0.0.0",
Expand Down Expand Up @@ -2883,7 +2868,6 @@ dependencies = [
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc-rayon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_allocator 0.0.0",
"rustc_ast_borrowck 0.0.0",
"rustc_codegen_utils 0.0.0",
"rustc_data_structures 0.0.0",
Expand All @@ -2904,7 +2888,6 @@ dependencies = [
"serialize 0.0.0",
"smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
"syntax 0.0.0",
"syntax_ext 0.0.0",
"syntax_pos 0.0.0",
]

Expand Down Expand Up @@ -2948,7 +2931,6 @@ dependencies = [
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc-rayon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_allocator 0.0.0",
"rustc_ast_borrowck 0.0.0",
"rustc_codegen_ssa 0.0.0",
"rustc_codegen_utils 0.0.0",
Expand Down
1 change: 0 additions & 1 deletion src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ pub mod infer;
pub mod lint;

pub mod middle {
pub mod allocator;
pub mod borrowck;
pub mod expr_use_visitor;
pub mod cstore;
Expand Down
16 changes: 0 additions & 16 deletions src/librustc/middle/allocator.rs

This file was deleted.

2 changes: 1 addition & 1 deletion src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use rustc_data_structures::fingerprint::Fingerprint;

use crate::lint;
use crate::lint::builtin::BuiltinLintDiagnostics;
use crate::middle::allocator::AllocatorKind;
use crate::middle::dependency_format;
use crate::session::config::{OutputType, PrintRequest, SwitchWithOptPath};
use crate::session::search_paths::{PathKind, SearchPath};
Expand All @@ -27,6 +26,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::feature_gate::{self, AttributeType};
use syntax::json::JsonEmitter;
use syntax::source_map;
Expand Down
19 changes: 0 additions & 19 deletions src/librustc_allocator/Cargo.toml

This file was deleted.

3 changes: 1 addition & 2 deletions src/librustc_codegen_llvm/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ use std::ffi::CString;

use crate::attributes;
use libc::c_uint;
use rustc::middle::allocator::AllocatorKind;
use rustc::ty::TyCtxt;
use rustc_allocator::{ALLOCATOR_METHODS, AllocatorTy};
use syntax::ext::allocator::{AllocatorKind, AllocatorTy, ALLOCATOR_METHODS};

use crate::ModuleLlvm;
use crate::llvm::{self, False, True};
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_codegen_llvm/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ extern crate flate2;
#[macro_use] extern crate bitflags;
extern crate libc;
#[macro_use] extern crate rustc;
extern crate rustc_allocator;
extern crate rustc_target;
#[macro_use] extern crate rustc_data_structures;
extern crate rustc_incremental;
Expand All @@ -52,13 +51,13 @@ 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_pos::symbol::InternedString;
pub use llvm_util::target_features;
use std::any::Any;
use std::sync::{mpsc, Arc};

use rustc::dep_graph::DepGraph;
use rustc::middle::allocator::AllocatorKind;
use rustc::middle::cstore::{EncodedMetadata, MetadataLoader};
use rustc::session::Session;
use rustc::session::config::{OutputFilenames, OutputType, PrintRequest, OptLevel};
Expand Down
1 change: 0 additions & 1 deletion src/librustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ serialize = { path = "../libserialize" }
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
rustc = { path = "../librustc" }
rustc_allocator = { path = "../librustc_allocator" }
rustc_apfloat = { path = "../librustc_apfloat" }
rustc_codegen_utils = { path = "../librustc_codegen_utils" }
rustc_data_structures = { path = "../librustc_data_structures"}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_codegen_ssa/back/symbol_export.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::collections::hash_map::Entry::*;
use std::sync::Arc;

use rustc::ty::Instance;
Expand All @@ -12,9 +13,8 @@ use rustc::ty::{TyCtxt, SymbolName};
use rustc::ty::query::Providers;
use rustc::ty::subst::SubstsRef;
use rustc::util::nodemap::{FxHashMap, DefIdMap};
use rustc_allocator::ALLOCATOR_METHODS;
use rustc_data_structures::indexed_vec::IndexVec;
use std::collections::hash_map::Entry::*;
use syntax::ext::allocator::ALLOCATOR_METHODS;

pub type ExportedSymbols = FxHashMap<
CrateNum,
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 @@ -3,12 +3,12 @@ use rustc::ty::Ty;

use super::write::WriteBackendMethods;
use super::CodegenObject;
use rustc::middle::allocator::AllocatorKind;
use rustc::middle::cstore::EncodedMetadata;
use rustc::session::{Session, config};
use rustc::ty::TyCtxt;
use rustc_codegen_utils::codegen_backend::CodegenBackend;
use std::sync::Arc;
use syntax::ext::allocator::AllocatorKind;
use syntax_pos::symbol::InternedString;

pub trait BackendTypes {
Expand Down
2 changes: 0 additions & 2 deletions src/librustc_driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ log = "0.4"
env_logger = { version = "0.5", default-features = false }
rayon = { version = "0.2.0", package = "rustc-rayon" }
rustc = { path = "../librustc" }
rustc_allocator = { path = "../librustc_allocator" }
rustc_target = { path = "../librustc_target" }
rustc_ast_borrowck = { path = "../librustc_ast_borrowck" }
rustc_data_structures = { path = "../librustc_data_structures" }
Expand All @@ -37,5 +36,4 @@ rustc_interface = { path = "../librustc_interface" }
serialize = { path = "../libserialize" }
syntax = { path = "../libsyntax" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
syntax_ext = { path = "../libsyntax_ext" }
syntax_pos = { path = "../libsyntax_pos" }
1 change: 0 additions & 1 deletion src/librustc_interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ syntax_ext = { path = "../libsyntax_ext" }
syntax_pos = { path = "../libsyntax_pos" }
serialize = { path = "../libserialize" }
rustc = { path = "../librustc" }
rustc_allocator = { path = "../librustc_allocator" }
rustc_ast_borrowck = { path = "../librustc_ast_borrowck" }
rustc_incremental = { path = "../librustc_incremental" }
rustc_traits = { path = "../librustc_traits" }
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_interface/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ fn configure_and_expand_inner<'a>(
if has_global_allocator {
// Expand global allocators, which are treated as an in-tree proc macro
time(sess, "creating allocators", || {
allocator::expand::modify(
syntax_ext::global_allocator::modify(
&sess.parse_sess,
&mut resolver,
&mut krate,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use rustc_data_structures::sync::{Lrc, RwLock, Lock};

use rustc::hir::def_id::CrateNum;
use rustc_data_structures::svh::Svh;
use rustc::middle::allocator::AllocatorKind;
use rustc::middle::cstore::DepKind;
use rustc::mir::interpret::AllocDecodingState;
use rustc::session::{Session, CrateDisambiguator};
Expand All @@ -26,6 +25,7 @@ use std::{cmp, fs};

use syntax::ast;
use syntax::attr;
use syntax::ext::allocator::AllocatorKind;
use syntax::ext::base::{SyntaxExtension, SyntaxExtensionKind};
use syntax::symbol::{Symbol, sym};
use syntax::visit;
Expand Down
47 changes: 28 additions & 19 deletions src/librustc_allocator/lib.rs → src/libsyntax/ext/allocator.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
#![feature(nll)]
#![feature(rustc_private)]
#[derive(Clone, Copy)]
pub enum AllocatorKind {
Global,
DefaultLib,
DefaultExe,
}

#![deny(rust_2018_idioms)]
#![deny(unused_lifetimes)]
impl AllocatorKind {
pub fn fn_name(&self, base: &str) -> String {
match *self {
AllocatorKind::Global => format!("__rg_{}", base),
AllocatorKind::DefaultLib => format!("__rdl_{}", base),
AllocatorKind::DefaultExe => format!("__rde_{}", base),
}
}
}

pub mod expand;
pub enum AllocatorTy {
Layout,
Ptr,
ResultPtr,
Unit,
Usize,
}

pub struct AllocatorMethod {
pub name: &'static str,
pub inputs: &'static [AllocatorTy],
pub output: AllocatorTy,
}

pub static ALLOCATOR_METHODS: &[AllocatorMethod] = &[
AllocatorMethod {
Expand All @@ -28,17 +51,3 @@ pub static ALLOCATOR_METHODS: &[AllocatorMethod] = &[
output: AllocatorTy::ResultPtr,
},
];

pub struct AllocatorMethod {
pub name: &'static str,
pub inputs: &'static [AllocatorTy],
pub output: AllocatorTy,
}

pub enum AllocatorTy {
Layout,
Ptr,
ResultPtr,
Unit,
Usize,
}
1 change: 1 addition & 0 deletions src/libsyntax/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ pub mod print {

pub mod ext {
pub use syntax_pos::hygiene;
pub mod allocator;
pub mod base;
pub mod build;
pub mod derive;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use log::debug;
use rustc::middle::allocator::AllocatorKind;
use smallvec::{smallvec, SmallVec};
use syntax::{
ast::{
Expand All @@ -11,6 +10,7 @@ use syntax::{
respan, ExpnInfo, ExpnKind,
},
ext::{
allocator::{AllocatorKind, AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS},
base::{ExtCtxt, MacroKind, Resolver},
build::AstBuilder,
expand::ExpansionConfig,
Expand All @@ -23,14 +23,12 @@ use syntax::{
};
use syntax_pos::Span;

use crate::{AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS};

pub fn modify(
sess: &ParseSess,
resolver: &mut dyn Resolver,
krate: &mut Crate,
crate_name: String,
handler: &rustc_errors::Handler,
handler: &errors::Handler,
) {
ExpandAllocatorDirectives {
handler,
Expand All @@ -44,7 +42,7 @@ pub fn modify(

struct ExpandAllocatorDirectives<'a> {
found: bool,
handler: &'a rustc_errors::Handler,
handler: &'a errors::Handler,
sess: &'a ParseSess,
resolver: &'a mut dyn Resolver,
crate_name: Option<String>,
Expand Down
1 change: 1 addition & 0 deletions src/libsyntax_ext/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ mod test_case;
mod trace_macros;

pub mod deriving;
pub mod global_allocator;
pub mod proc_macro_decls;
pub mod proc_macro_impl;

Expand Down