librustc: Convert from @Object
to @mut Object
as needed
This commit is contained in:
parent
96254b4090
commit
3aefb9649d
@ -785,7 +785,7 @@ pub fn build_session(sopts: @session::options,
|
||||
pub fn build_session_(sopts: @session::options,
|
||||
cm: @codemap::CodeMap,
|
||||
demitter: diagnostic::Emitter,
|
||||
span_diagnostic_handler: @diagnostic::span_handler)
|
||||
span_diagnostic_handler: @mut diagnostic::span_handler)
|
||||
-> Session {
|
||||
let target_cfg = build_target_config(sopts, demitter);
|
||||
let p_s = parse::new_parse_sess_special_handler(span_diagnostic_handler,
|
||||
|
@ -192,7 +192,7 @@ pub struct Session_ {
|
||||
// For a library crate, this is always none
|
||||
entry_fn: @mut Option<(NodeId, codemap::span)>,
|
||||
entry_type: @mut Option<EntryFnType>,
|
||||
span_diagnostic: @diagnostic::span_handler,
|
||||
span_diagnostic: @mut diagnostic::span_handler,
|
||||
filesearch: @filesearch::FileSearch,
|
||||
building_library: @mut bool,
|
||||
working_dir: Path,
|
||||
@ -261,7 +261,7 @@ impl Session_ {
|
||||
pub fn next_node_id(@self) -> ast::NodeId {
|
||||
return syntax::parse::next_node_id(self.parse_sess);
|
||||
}
|
||||
pub fn diagnostic(@self) -> @diagnostic::span_handler {
|
||||
pub fn diagnostic(@self) -> @mut diagnostic::span_handler {
|
||||
self.span_diagnostic
|
||||
}
|
||||
pub fn debugging_opt(@self, opt: uint) -> bool {
|
||||
|
@ -29,7 +29,7 @@ use syntax::oldvisit;
|
||||
|
||||
// Traverses an AST, reading all the information about use'd crates and extern
|
||||
// libraries necessary for later resolving, typechecking, linking, etc.
|
||||
pub fn read_crates(diag: @span_handler,
|
||||
pub fn read_crates(diag: @mut span_handler,
|
||||
crate: &ast::Crate,
|
||||
cstore: @mut cstore::CStore,
|
||||
filesearch: @FileSearch,
|
||||
@ -74,7 +74,7 @@ fn dump_crates(crate_cache: &[cache_entry]) {
|
||||
}
|
||||
|
||||
fn warn_if_multiple_versions(e: @mut Env,
|
||||
diag: @span_handler,
|
||||
diag: @mut span_handler,
|
||||
crate_cache: &[cache_entry]) {
|
||||
use std::either::*;
|
||||
|
||||
@ -113,7 +113,7 @@ fn warn_if_multiple_versions(e: @mut Env,
|
||||
}
|
||||
|
||||
struct Env {
|
||||
diag: @span_handler,
|
||||
diag: @mut span_handler,
|
||||
filesearch: @FileSearch,
|
||||
cstore: @mut cstore::CStore,
|
||||
os: loader::os,
|
||||
|
@ -55,7 +55,7 @@ pub type encode_inlined_item<'self> = &'self fn(ecx: &EncodeContext,
|
||||
ii: ast::inlined_item);
|
||||
|
||||
pub struct EncodeParams<'self> {
|
||||
diag: @span_handler,
|
||||
diag: @mut span_handler,
|
||||
tcx: ty::ctxt,
|
||||
reexports2: middle::resolve::ExportMap2,
|
||||
item_symbols: &'self HashMap<ast::NodeId, ~str>,
|
||||
@ -82,7 +82,7 @@ struct Stats {
|
||||
}
|
||||
|
||||
pub struct EncodeContext<'self> {
|
||||
diag: @span_handler,
|
||||
diag: @mut span_handler,
|
||||
tcx: ty::ctxt,
|
||||
stats: @mut Stats,
|
||||
reexports2: middle::resolve::ExportMap2,
|
||||
|
@ -43,7 +43,7 @@ pub enum os {
|
||||
}
|
||||
|
||||
pub struct Context {
|
||||
diag: @span_handler,
|
||||
diag: @mut span_handler,
|
||||
filesearch: @FileSearch,
|
||||
span: span,
|
||||
ident: @str,
|
||||
@ -163,7 +163,7 @@ pub fn package_id_from_metas(metas: &[@ast::MetaItem]) -> Option<@str> {
|
||||
}
|
||||
|
||||
pub fn note_linkage_attrs(intr: @ident_interner,
|
||||
diag: @span_handler,
|
||||
diag: @mut span_handler,
|
||||
attrs: ~[ast::Attribute]) {
|
||||
let r = attr::find_linkage_metas(attrs);
|
||||
for mi in r.iter() {
|
||||
|
@ -25,7 +25,7 @@ use syntax::diagnostic::span_handler;
|
||||
use syntax::print::pprust::*;
|
||||
|
||||
pub struct ctxt {
|
||||
diag: @span_handler,
|
||||
diag: @mut span_handler,
|
||||
// Def -> str Callback:
|
||||
ds: @fn(def_id) -> ~str,
|
||||
// The type context.
|
||||
|
@ -301,7 +301,7 @@ enum AnyVisitor {
|
||||
// recursive call can use the original visitor's method, although the
|
||||
// recursing visitor supplied to the method is the item stopping visitor.
|
||||
OldVisitor(oldvisit::vt<@mut Context>, oldvisit::vt<@mut Context>),
|
||||
NewVisitor(@visit::Visitor<()>),
|
||||
NewVisitor(@mut visit::Visitor<()>),
|
||||
}
|
||||
|
||||
struct Context {
|
||||
@ -465,7 +465,7 @@ impl Context {
|
||||
self.visitors.push(OldVisitor(v, item_stopping_visitor(v)));
|
||||
}
|
||||
|
||||
fn add_lint(&mut self, v: @visit::Visitor<()>) {
|
||||
fn add_lint(&mut self, v: @mut visit::Visitor<()>) {
|
||||
self.visitors.push(NewVisitor(v));
|
||||
}
|
||||
|
||||
@ -989,7 +989,7 @@ fn lint_unused_mut() -> oldvisit::vt<@mut Context> {
|
||||
})
|
||||
}
|
||||
|
||||
fn lint_session(cx: @mut Context) -> @visit::Visitor<()> {
|
||||
fn lint_session(cx: @mut Context) -> @mut visit::Visitor<()> {
|
||||
ast_util::id_visitor(|id| {
|
||||
match cx.tcx.sess.lints.pop(&id) {
|
||||
None => {},
|
||||
|
@ -226,13 +226,16 @@ pub enum AutoRef {
|
||||
AutoBorrowFn(Region),
|
||||
|
||||
/// Convert from T to *T
|
||||
AutoUnsafe(ast::mutability)
|
||||
AutoUnsafe(ast::mutability),
|
||||
|
||||
/// Convert from @Trait/~Trait/&Trait to &Trait
|
||||
AutoBorrowObj(Region, ast::mutability),
|
||||
}
|
||||
|
||||
pub type ctxt = @ctxt_;
|
||||
|
||||
struct ctxt_ {
|
||||
diag: @syntax::diagnostic::span_handler,
|
||||
diag: @mut syntax::diagnostic::span_handler,
|
||||
interner: @mut HashMap<intern_key, ~t_box_>,
|
||||
next_id: @mut uint,
|
||||
cstore: @mut metadata::cstore::CStore,
|
||||
|
Loading…
x
Reference in New Issue
Block a user