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

librustc: Apply coercions to return expressions. #14735

Closed
wants to merge 2 commits into from

Conversation

luqmana
Copy link
Member

@luqmana luqmana commented Jun 7, 2014

Fixes #12755.

r? @nikomatsakis

@nrc
Copy link
Member

nrc commented Jun 8, 2014

\o/ I was just about to do this for DST too

Some(ety) => check_expr_coercable_to_type(fcx, e, ety),
None => check_expr(fcx, e)
};
let ety = fcx.expr_ty(e);
Copy link
Member

Choose a reason for hiding this comment

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

Where there is an expected type, you probably want to write that instead of the actual type for the block.

I think you also need to use a coercion rather than a subtype check when checking ExprRet and the tail expr in check_fn

@luqmana
Copy link
Member Author

luqmana commented Jun 9, 2014

This needs a bit more work so I'll just close it for now.

@luqmana luqmana closed this Jun 9, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
internal: Forbid canonicalization of paths and normalize all rust-project.json paths

Closes rust-lang/rust-analyzer#14728
cc rust-lang/rust-analyzer#14430

- Removes canonicalization (and forbids it from being used in a sense, clippy could help here again with its lint in the future)
- Normalizes all paths in rust-project.json which we weren't doing in some cases
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.

Apply coercion rules on return expressions
2 participants