Skip to content

Implement dyn Trait syntax (RFC 2113) #45175

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
Oct 14, 2017
Merged

Implement dyn Trait syntax (RFC 2113) #45175

merged 2 commits into from
Oct 14, 2017

Conversation

petrochenkov
Copy link
Contributor

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

r=me modulo new test


fn main() {
let x: &(dyn 'static + Display) = &BYTE;
let y: Box<dyn Display + 'static> = Box::new(BYTE);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we get a test like dyn Vec<T> -- i.e., something not a trait?

@petrochenkov
Copy link
Contributor Author

@bors r=nikomatsakis

@bors
Copy link
Collaborator

bors commented Oct 11, 2017

📌 Commit f769977 has been approved by nikomatsakis

@aidanhs
Copy link
Member

aidanhs commented Oct 12, 2017

[00:40:50] failures:

[00:40:50] 

[00:40:50] ---- [ui] ui/issue-44406.rs stdout ----

[00:40:50] 	normalized stderr:

[00:40:50] error: expected identifier, found keyword `true`

[00:40:50]   --> $DIR/issue-44406.rs:18:10

[00:40:50]    |

[00:40:50] 18 |     foo!(true);

[00:40:50]    |          ^^^^

[00:40:50] 

[00:40:50] error: expected type, found keyword `true`

[00:40:50]   --> $DIR/issue-44406.rs:18:10

[00:40:50]    |

[00:40:50] 13 |         bar(baz: $rest)

[00:40:50]    |                - help: did you mean to use `;` here?

[00:40:50] ...

[00:40:50] 18 |     foo!(true);

[00:40:50]    |          ^^^^ expecting a type here because of type ascription

[00:40:50] 

[00:40:50] error: expected one of `!`, `&&`, `&`, `(`, `*`, `.`, `;`, `<`, `?`, `[`, `_`, `dyn`, `extern`, `fn`, `for`, `impl`, `unsafe`, `}`, an operator, or lifetime, found `true`

[00:40:50]   --> $DIR/issue-44406.rs:18:10

[00:40:50]    |

[00:40:50] 13 |         bar(baz: $rest)

[00:40:50]    |                 - expected one of 20 possible tokens here

[00:40:50] ...

[00:40:50] 18 |     foo!(true);

[00:40:50]    |          ^^^^ unexpected token

[00:40:50] 

[00:40:50] error: aborting due to 3 previous errors

@bors r-

@aidanhs aidanhs added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 12, 2017
@petrochenkov
Copy link
Contributor Author

@bors r=nikomatsakis

@bors
Copy link
Collaborator

bors commented Oct 12, 2017

📌 Commit f1c6247 has been approved by nikomatsakis

@petrochenkov
Copy link
Contributor Author

@bors r=nikomatsakis

@bors
Copy link
Collaborator

bors commented Oct 14, 2017

📌 Commit 9d37320 has been approved by nikomatsakis

@kennytm kennytm added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 14, 2017
@bors
Copy link
Collaborator

bors commented Oct 14, 2017

⌛ Testing commit 9d37320 with merge 7920a7c...

bors added a commit that referenced this pull request Oct 14, 2017
Implement `dyn Trait` syntax (RFC 2113)

cc #44662
r? @nikomatsakis
@bors
Copy link
Collaborator

bors commented Oct 14, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 7920a7c to master...

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants