Skip to content

Commit b019e92

Browse files
committed
---
yaml --- r: 172899 b: refs/heads/batch c: 24ace16 h: refs/heads/master i: 172897: 10fcc3f 172895: eadf5e0 v: v3
1 parent 5f9dfbf commit b019e92

File tree

21 files changed

+87
-505
lines changed

21 files changed

+87
-505
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
3030
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32-
refs/heads/batch: 486f60df8797aa96e0a459227089945d06b88303
32+
refs/heads/batch: 24ace1665a38f575d8bf478fbfadef29ed9f17a9
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 44a287e6eb22ec3c2a687fc156813577464017f7
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928

branches/batch/src/doc/reference.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,13 +2117,6 @@ macro scope.
21172117
destructors from being run twice. Destructors might be run multiple times on
21182118
the same object with this attribute.
21192119
- `doc` - Doc comments such as `/// foo` are equivalent to `#[doc = "foo"]`.
2120-
- `rustc_on_unimplemented` - Write a custom note to be shown along with the error
2121-
when the trait is found to be unimplemented on a type.
2122-
You may use format arguments like `{T}`, `{A}` to correspond to the
2123-
types at the point of use corresponding to the type parameters of the
2124-
trait of the same name. `{Self}` will be replaced with the type that is supposed
2125-
to implement the trait but doesn't. To use this, the `on_unimplemented` feature gate
2126-
must be enabled.
21272120

21282121
### Conditional compilation
21292122

