Skip to content

Commit a5fae1d

Browse files
committed
auto merge of #5290 : bstrie/rust/dis, r=pcwalton
2 parents ddecef7 + fdf69dd commit a5fae1d

File tree

13 files changed

+28
-22
lines changed

13 files changed

+28
-22
lines changed

src/libcore/core.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Implicitly, all crates behave as if they included the following prologue:
5151
#[warn(vecs_implicitly_copyable)];
5252
#[deny(non_camel_case_types)];
5353
#[allow(deprecated_mutable_fields)];
54+
#[deny(deprecated_self)];
5455

5556
// On Linux, link to the runtime with -lrt.
5657
#[cfg(target_os = "linux")]

src/libfuzzer/fuzzer.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#[allow(non_camel_case_types)];
2626
#[allow(deprecated_mode)];
2727
#[allow(deprecated_pattern)];
28+
#[deny(deprecated_self)];
2829

2930
extern mod core(vers = "0.6");
3031
extern mod std(vers = "0.6");

src/librust/rust.rc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// XXX: Make commands run and test emit proper file endings on winds
1313
// XXX: Make run only accept source that emits an executable
1414

15+
#[deny(deprecated_self)];
16+
1517
#[link(name = "rust",
1618
vers = "0.6",
1719
uuid = "4a24da33-5cc8-4037-9352-2cbe9bd9d27c",

