Skip to content

Rollup of 15 pull requests #64160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 51 commits into from
Sep 5, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
820aa5b
Stabilize pin_into_inner in 1.39.0
ghedo Aug 28, 2019
8648732
Add `Place::is_indirect`
ecstatic-morse Aug 29, 2019
0e597d4
Rev::rposition counts from the wrong end
sfanxiang Aug 30, 2019
96ac02b
Use new `Place::is_indirect` API where possible
ecstatic-morse Aug 29, 2019
5187a3e
Harden param_attrs test wrt. usage of proc macro attrs.
Centril Aug 31, 2019
7bb2d8b
Slightly clean up the error for recursive `async fn`
matthewjasper Aug 31, 2019
877faf3
Check impl trait substs when checking for recursive types
matthewjasper Aug 31, 2019
754a875
Add some more tests for underscore imports
matthewjasper Aug 31, 2019
b0bb301
Update xLTO compatibility table in rustc book.
michaelwoerister Sep 2, 2019
3ea932a
Refer to "`self` type" instead of "receiver type"
estebank Sep 3, 2019
c1e5e5c
On object safety violation, point at source when possible
estebank Sep 3, 2019
bb99fc3
review comment: update error code descr
estebank Sep 3, 2019
efe8594
account for DUMMY_SP and correct wording
estebank Sep 3, 2019
05dcd0e
Remove `LocalInternedString` uses from `librustc_typeck`.
nnethercote Sep 3, 2019
a8975a0
Remove `LocalInternedString` uses from `librustc/lint/`.
nnethercote Sep 3, 2019
8c74eb7
Move path parsing earlier.
nnethercote Sep 3, 2019
23c76ff
Added warning around code with reference to uninit bytes
Sep 3, 2019
e85b181
unused_parens: fix for or-patterns + &(mut x)
Centril Sep 3, 2019
b03d3dc
Changed comment to better reflect std's exceptional situation
Sep 3, 2019
28b5184
review comments: error code text
estebank Sep 3, 2019
4a79633
review comments
estebank Sep 3, 2019
e16ce80
fix error code test
estebank Sep 3, 2019
0ad111f
Remove `LocalInternedString` uses from `librustc/ty/`.
nnethercote Sep 3, 2019
b50db34
Remove `LocalInternedString` uses from `librustc_codegen_llvm/consts.…
nnethercote Sep 3, 2019
d78b33a
Remove `LocalInternedString` uses from `librustc_codegen_llvm`.
nnethercote Sep 3, 2019
bf536dd
Remove `LocalInternedString` uses from `librustc/traits/`.
nnethercote Sep 3, 2019
69ae8d9
Remove `LocalInternedString::as_interned_str()`.
nnethercote Sep 3, 2019
224daa6
Remove `LocalInternedString::get`.
nnethercote Sep 3, 2019
6025fc8
Remove hashing impls for `LocalInternedString`.
nnethercote Sep 3, 2019
a1cd79f
Remove `Encodable`/`Decodable` impls for `LocalInternedString`.
nnethercote Sep 3, 2019
7a1bc79
Remove `LocalInternedString::intern`.
nnethercote Sep 3, 2019
cc17b1b
Add `Symbol::{with,with2}`.
nnethercote Sep 3, 2019
b6f9523
Fix doc links in `std::cmp` module
tesuji Sep 4, 2019
8e06724
fix a few typos in comments
Sep 4, 2019
843fba3
Stabilize checked_duration_since for 1.39.0
vi Jul 21, 2019
5545582
Avoid feature name 'checked_duration_since' in a Tidy test
vi Sep 4, 2019
ee437eb
Rollup merge of #62860 - vi:stabilize_checked_duration_since, r=Mark-…
Centril Sep 5, 2019
38ce687
Rollup merge of #63549 - sfanxiang:rev-rposition, r=scottmcm
Centril Sep 5, 2019
d1d511d
Rollup merge of #63985 - ghedo:stabilize_pin_into_inner, r=alexcrichton
Centril Sep 5, 2019
9718f7a
Rollup merge of #64005 - ecstatic-morse:is-indirect, r=oli-obk
Centril Sep 5, 2019
07a2833
Rollup merge of #64031 - Centril:param-attrs-no-macros-test, r=nikoma…
Centril Sep 5, 2019
9024032
Rollup merge of #64038 - matthewjasper:deny-mutual-impl-trait-recursi…
Centril Sep 5, 2019
fe1c1f8
Rollup merge of #64043 - matthewjasper:underscore-import-tests, r=ale…
Centril Sep 5, 2019
68660d2
Rollup merge of #64092 - michaelwoerister:update-xlto-table-rustc-boo…
Centril Sep 5, 2019
8ef11fc
Rollup merge of #64110 - estebank:receiver-type, r=Centril
Centril Sep 5, 2019
24f0778
Rollup merge of #64120 - nnethercote:move-path-parsing-earlier, r=pet…
Centril Sep 5, 2019
c195145
Rollup merge of #64123 - danielhenrymantilla:add_comment_about_uninit…
Centril Sep 5, 2019
57ffc83
Rollup merge of #64128 - Centril:unused-parens-pat, r=davidtwco
Centril Sep 5, 2019
4dfbaba
Rollup merge of #64141 - nnethercote:minimize-LocalInternedString, r=…
Centril Sep 5, 2019
a0f0a96
Rollup merge of #64142 - lzutao:fix-doc-cmp, r=jonas-schievink
Centril Sep 5, 2019
51ae5d0
Rollup merge of #64148 - guanqun:typo-fix, r=zackmdavis
Centril Sep 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
account for DUMMY_SP and correct wording
  • Loading branch information
estebank committed Sep 3, 2019
commit efe85943b3a5e7b3920db5a5a53183c75fc80d0c
2 changes: 1 addition & 1 deletion src/librustc/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Generally, `Self: Sized` is used to indicate that the trait should not be used
as a trait object. If the trait comes from your own crate, consider removing
this restriction.

### Method references the `Self` type in its arguments or return type
### Method references the `Self` type in its parameters or return type

This happens when a trait has a method like the following:

Expand Down
8 changes: 4 additions & 4 deletions src/librustc/traits/object_safety.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::borrow::Cow;
use std::iter::{self};
use syntax::ast::{self};
use syntax::symbol::InternedString;
use syntax_pos::Span;
use syntax_pos::{Span, DUMMY_SP};

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub enum ObjectSafetyViolation {
Expand Down Expand Up @@ -49,7 +49,7 @@ impl ObjectSafetyViolation {
ObjectSafetyViolation::Method(name, MethodViolationCode::StaticMethod, _) =>
format!("associated function `{}` has no `self` parameter", name).into(),
ObjectSafetyViolation::Method(name, MethodViolationCode::ReferencesSelf, _) => format!(
"method `{}` references the `Self` type in its arguments or return type",
"method `{}` references the `Self` type in its parameters or return type",
name,
).into(),
ObjectSafetyViolation::Method(
Expand All @@ -67,9 +67,9 @@ impl ObjectSafetyViolation {
}

pub fn span(&self) -> Option<Span> {
match self {
match *self {
ObjectSafetyViolation::AssocConst(_, span) |
ObjectSafetyViolation::Method(_, _, span) => Some(*span),
ObjectSafetyViolation::Method(_, _, span) if span != DUMMY_SP => Some(span),
_ => None,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0038]: the trait `NotObjectSafe` cannot be made into an object
--> $DIR/coherence-impl-trait-for-trait-object-safe.rs:11:6
|
LL | trait NotObjectSafe { fn eq(&self, other: Self); }
| -- method `eq` references the `Self` type in its arguments or return type
| -- method `eq` references the `Self` type in its parameters or return type
LL | impl NotObjectSafe for dyn NotObjectSafe { }
| ^^^^^^^^^^^^^ the trait `NotObjectSafe` cannot be made into an object

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0038]: the trait `NotObjectSafe` cannot be made into an object
--> $DIR/coherence-impl-trait-for-trait-object-safe.rs:11:6
|
LL | trait NotObjectSafe { fn eq(&self, other: Self); }
| -- method `eq` references the `Self` type in its arguments or return type
| -- method `eq` references the `Self` type in its parameters or return type
LL | impl NotObjectSafe for dyn NotObjectSafe { }
| ^^^^^^^^^^^^^ the trait `NotObjectSafe` cannot be made into an object

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0038.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/E0038.rs:5:1
|
LL | fn foo(&self) -> Self;
| --- method `foo` references the `Self` type in its arguments or return type
| --- method `foo` references the `Self` type in its parameters or return type
...
LL | fn call_foo(x: Box<dyn Trait>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` cannot be made into an object
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/object-safety/object-safety-mentions-Self.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0038]: the trait `Bar` cannot be made into an object
--> $DIR/object-safety-mentions-Self.rs:17:1
|
LL | fn bar(&self, x: &Self);
| --- method `bar` references the `Self` type in its arguments or return type
| --- method `bar` references the `Self` type in its parameters or return type
...
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object
Expand All @@ -11,7 +11,7 @@ error[E0038]: the trait `Baz` cannot be made into an object
--> $DIR/object-safety-mentions-Self.rs:22:1
|
LL | fn bar(&self) -> Self;
| --- method `bar` references the `Self` type in its arguments or return type
| --- method `bar` references the `Self` type in its parameters or return type
...
LL | fn make_baz<T:Baz>(t: &T) -> &dyn Baz {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Baz` cannot be made into an object
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui/resolve/issue-3907-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ error[E0038]: the trait `issue_3907::Foo` cannot be made into an object
|
LL | fn bar(_x: Foo) {}
| ^^^^^^^^^^^^^^^ the trait `issue_3907::Foo` cannot be made into an object
|
= note: associated function `bar` has no `self` parameter

error: aborting due to previous error

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/traits/trait-test-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ error[E0038]: the trait `bar` cannot be made into an object
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
| --- ---- method `blah` has generic type parameters
| |
| method `dup` references the `Self` type in its arguments or return type
| method `dup` references the `Self` type in its parameters or return type
...
LL | (box 10 as Box<dyn bar>).dup();
| ^^^^^^^^^^^^ the trait `bar` cannot be made into an object
Expand All @@ -27,7 +27,7 @@ error[E0038]: the trait `bar` cannot be made into an object
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
| --- ---- method `blah` has generic type parameters
| |
| method `dup` references the `Self` type in its arguments or return type
| method `dup` references the `Self` type in its parameters or return type
...
LL | (box 10 as Box<dyn bar>).dup();
| ^^^^^^ the trait `bar` cannot be made into an object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ error[E0038]: the trait `MyAdd` cannot be made into an object
--> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:14:18
|
LL | trait MyAdd<Rhs=Self> { fn add(&self, other: &Rhs) -> Self; }
| --- method `add` references the `Self` type in its arguments or return type
| --- method `add` references the `Self` type in its parameters or return type
...
LL | let y = x as dyn MyAdd<i32>;
| ^^^^^^^^^^^^^^ the trait `MyAdd` cannot be made into an object
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/wf/wf-object-safe.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0038]: the trait `A` cannot be made into an object
--> $DIR/wf-object-safe.rs:9:13
|
LL | fn foo(&self, _x: &Self);
| --- method `foo` references the `Self` type in its arguments or return type
| --- method `foo` references the `Self` type in its parameters or return type
...
LL | let _x: &dyn A;
| ^^^^^^ the trait `A` cannot be made into an object
Expand Down