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

Implement `dyn Trait` syntax (RFC 2113) #45175

Merged
merged 2 commits into from Oct 14, 2017

Conversation

Projects
None yet
5 participants
@petrochenkov
Copy link
Contributor

petrochenkov commented Oct 10, 2017

cc #44662
r? @nikomatsakis

@nikomatsakis
Copy link
Contributor

nikomatsakis left a comment

r=me modulo new test


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

This comment has been minimized.

@nikomatsakis

nikomatsakis Oct 10, 2017

Contributor

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

@petrochenkov petrochenkov force-pushed the petrochenkov:dyn branch from 80067f2 to f769977 Oct 11, 2017

@petrochenkov

This comment has been minimized.

Copy link
Contributor Author

petrochenkov commented Oct 11, 2017

@bors r=nikomatsakis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 11, 2017

📌 Commit f769977 has been approved by nikomatsakis

@aidanhs

This comment has been minimized.

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-

@petrochenkov petrochenkov force-pushed the petrochenkov:dyn branch from f769977 to f1c6247 Oct 12, 2017

@petrochenkov

This comment has been minimized.

Copy link
Contributor Author

petrochenkov commented Oct 12, 2017

@bors r=nikomatsakis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 12, 2017

📌 Commit f1c6247 has been approved by nikomatsakis

@petrochenkov petrochenkov force-pushed the petrochenkov:dyn branch from f1c6247 to 9d37320 Oct 14, 2017

@petrochenkov

This comment has been minimized.

Copy link
Contributor Author

petrochenkov commented Oct 14, 2017

@bors r=nikomatsakis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 14, 2017

📌 Commit 9d37320 has been approved by nikomatsakis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 14, 2017

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

bors added a commit that referenced this pull request Oct 14, 2017

Auto merge of #45175 - petrochenkov:dyn, r=nikomatsakis
Implement `dyn Trait` syntax (RFC 2113)

cc #44662
r? @nikomatsakis
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 14, 2017

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

@bors bors merged commit 9d37320 into rust-lang:master Oct 14, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.