src/librustc/middle/astencode.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -721,12 +721,12 @@ impl vtable_decoder_helpers for reader::Decoder {
721721
// Encoding and decoding the side tables
722722
723723
trait get_ty_str_ctxt {
724-
fn ty_str_ctxt() -> @tyencode::ctxt;
724+
fn ty_str_ctxt(@self) -> @tyencode::ctxt;
725725
}
726726
727-
impl get_ty_str_ctxt for @e::EncodeContext {
727+
impl get_ty_str_ctxt for e::EncodeContext {
728728
// IMPLICIT SELF WARNING: fix this!
729-
fn ty_str_ctxt() -> @tyencode::ctxt {
729+
fn ty_str_ctxt(@self) -> @tyencode::ctxt {
730730
@tyencode::ctxt {diag: self.tcx.sess.diagnostic(),
731731
ds: e::def_to_str,
732732
tcx: self.tcx,

src/librustc/middle/liveness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ pub impl Liveness {
816816
}
817817
}
818818

819-
fn indices2(ln: LiveNode, succ_ln: LiveNode,
819+
fn indices2(&self, ln: LiveNode, succ_ln: LiveNode,
820820
op: fn(uint, uint)) {
821821
let node_base_idx = self.idx(ln, Variable(0u));
822822
let succ_base_idx = self.idx(succ_ln, Variable(0u));

src/librustc/middle/resolve.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ pub impl NameBindings {
592592
}
593593
594594
/// Returns the module node if applicable.
595-
fn get_module_if_available() -> Option<@mut Module> {
595+
fn get_module_if_available(&self) -> Option<@mut Module> {
596596
match self.type_def {
597597
Some(ref type_def) => (*type_def).module_def,
598598
None => None
@@ -613,14 +613,14 @@ pub impl NameBindings {
613613
}
614614
}
615615
616-
fn defined_in_namespace(namespace: Namespace) -> bool {
616+
fn defined_in_namespace(&self, namespace: Namespace) -> bool {
617617
match namespace {
618618
TypeNS => return self.type_def.is_some(),
619619
ValueNS => return self.value_def.is_some()
620620
}
621621
}
622622
623-
fn defined_in_public_namespace(namespace: Namespace) -> bool {
623+
fn defined_in_public_namespace(&self, namespace: Namespace) -> bool {
624624
match namespace {
625625
TypeNS => match self.type_def {
626626
Some(def) => def.privacy != Private,
@@ -633,7 +633,7 @@ pub impl NameBindings {
633633
}
634634
}
635635
636-
fn def_for_namespace(namespace: Namespace) -> Option<def> {
636+
fn def_for_namespace(&self, namespace: Namespace) -> Option<def> {
637637
match namespace {
638638
TypeNS => {
639639
match self.type_def {
@@ -666,7 +666,7 @@ pub impl NameBindings {
666666
}
667667
}
668668
669-
fn privacy_for_namespace(namespace: Namespace) -> Option<Privacy> {
669+
fn privacy_for_namespace(&self, namespace: Namespace) -> Option<Privacy> {
670670
match namespace {
671671
TypeNS => {
672672
match self.type_def {
@@ -683,7 +683,7 @@ pub impl NameBindings {
683683
}
684684
}
685685
686-
fn span_for_namespace(namespace: Namespace) -> Option<span> {
686+
fn span_for_namespace(&self, namespace: Namespace) -> Option<span> {
687687
if self.defined_in_namespace(namespace) {
688688
match namespace {
689689
TypeNS => self.type_span,

src/librustc/middle/typeck/check/method.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ pub impl LookupContext/&self {
235235
self.search_for_autosliced_method(self_ty, autoderefs)
236236
}
237237

238-
fn deref(ty: ty::t, enum_dids: &mut ~[ast::def_id]) -> Option<ty::t> {
238+
fn deref(&self, ty: ty::t, enum_dids: &mut ~[ast::def_id])
239+
-> Option<ty::t> {
239240
match ty::get(ty).sty {
240241
ty_enum(did, _) => {
241242
// Watch out for newtype'd enums like "enum t = @T".
@@ -599,7 +600,7 @@ pub impl LookupContext/&self {
599600
}
600601
}
601602

602-
fn push_inherent_impl_candidates_for_type(did: def_id) {
603+
fn push_inherent_impl_candidates_for_type(&self, did: def_id) {
603604
let opt_impl_infos =
604605
self.fcx.ccx.coherence_info.inherent_methods.find(&did);
605606
for opt_impl_infos.each |impl_infos| {

src/librustc/middle/typeck/coherence.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,14 @@ pub struct CoherenceChecker {
191191
}
192192
193193
pub impl CoherenceChecker {
194-
// IMPLICIT SELF WARNING: fix this!
195-
fn check_coherence(crate: @crate) {
194+
fn check_coherence(self, crate: @crate) {
196195
// Check implementations and traits. This populates the tables
197196
// containing the inherent methods and extension methods. It also
198197
// builds up the trait inheritance table.
199198
visit_crate(*crate, (), mk_simple_visitor(@SimpleVisitor {
200199
visit_item: |item| {
201-
debug!("(checking coherence) item '%s'",
202-
*self.crate_context.tcx.sess.str_of(item.ident));
200+
// debug!("(checking coherence) item '%s'",
201+
// self.crate_context.tcx.sess.str_of(item.ident));
203202
204203
match item.node {
205204
item_impl(_, opt_trait, _, _) => {
@@ -617,8 +616,7 @@ pub impl CoherenceChecker {
617616
}
618617

619618
// Privileged scope checking
620-
// IMPLICIT SELF WARNING: fix this!
621-
fn check_privileged_scopes(crate: @crate) {
619+
fn check_privileged_scopes(self, crate: @crate) {
622620
visit_crate(*crate, (), mk_vt(@Visitor {
623621
visit_item: |item, _context, visitor| {
624622
match /*bad*/copy item.node {

src/librustc/middle/typeck/infer/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ pub impl @mut InferCtxt {
584584
}
585585

586586
/// Execute `f` and commit the bindings if successful
587-
fn commit<T,E>(f: fn() -> Result<T,E>) -> Result<T,E> {
587+
fn commit<T,E>(&self, f: fn() -> Result<T,E>) -> Result<T,E> {
588588
fail_unless!(!self.in_snapshot());
589589

590590
debug!("commit()");
@@ -599,7 +599,7 @@ pub impl @mut InferCtxt {
599599
}
600600

601601
/// Execute `f`, unroll bindings on failure
602-
fn try<T,E>(f: fn() -> Result<T,E>) -> Result<T,E> {
602+
fn try<T,E>(&self, f: fn() -> Result<T,E>) -> Result<T,E> {
603603
debug!("try()");
604604
do indent {
605605
let snapshot = self.start_snapshot();
@@ -613,7 +613,7 @@ pub impl @mut InferCtxt {
613613
}
614614

615615
/// Execute `f` then unroll any bindings it creates
616-
fn probe<T,E>(f: fn() -> Result<T,E>) -> Result<T,E> {
616+
fn probe<T,E>(&self, f: fn() -> Result<T,E>) -> Result<T,E> {
617617
debug!("probe()");
618618
do indent {
619619
let snapshot = self.start_snapshot();

src/librustc/rustc.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#[allow(non_camel_case_types)];
2525
#[allow(deprecated_mode)];
2626
#[warn(deprecated_pattern)];
27-
#[allow(deprecated_self)];
27+
#[deny(deprecated_self)];
2828

2929
#[no_core];
3030

src/librustdoc/rustdoc.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#[no_core];
2323

2424
#[allow(non_implicitly_copyable_typarams)];
25+
#[deny(deprecated_self)];
2526

2627
extern mod core(vers = "0.6");
2728
extern mod std(vers = "0.6");

src/librusti/rusti.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#[allow(vecs_implicitly_copyable,
2424
non_implicitly_copyable_typarams)];
25+
#[deny(deprecated_self)];
2526

2627
extern mod core(vers = "0.6");
2728
extern mod std(vers = "0.6");

src/librustpkg/rustpkg.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#[no_core];
2121
#[allow(vecs_implicitly_copyable,
2222
non_implicitly_copyable_typarams)];
23+
#[deny(deprecated_self)];
2324

2425
extern mod core(vers = "0.6");
2526
extern mod std(vers = "0.6");

0 commit comments

Comments
 (0)