Skip to content

Commit 29b6fef

Browse files
committed
---
yaml --- r: 228493 b: refs/heads/try c: 6c74779 h: refs/heads/master i: 228491: 8656e46 v: v3
1 parent 20c5617 commit 29b6fef

File tree

14 files changed

+37
-143
lines changed

14 files changed

+37
-143
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 3b8acb73869a6a0224cb39d16f2de25468e1bf28
4+
refs/heads/try: 6c74779a5c4fb1c0bf5d395c8b0c27d296f7ca48
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/libcollections/borrow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl<'a, B: ?Sized> Clone for Cow<'a, B> where B: ToOwned {
215215
impl<'a, B: ?Sized> Cow<'a, B> where B: ToOwned {
216216
/// Acquires a mutable reference to the owned form of the data.
217217
///
218-
/// Clones the data if it is not already owned.
218+
/// Copies the data if it is not already owned.
219219
///
220220
/// # Examples
221221
///
@@ -241,7 +241,7 @@ impl<'a, B: ?Sized> Cow<'a, B> where B: ToOwned {
241241

242242
/// Extracts the owned data.
243243
///
244-
/// Clones the data if it is not already owned.
244+
/// Copies the data if it is not already owned.
245245
///
246246
/// # Examples
247247
///

branches/try/src/libcore/cell.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@
3636
//! would otherwise be disallowed though, there are occasions when interior mutability might be
3737
//! appropriate, or even *must* be used, e.g.
3838
//!
39-
//! * Introducing mutability 'inside' of something immutable
39+
//! * Introducing inherited mutability roots to shared types.
4040
//! * Implementation details of logically-immutable methods.
4141
//! * Mutating implementations of `Clone`.
4242
//!
43-
//! ## Introducing mutability 'inside' of something immutable
43+
//! ## Introducing inherited mutability roots to shared types
4444
//!
45-
//! Many shared smart pointer types, including `Rc<T>` and `Arc<T>`, provide containers that can be
45+
//! Shared smart pointer types, including `Rc<T>` and `Arc<T>`, provide containers that can be
4646
//! cloned and shared between multiple parties. Because the contained values may be
47-
//! multiply-aliased, they can only be borrowed with `&`, not `&mut`. Without cells it would be
48-
//! impossible to mutate data inside of these smart pointers at all.
47+
//! multiply-aliased, they can only be borrowed as shared references, not mutable references.
48+
//! Without cells it would be impossible to mutate data inside of shared boxes at all!
4949
//!
5050
//! It's very common then to put a `RefCell<T>` inside shared pointer types to reintroduce
5151
//! mutability:
@@ -65,8 +65,8 @@
6565
//! ```
6666
//!
6767
//! Note that this example uses `Rc<T>` and not `Arc<T>`. `RefCell<T>`s are for single-threaded
68-
//! scenarios. Consider using `RwLock<T>` or `Mutex<T>` if you need shared mutability in a
69-
//! multi-threaded situation.
68+
//! scenarios. Consider using `Mutex<T>` if you need shared mutability in a multi-threaded
69+
//! situation.
7070
//!
7171
//! ## Implementation details of logically-immutable methods
7272
//!

branches/try/src/librustc/session/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,7 @@ fn split_msg_into_multilines(msg: &str) -> Option<String> {
301301
!msg.contains("if and else have incompatible types") &&
302302
!msg.contains("if may be missing an else clause") &&
303303
!msg.contains("match arms have incompatible types") &&
304-
!msg.contains("structure constructor specifies a structure of type") &&
305-
!msg.contains("has an incompatible type for trait") {
304+
!msg.contains("structure constructor specifies a structure of type") {
306305
return None
307306
}
308307
let first = msg.match_indices("expected").filter(|s| {

branches/try/src/librustc_resolve/diagnostics.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,23 @@ mod bar {
9393
```
9494
"##,
9595

96+
E0253: r##"
97+
Attempt was made to import an unimportable value. This can happen when
98+
trying to import a function from a trait. An example of this error:
99+
100+
```
101+
mod foo {
102+
pub trait MyTrait {
103+
fn doSomething();
104+
}
105+
}
106+
use foo::MyTrait::doSomething;
107+
```
108+
109+
In general, it's not legal to directly import functions from a crate or
110+
concrete type.
111+
"##,
112+
96113
E0255: r##"
97114
You can't import a value whose name is the same as another value defined in the
98115
module.
@@ -262,7 +279,6 @@ http://doc.rust-lang.org/reference.html#use-declarations
262279
register_diagnostics! {
263280
E0153, // called no where
264281
E0157, // called from no where
265-
E0253, // not directly importable
266282
E0254, // import conflicts with imported crate in this module
267283
E0257,
268284
E0258,

branches/try/src/librustc_typeck/diagnostics.rs

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,66 +2109,6 @@ E0380: r##"
21092109
Default impls are only allowed for traits with no methods or associated items.
21102110
For more information see the [opt-in builtin traits RFC](https://github.com/rust
21112111
-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md).
2112-
"##,
2113-
2114-
E0392: r##"
2115-
This error indicates that a type or lifetime parameter has been declared
2116-
but not actually used. Here is an example that demonstrates the error:
2117-
2118-
```
2119-
enum Foo<T> {
2120-
Bar
2121-
}
2122-
```
2123-
2124-
If the type parameter was included by mistake, this error can be fixed
2125-
by simply removing the type parameter, as shown below:
2126-
2127-
```
2128-
enum Foo {
2129-
Bar
2130-
}
2131-
```
2132-
2133-
Alternatively, if the type parameter was intentionally inserted, it must be
2134-
used. A simple fix is shown below:
2135-
2136-
```
2137-
enum Foo<T> {
2138-
Bar(T)
2139-
}
2140-
```
2141-
2142-
This error may also commonly be found when working with unsafe code. For
2143-
example, when using raw pointers one may wish to specify the lifetime for
2144-
which the pointed-at data is valid. An initial attempt (below) causes this
2145-
error:
2146-
2147-
```
2148-
struct Foo<'a, T> {
2149-
x: *const T
2150-
}
2151-
```
2152-
2153-
We want to express the constraint that Foo should not outlive `'a`, because
2154-
the data pointed to by `T` is only valid for that lifetime. The problem is
2155-
that there are no actual uses of `'a`. It's possible to work around this
2156-
by adding a PhantomData type to the struct, using it to tell the compiler
2157-
to act as if the struct contained a borrowed reference `&'a T`:
2158-
2159-
```
2160-
use std::marker::PhantomData;
2161-
2162-
struct Foo<'a, T: 'a> {
2163-
x: *const T,
2164-
phantom: PhantomData<&'a T>
2165-
}
2166-
```
2167-
2168-
PhantomData can also be used to express information about unused type
2169-
parameters. You can read more about it in the API documentation:
2170-
2171-
https://doc.rust-lang.org/std/marker/struct.PhantomData.html
21722112
"##
21732113

21742114
}
@@ -2271,6 +2211,7 @@ register_diagnostics! {
22712211
E0390, // only a single inherent implementation marked with
22722212
// `#[lang = \"{}\"]` is allowed for the `{}` primitive
22732213
E0391, // unsupported cyclic reference between types/traits detected
2214+
E0392, // parameter `{}` is never used
22742215
E0393, // the type parameter `{}` must be explicitly specified in an object
22752216
// type because its default value `{}` references the type `Self`"
22762217
E0399, // trait items need to be implemented because the associated

branches/try/src/test/compile-fail/associated-const-impl-wrong-type.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ struct SignedBar;
1818

1919
impl Foo for SignedBar {
2020
const BAR: i32 = -1;
21-
//~^ ERROR implemented const `BAR` has an incompatible type for trait
22-
//~| expected u32,
23-
//~| found i32 [E0326]
21+
//~^ ERROR E0326
2422
}
2523

2624
fn main() {}

branches/try/src/test/compile-fail/issue-15094.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ struct Debuger<T> {
1919
impl<T: fmt::Debug> ops::FnOnce<(),> for Debuger<T> {
2020
type Output = ();
2121
fn call_once(self, _args: ()) {
22-
//~^ ERROR `call_once` has an incompatible type for trait
23-
//~| expected "rust-call" fn,
24-
//~| found "Rust" fn
22+
//~^ ERROR `call_once` has an incompatible type for trait: expected "rust-call" fn, found "Rust" fn
2523
println!("{:?}", self.x);
2624
}
2725
}

branches/try/src/test/compile-fail/issue-20225.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,19 @@ struct Foo;
1414

1515
impl<'a, T> Fn<(&'a T,)> for Foo {
1616
extern "rust-call" fn call(&self, (_,): (T,)) {}
17-
//~^ ERROR: has an incompatible type for trait
18-
//~| expected &-ptr
17+
//~^ ERROR: has an incompatible type for trait: expected &-ptr
1918
}
2019

2120
impl<'a, T> FnMut<(&'a T,)> for Foo {
2221
extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
23-
//~^ ERROR: has an incompatible type for trait
24-
//~| expected &-ptr
22+
//~^ ERROR: has an incompatible type for trait: expected &-ptr
2523
}
2624

2725
impl<'a, T> FnOnce<(&'a T,)> for Foo {
2826
type Output = ();
2927

3028
extern "rust-call" fn call_once(self, (_,): (T,)) {}
31-
//~^ ERROR: has an incompatible type for trait
32-
//~| expected &-ptr
29+
//~^ ERROR: has an incompatible type for trait: expected &-ptr
3330
}
3431

3532
fn main() {}

branches/try/src/test/compile-fail/issue-21332.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.

branches/try/src/test/compile-fail/issue-24356.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ fn main() {
3030
impl Deref for Thing {
3131
//~^ ERROR not all trait items implemented, missing: `Target` [E0046]
3232
fn deref(&self) -> i8 { self.0 }
33-
//~^ ERROR method `deref` has an incompatible type for trait
34-
//~| expected &-ptr
35-
//~| found i8 [E0053]
33+
//~^ ERROR method `deref` has an incompatible type for trait: expected &-ptr, found i8 [E0053]
3634
}
3735

3836
let thing = Thing(72);

branches/try/src/test/compile-fail/trait-impl-method-mismatch.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ trait Mumbo {
1616
impl Mumbo for usize {
1717
// Cannot have a larger effect than the trait:
1818
unsafe fn jumbo(&self, x: &usize) { *self + *x; }
19-
//~^ ERROR method `jumbo` has an incompatible type for trait
20-
//~| expected normal fn,
21-
//~| found unsafe fn
19+
//~^ ERROR expected normal fn, found unsafe fn
2220
}
2321

2422
fn main() {}

branches/try/src/test/compile-fail/unsafe-trait-impl.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ trait Foo {
1616

1717
impl Foo for u32 {
1818
fn len(&self) -> u32 { *self }
19-
//~^ ERROR method `len` has an incompatible type for trait
20-
//~| expected unsafe fn,
21-
//~| found normal fn
19+
//~^ ERROR incompatible type for trait: expected unsafe fn, found normal fn
2220
}
2321

2422
fn main() { }

branches/try/src/test/run-pass/issue-14821.rs

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)