Skip to content

Commit b5fc9f9

Browse files
committed
---
yaml --- r: 234623 b: refs/heads/tmp c: 804f024 h: refs/heads/master i: 234621: cb35af0 234619: 9ba869b 234615: dc8cf9c 234607: 40950e6 234591: 1ffbc3d 234559: c364a18 234495: 8354446 v: v3
1 parent 348232e commit b5fc9f9

File tree

14 files changed

+151
-298
lines changed

14 files changed

+151
-298
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: d2e13e822a73e0ea46ae9e21afdd3155fc997f6d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 8dfb89067a57949e9b74f6ed4a409d728c1240a5
28+
refs/heads/tmp: 804f024edab8b85f276a9a3fbfa23215a4688328
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: ab792abf1fcc28afbd315426213f6428da25c085
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ impl<T> Option<T> {
541541
/// ```
542542
/// let mut x = Some(4);
543543
/// match x.iter_mut().next() {
544-
/// Some(&mut ref mut v) => *v = 42,
544+
/// Some(v) => *v = 42,
545545
/// None => {},
546546
/// }
547547
/// assert_eq!(x, Some(42));

branches/tmp/src/libcore/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ impl<T, E> Result<T, E> {
538538
/// ```
539539
/// let mut x: Result<u32, &str> = Ok(7);
540540
/// match x.iter_mut().next() {
541-
/// Some(&mut ref mut x) => *x = 40,
541+
/// Some(v) => *v = 40,
542542
/// None => {},
543543
/// }
544544
/// assert_eq!(x, Ok(40));

branches/tmp/src/librustc/diagnostics.rs

Lines changed: 2 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,117 +1886,7 @@ This explicitly states that you expect the trait object `SomeTrait` to
18861886
contain references (with a maximum lifetime of `'a`).
18871887
18881888
[1]: https://github.com/rust-lang/rfcs/pull/1156
1889-
"##,
1890-
1891-
E0454: r##"
1892-
A link name was given with an empty name. Erroneous code example:
1893-
1894-
```
1895-
#[link(name = "")] extern {} // error: #[link(name = "")] given with empty name
1896-
```
1897-
1898-
The rust compiler cannot link to an external library if you don't give it its
1899-
name. Example:
1900-
1901-
```
1902-
#[link(name = "some_lib")] extern {} // ok!
1903-
```
1904-
"##,
1905-
1906-
E0458: r##"
1907-
An unknown "kind" was specified for a link attribute. Erroneous code example:
1908-
1909-
```
1910-
#[link(kind = "wonderful_unicorn")] extern {}
1911-
// error: unknown kind: `wonderful_unicorn`
1912-
```
1913-
1914-
Please specify a valid "kind" value, from one of the following:
1915-
* static
1916-
* dylib
1917-
* framework
1918-
"##,
1919-
1920-
E0459: r##"
1921-
A link was used without a name parameter. Erroneous code example:
1922-
1923-
```
1924-
#[link(kind = "dylib")] extern {}
1925-
// error: #[link(...)] specified without `name = "foo"`
1926-
```
1927-
1928-
Please add the name parameter to allow the rust compiler to find the library
1929-
you want. Example:
1930-
1931-
```
1932-
#[link(kind = "dylib", name = "some_lib")] extern {} // ok!
1933-
```
1934-
"##,
1935-
1936-
E0493: r##"
1937-
A type with a destructor was assigned to an invalid type of variable. Erroneous
1938-
code example:
1939-
1940-
```
1941-
struct Foo {
1942-
a: u32
1943-
}
1944-
1945-
impl Drop for Foo {
1946-
fn drop(&mut self) {}
1947-
}
1948-
1949-
const F : Foo = Foo { a : 0 };
1950-
// error: constants are not allowed to have destructors
1951-
static S : Foo = Foo { a : 0 };
1952-
// error: statics are not allowed to have destructors
1953-
```
1954-
1955-
To solve this issue, please use a type which does allow the usage of type with
1956-
destructors.
1957-
"##,
1958-
1959-
E0494: r##"
1960-
A reference of an interior static was assigned to another const/static.
1961-
Erroneous code example:
1962-
1963-
```
1964-
struct Foo {
1965-
a: u32
1966-
}
1967-
1968-
static S : Foo = Foo { a : 0 };
1969-
static A : &'static u32 = &S.a;
1970-
// error: cannot refer to the interior of another static, use a
1971-
// constant instead
1972-
```
1973-
1974-
The "base" variable has to be a const if you want another static/const variable
1975-
to refer to one of its fields. Example:
1976-
1977-
```
1978-
struct Foo {
1979-
a: u32
1980-
}
1981-
1982-
const S : Foo = Foo { a : 0 };
1983-
static A : &'static u32 = &S.a; // ok!
1984-
```
1985-
"##,
1986-
1987-
E0497: r##"
1988-
A stability attribute was used outside of the standard library. Erroneous code
1989-
example:
1990-
1991-
```
1992-
#[stable] // error: stability attributes may not be used outside of the
1993-
// standard library
1994-
fn foo() {}
1995-
```
1996-
1997-
It is not possible to use stability attributes outside of the standard library.
1998-
Also, for now, it is not possible to write deprecation messages either.
1999-
"##,
1889+
"##
20001890

20011891
}
20021892

@@ -2024,46 +1914,5 @@ register_diagnostics! {
20241914
E0314, // closure outlives stack frame
20251915
E0315, // cannot invoke closure outside of its lifetime
20261916
E0316, // nested quantification of lifetimes
2027-
E0400, // overloaded derefs are not allowed in constants
2028-
E0452, // malformed lint attribute
2029-
E0453, // overruled by outer forbid
2030-
E0455, // native frameworks are only available on OSX targets
2031-
E0456, // plugin `..` is not available for triple `..`
2032-
E0457, // plugin `..` only found in rlib format, but must be available...
2033-
E0460, // found possibly newer version of crate `..`
2034-
E0461, // couldn't find crate `..` with expected target triple ..
2035-
E0462, // found staticlib `..` instead of rlib or dylib
2036-
E0463, // can't find crate for `..`
2037-
E0464, // multiple matching crates for `..`
2038-
E0465, // multiple .. candidates for `..` found
2039-
E0466, // bad macro import
2040-
E0467, // bad macro reexport
2041-
E0468, // an `extern crate` loading macros must be at the crate root
2042-
E0469, // imported macro not found
2043-
E0470, // reexported macro not found
2044-
E0471, // constant evaluation error: ..
2045-
E0472, // asm! is unsupported on this target
2046-
E0473, // dereference of reference outside its lifetime
2047-
E0474, // captured variable `..` does not outlive the enclosing closure
2048-
E0475, // index of slice outside its lifetime
2049-
E0476, // lifetime of the source pointer does not outlive lifetime bound...
2050-
E0477, // the type `..` does not fulfill the required lifetime...
2051-
E0478, // lifetime bound not satisfied
2052-
E0479, // the type `..` (provided as the value of a type parameter) is...
2053-
E0480, // lifetime of method receiver does not outlive the method call
2054-
E0481, // lifetime of function argument does not outlive the function call
2055-
E0482, // lifetime of return value does not outlive the function call
2056-
E0483, // lifetime of operand does not outlive the operation
2057-
E0484, // reference is not valid at the time of borrow
2058-
E0485, // automatically reference is not valid at the time of borrow
2059-
E0486, // type of expression contains references that are not valid during...
2060-
E0487, // unsafe use of destructor: destructor might be called while...
2061-
E0488, // lifetime of variable does not enclose its declaration
2062-
E0489, // type/lifetime parameter not in scope here
2063-
E0490, // a value of type `..` is borrowed for too long
2064-
E0491, // in type `..`, reference has a longer lifetime than the data it...
2065-
E0492, // cannot borrow a constant which contains interior mutability
2066-
E0495, // cannot infer an appropriate lifetime due to conflicting requirements
2067-
E0496, // .. name `..` shadows a .. name that is already in scope
2068-
E0498, // malformed plugin attribute
1917+
E0400 // overloaded derefs are not allowed in constants
20691918
}

branches/tmp/src/librustc/lint/context.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,7 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
433433
for result in gather_attrs(attrs) {
434434
let v = match result {
435435
Err(span) => {
436-
span_err!(self.tcx.sess, span, E0452,
437-
"malformed lint attribute");
436+
self.tcx.sess.span_err(span, "malformed lint attribute");
438437
continue;
439438
}
440439
Ok((lint_name, level, span)) => {
@@ -463,10 +462,10 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
463462
let now = self.lints.get_level_source(lint_id).0;
464463
if now == Forbid && level != Forbid {
465464
let lint_name = lint_id.as_str();
466-
span_err!(self.tcx.sess, span, E0453,
467-
"{}({}) overruled by outer forbid({})",
468-
level.as_str(), lint_name,
469-
lint_name);
465+
self.tcx.sess.span_err(span,
466+
&format!("{}({}) overruled by outer forbid({})",
467+
level.as_str(), lint_name,
468+
lint_name));
470469
} else if now != level {
471470
let src = self.lints.get_level_source(lint_id).1;
472471
self.level_stack.push((lint_id, (now, src)));

branches/tmp/src/librustc/metadata/creader.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ fn register_native_lib(sess: &Session,
119119
if name.is_empty() {
120120
match span {
121121
Some(span) => {
122-
span_err!(sess, span, E0454,
123-
"#[link(name = \"\")] given with empty name");
122+
sess.span_err(span, "#[link(name = \"\")] given with \
123+
empty name");
124124
}
125125
None => {
126126
sess.err("empty library name given via `-l`");
@@ -132,10 +132,7 @@ fn register_native_lib(sess: &Session,
132132
if kind == cstore::NativeFramework && !is_osx {
133133
let msg = "native frameworks are only available on OSX targets";
134134
match span {
135-
Some(span) => {
136-
span_err!(sess, span, E0455,
137-
"{}", msg)
138-
}
135+
Some(span) => sess.span_err(span, msg),
139136
None => sess.err(msg),
140137
}
141138
}
@@ -517,7 +514,7 @@ impl<'a> CrateReader<'a> {
517514
name,
518515
config::host_triple(),
519516
self.sess.opts.target_triple);
520-
span_err!(self.sess, span, E0456, "{}", &message[..]);
517+
self.sess.span_err(span, &message[..]);
521518
self.sess.abort_if_errors();
522519
}
523520

@@ -527,10 +524,10 @@ impl<'a> CrateReader<'a> {
527524
match (ekrate.dylib.as_ref(), registrar) {
528525
(Some(dylib), Some(reg)) => Some((dylib.to_path_buf(), reg)),
529526
(None, Some(_)) => {
530-
span_err!(self.sess, span, E0457,
531-
"plugin `{}` only found in rlib format, but must be available \
532-
in dylib format",
533-
name);
527+
let message = format!("plugin `{}` only found in rlib format, \
528+
but must be available in dylib format",
529+
name);
530+
self.sess.span_err(span, &message[..]);
534531
// No need to abort because the loading code will just ignore this
535532
// empty dylib.
536533
None
@@ -763,8 +760,7 @@ impl<'a, 'b> LocalCrateReader<'a, 'b> {
763760
Some("dylib") => cstore::NativeUnknown,
764761
Some("framework") => cstore::NativeFramework,
765762
Some(k) => {
766-
span_err!(self.sess, m.span, E0458,
767-
"unknown kind: `{}`", k);
763+
self.sess.span_err(m.span, &format!("unknown kind: `{}`", k));
768764
cstore::NativeUnknown
769765
}
770766
None => cstore::NativeUnknown
@@ -775,8 +771,8 @@ impl<'a, 'b> LocalCrateReader<'a, 'b> {
775771
let n = match n {
776772
Some(n) => n,
777773
None => {
778-
span_err!(self.sess, m.span, E0459,
779-
"#[link(...)] specified without `name = \"foo\"`");
774+
self.sess.span_err(m.span, "#[link(...)] specified without \
775+
`name = \"foo\"`");
780776
InternedString::new("foo")
781777
}
782778
};

branches/tmp/src/librustc/metadata/loader.rs

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -308,28 +308,23 @@ impl<'a> Context<'a> {
308308
}
309309

310310
pub fn report_load_errs(&mut self) {
311-
let add = match self.root {
312-
&None => String::new(),
313-
&Some(ref r) => format!(" which `{}` depends on",
314-
r.ident)
315-
};
316-
if !self.rejected_via_hash.is_empty() {
317-
span_err!(self.sess, self.span, E0460,
318-
"found possibly newer version of crate `{}`{}",
319-
self.ident, add);
311+
let message = if !self.rejected_via_hash.is_empty() {
312+
format!("found possibly newer version of crate `{}`",
313+
self.ident)
320314
} else if !self.rejected_via_triple.is_empty() {
321-
span_err!(self.sess, self.span, E0461,
322-
"couldn't find crate `{}` with expected target triple {}{}",
323-
self.ident, self.triple, add);
315+
format!("couldn't find crate `{}` with expected target triple {}",
316+
self.ident, self.triple)
324317
} else if !self.rejected_via_kind.is_empty() {
325-
span_err!(self.sess, self.span, E0462,
326-
"found staticlib `{}` instead of rlib or dylib{}",
327-
self.ident, add);
318+
format!("found staticlib `{}` instead of rlib or dylib", self.ident)
328319
} else {
329-
span_err!(self.sess, self.span, E0463,
330-
"can't find crate for `{}`{}",
331-
self.ident, add);
332-
}
320+
format!("can't find crate for `{}`", self.ident)
321+
};
322+
let message = match self.root {
323+
&None => message,
324+
&Some(ref r) => format!("{} which `{}` depends on",
325+
message, r.ident)
326+
};
327+
self.sess.span_err(self.span, &message[..]);
333328

334329
if !self.rejected_via_triple.is_empty() {
335330
let mismatches = self.rejected_via_triple.iter();
@@ -478,9 +473,9 @@ impl<'a> Context<'a> {
478473
0 => None,
479474
1 => Some(libraries.into_iter().next().unwrap()),
480475
_ => {
481-
span_err!(self.sess, self.span, E0464,
482-
"multiple matching crates for `{}`",
483-
self.crate_name);
476+
self.sess.span_err(self.span,
477+
&format!("multiple matching crates for `{}`",
478+
self.crate_name));
484479
self.sess.note("candidates:");
485480
for lib in &libraries {
486481
match lib.dylib {
@@ -548,9 +543,11 @@ impl<'a> Context<'a> {
548543
}
549544
};
550545
if ret.is_some() {
551-
span_err!(self.sess, self.span, E0465,
552-
"multiple {} candidates for `{}` found",
553-
flavor, self.crate_name);
546+
self.sess.span_err(self.span,
547+
&format!("multiple {} candidates for `{}` \
548+
found",
549+
flavor,
550+
self.crate_name));
554551
self.sess.span_note(self.span,
555552
&format!(r"candidate #1: {}",
556553
ret.as_ref().unwrap().0

0 commit comments

Comments
 (0)