Skip to content

Use the constness of the inner type when converting array function args. #513

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 1 commit into from
Feb 14, 2017

Conversation

emilio
Copy link
Contributor

@emilio emilio commented Feb 14, 2017

Fixes #509

I'm actually surprised we had no tests for this.

…nction arguments.

Fixes rust-lang#509

I'm actually surprised we had no tests for this.

Signed-off-by: Emilio Cobos Álvarez <[email protected]>
@emilio
Copy link
Contributor Author

emilio commented Feb 14, 2017

r? @fitzgen

Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

Great! Thanks!

@@ -2828,7 +2828,7 @@ mod utils {
// [1]: http://c0x.coding-guidelines.com/6.7.5.3.html
let arg_ty = match *arg_ty.canonical_type(ctx).kind() {
TypeKind::Array(t, _) => {
t.to_rust_ty(ctx).to_ptr(arg_ty.is_const(), ctx.span())
t.to_rust_ty(ctx).to_ptr(ctx.resolve_type(t).is_const(), ctx.span())
Copy link
Member

Choose a reason for hiding this comment

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

dat copy paste

@fitzgen
Copy link
Member

fitzgen commented Feb 14, 2017

@bors-servo r+

@KiChjang
Copy link
Member

@bors-servo r=fitzgen

@bors-servo
Copy link

📌 Commit af6d59c has been approved by fitzgen

bors-servo pushed a commit that referenced this pull request Feb 14, 2017
Use the constness of the inner type when converting array function args.

Fixes #509

I'm actually surprised we had no tests for this.
@bors-servo
Copy link

⌛ Testing commit af6d59c with merge f1caa10...

@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: fitzgen
Pushing f1caa10 to master...

@bors-servo bors-servo merged commit af6d59c into rust-lang:master Feb 14, 2017
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.

5 participants