branches/batch/src/libcore/iter.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ pub trait Iterator {
101101

102102
/// Conversion from an `Iterator`
103103
#[stable]
104-
#[rustc_on_unimplemented="a collection of type `{Self}` cannot be \
105-
built from an iterator over elements of type `{A}`"]
106104
pub trait FromIterator<A> {
107105
/// Build a container with elements from an external iterator.
108106
fn from_iter<T: Iterator<Item=A>>(iterator: T) -> Self;

branches/batch/src/libcore/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
#![feature(simd, unsafe_destructor, slicing_syntax)]
6464
#![feature(unboxed_closures)]
6565
#![allow(unknown_features)] #![feature(int_uint)]
66-
#![feature(on_unimplemented)]
6766
#![deny(missing_docs)]
6867

6968
#[macro_use]

branches/batch/src/librustc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
extern crate arena;
3434
extern crate flate;
35-
extern crate fmt_macros;
3635
extern crate getopts;
3736
extern crate graphviz;
3837
extern crate libc;

branches/batch/src/librustc/lint/builtin.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,6 @@ impl LintPass for UnusedAttributes {
666666
"must_use",
667667
"stable",
668668
"unstable",
669-
"rustc_on_unimplemented",
670669

671670
// FIXME: #19470 this shouldn't be needed forever
672671
"old_orphan_check",

branches/batch/src/librustc/middle/traits/error_reporting.rs

Lines changed: 2 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@ use super::{
1818
SelectionError,
1919
};
2020

21-
use fmt_macros::{Parser, Piece, Position};
2221
use middle::infer::InferCtxt;
23-
use middle::ty::{self, AsPredicate, ReferencesError, ToPolyTraitRef, TraitRef};
24-
use std::collections::HashMap;
25-
use syntax::codemap::{DUMMY_SP, Span};
26-
use syntax::attr::{AttributeMethods, AttrMetaMethods};
22+
use middle::ty::{self, AsPredicate, ReferencesError, ToPolyTraitRef};
23+
use syntax::codemap::Span;
2724
use util::ppaux::{Repr, UserString};
2825

2926
pub fn report_fulfillment_errors<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
@@ -65,85 +62,6 @@ pub fn report_projection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
6562
}
6663
}
6764

68-
fn report_on_unimplemented<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
69-
trait_ref: &TraitRef<'tcx>,
70-
span: Span) -> Option<String> {
71-
let def_id = trait_ref.def_id;
72-
let mut report = None;
73-
ty::each_attr(infcx.tcx, def_id, |item| {
74-
if item.check_name("rustc_on_unimplemented") {
75-
let err_sp = if item.meta().span == DUMMY_SP {
76-
span
77-
} else {
78-
item.meta().span
79-
};
80-
let def = ty::lookup_trait_def(infcx.tcx, def_id);
81-
let trait_str = def.trait_ref.user_string(infcx.tcx);
82-
if let Some(ref istring) = item.value_str() {
83-
let mut generic_map = def.generics.types.iter_enumerated()
84-
.map(|(param, i, gen)| {
85-
(gen.name.as_str().to_string(),
86-
trait_ref.substs.types.get(param, i)
87-
.user_string(infcx.tcx))
88-
}).collect::<HashMap<String, String>>();
89-
generic_map.insert("Self".to_string(),
90-
trait_ref.self_ty().user_string(infcx.tcx));
91-
let parser = Parser::new(istring.get());
92-
let mut errored = false;
93-
let err: String = parser.filter_map(|p| {
94-
match p {
95-
Piece::String(s) => Some(s),
96-
Piece::NextArgument(a) => match a.position {
97-
Position::ArgumentNamed(s) => match generic_map.get(s) {
98-
Some(val) => Some(val.as_slice()),
99-
None => {
100-
infcx.tcx.sess
101-
.span_err(err_sp,
102-
format!("the #[rustc_on_unimplemented] \
103-
attribute on \
104-
trait definition for {} refers to \
105-
non-existent type parameter {}",
106-
trait_str, s)
107-
.as_slice());
108-
errored = true;
109-
None
110-
}
111-
},
112-
_ => {
113-
infcx.tcx.sess
114-
.span_err(err_sp,
115-
format!("the #[rustc_on_unimplemented] \
116-
attribute on \
117-
trait definition for {} must have named \
118-
format arguments, \
119-
eg `#[rustc_on_unimplemented = \
120-
\"foo {{T}}\"]`",
121-
trait_str).as_slice());
122-
errored = true;
123-
None
124-
}
125-
}
126-
}
127-
}).collect();
128-
// Report only if the format string checks out
129-
if !errored {
130-
report = Some(err);
131-
}
132-
} else {
133-
infcx.tcx.sess.span_err(err_sp,
134-
format!("the #[rustc_on_unimplemented] attribute on \
135-
trait definition for {} must have a value, \
136-
eg `#[rustc_on_unimplemented = \"foo\"]`",
137-
trait_str).as_slice());
138-
}
139-
false
140-
} else {
141-
true
142-
}
143-
});
144-
report
145-
}
146-
14765
pub fn report_selection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
14866
obligation: &PredicateObligation<'tcx>,
14967
error: &SelectionError<'tcx>)
@@ -176,14 +94,6 @@ pub fn report_selection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
17694
"the trait `{}` is not implemented for the type `{}`",
17795
trait_ref.user_string(infcx.tcx),
17896
trait_ref.self_ty().user_string(infcx.tcx)).as_slice());
179-
// Check if it has a custom "#[rustc_on_unimplemented]" error message,
180-
// report with that message if it does
181-
let custom_note = report_on_unimplemented(infcx, &*trait_ref.0,
182-
obligation.cause.span);
183-
if let Some(s) = custom_note {
184-
infcx.tcx.sess.span_note(obligation.cause.span,
185-
s.as_slice());
186-
}
18797
}
18898
}
18999

branches/batch/src/librustc/middle/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4702,7 +4702,7 @@ pub fn ty_sort_string<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> String {
47024702
}
47034703
ty_tup(ref tys) if tys.is_empty() => ::util::ppaux::ty_to_string(cx, ty),
47044704

4705-
ty_enum(id, _) => format!("enum {}", item_path_str(cx, id)),
4705+
ty_enum(id, _) => format!("enum `{}`", item_path_str(cx, id)),
47064706
ty_uniq(_) => "box".to_string(),
47074707
ty_vec(_, Some(n)) => format!("array of {} elements", n),
47084708
ty_vec(_, None) => "slice".to_string(),
@@ -4714,7 +4714,7 @@ pub fn ty_sort_string<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> String {
47144714
format!("trait {}", item_path_str(cx, inner.principal_def_id()))
47154715
}
47164716
ty_struct(id, _) => {
4717-
format!("struct {}", item_path_str(cx, id))
4717+
format!("struct `{}`", item_path_str(cx, id))
47184718
}
47194719
ty_unboxed_closure(..) => "closure".to_string(),
47204720
ty_tup(_) => "tuple".to_string(),

0 commit comments

Comments
 (0)