Skip to content
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

Bunch of diagnostics fixes and additions #26963

Merged
merged 16 commits into from
Jul 25, 2015
Merged

Conversation

Manishearth
Copy link
Member

I'll be adding more commits to this PR as the weekend progresses. Was hoping to make this a mega-PR, but getting some eyes on this early would be nice too.

r? @steveklabnik

r? @eddyb on the object safety bits

cc @michaelsproul

Part of #24407

@Manishearth
Copy link
Member Author

We need to 🚲 a better inline error message for "the trait cannot use Self as a type parameter in the supertrait listing"

Eddy suggested "supertrait Super<Self> is not object-safe due to Self being used as a type parameter" (needs some rewiring of supertraits_reference_self(), but not too hard to implement)


E0038: r####"

Trait objects like `Box<Trait>`, can only be constructed when certain
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary comma.

@michaelsproul
Copy link
Contributor

Re: E0038, @jashank put a bunch of work into an explanation in #26163. Perhaps you should collaborate?

@Manishearth
Copy link
Member Author

(addressed)


```

but this won't:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering: should "but" needs a capitalized first letter or not ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's part of the same sentence. Starting a sentence with But could be worse :p

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how it works in english after ':' so I asked. ^^

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it's... strange. English grammar people aren't generally paying attention to putting code blocks into sentences ;)

@Gankra
Copy link
Contributor

Gankra commented Jul 15, 2015

Modulo all the nits, everything seems good but object safety.

@Manishearth
Copy link
Member Author

(addressed)

Trait objects are a form of dynamic dispatch and use a dynamically sized type
for the inner type. So, for a given trait `Trait`, when `Trait` is treated as a
type, as in `Box<Trait>`, the inner type is "unsized". In such cases the boxed
pointer is a "fat pointer" that contains an extra pointer to a table of methods
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@Manishearth
Copy link
Member Author

@bors r=steveklabnik

@bors
Copy link
Contributor

bors commented Jul 24, 2015

📌 Commit c588935 has been approved by steveklabnik

@bors
Copy link
Contributor

bors commented Jul 24, 2015

⌛ Testing commit c588935 with merge 5dbe99e...

Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 24, 2015
…abnik

I'll be adding more commits to this PR as the weekend progresses. Was hoping to make this a mega-PR, but getting some eyes on this early would be nice too.

r? @steveklabnik

r? @eddyb on the object safety bits

cc @michaelsproul

Part of rust-lang#24407
@bors
Copy link
Contributor

bors commented Jul 24, 2015

⛄ The build was interrupted to prioritize another pull request.

@bors
Copy link
Contributor

bors commented Jul 25, 2015

⌛ Testing commit c588935 with merge d38e8a0...

bors added a commit that referenced this pull request Jul 25, 2015
I'll be adding more commits to this PR as the weekend progresses. Was hoping to make this a mega-PR, but getting some eyes on this early would be nice too.

r? @steveklabnik

r? @eddyb on the object safety bits

cc @michaelsproul

Part of #24407
@bors bors merged commit c588935 into rust-lang:master Jul 25, 2015
@Manishearth Manishearth deleted the improve-diag branch September 3, 2015 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants