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

Can declare two methods with the same name and different arguments #3099

Closed
Emm opened this issue Aug 3, 2012 · 3 comments
Closed

Can declare two methods with the same name and different arguments #3099

Emm opened this issue Aug 3, 2012 · 3 comments
Labels
A-resolve Area: Name resolution
Milestone

Comments

@Emm
Copy link

Emm commented Aug 3, 2012

fn a(x: ~str) -> ~str {
    #fmt("First function with %s", x)
}

fn a(x: ~str, y: ~str) -> ~str {
    #fmt("Second function with %s and %s", x, y)
}

fn main() {
    #info("Result: ");
}

Compiles with a recent rust master (899400c) (but using a(x: ~str) does not compile)

@ghost ghost assigned catamorphism Aug 3, 2012
@Dretch
Copy link
Contributor

Dretch commented Aug 6, 2012

You can also declare different types with the same name. This compiles and runs:

enum x {}

trait x {}

type x = int;

struct x { a: int; }

fn main() {
    let x:x = fail;
}

@catamorphism
Copy link
Contributor

I'm working on fixing both of these issues.

@Dretch
Copy link
Contributor

Dretch commented Aug 6, 2012

Thats great @catamorphism, thanks!

bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
RalfJung pushed a commit to RalfJung/rust that referenced this issue Oct 6, 2023
add test for a function ABI mismatch due to target features

Cc rust-lang/miri#3095
RalfJung pushed a commit to RalfJung/rust that referenced this issue Oct 7, 2023
add test for a function ABI mismatch due to target features

Cc rust-lang/miri#3095
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Updated version in all `Cargo.toml` files (via
`find . -name Cargo.toml -exec sed -i 's/version = "0.48.0"/version =
"0.49.0"/' {} \;`) and ran `cargo build-dev` to have `Cargo.lock` files
updated.

GitHub generated release notes:

## What's Changed
* Upgrade Rust toolchain to 2024-03-14 by @zhassan-aws in
model-checking/kani#3081
* Disable removal of storage markers by @zhassan-aws in
model-checking/kani#3083
* Automatic cargo update to 2024-03-18 by @github-actions in
model-checking/kani#3086
* Bump tests/perf/s2n-quic from `1a7faa8` to `9e39ca0` by @dependabot in
model-checking/kani#3087
* Upgrade toolchain to nightly-2024-03-15 by @celinval in
model-checking/kani#3084
* Add optional scatterplot to benchcomp output by @tautschnig in
model-checking/kani#3077
* Benchcomp scatterplots: quote axis labels by @tautschnig in
model-checking/kani#3097
* Expand ${var} in benchcomp variant `env` by @karkhaz in
model-checking/kani#3090
* Add test for rust-lang#3099 by @zhassan-aws in
model-checking/kani#3100
* Automatic cargo update to 2024-03-25 by @github-actions in
model-checking/kani#3103
* Bump tests/perf/s2n-quic from `1a7faa8` to `0a60ec1` by @dependabot in
model-checking/kani#3104
* Implement validity checks by @celinval in
model-checking/kani#3085
* Add `benchcomp filter` command by @karkhaz in
model-checking/kani#3105
* Add CI test for --use-local-toolchain by @jaisnan in
model-checking/kani#3074
* Upgrade Rust toolchain to `nightly-2024-03-21` by @adpaco-aws in
model-checking/kani#3102
* Use `intrinsic_name` to get the intrinsic name by @adpaco-aws in
model-checking/kani#3114
* Bump tests/perf/s2n-quic from `0a60ec1` to `2d5e891` by @dependabot in
model-checking/kani#3118
* Allow modifies clause for verification only by @feliperodri in
model-checking/kani#3098
* Automatic cargo update to 2024-04-01 by @github-actions in
model-checking/kani#3117
* Automatic cargo update to 2024-04-04 by @github-actions in
model-checking/kani#3122
* Remove bookrunner by @tautschnig in
model-checking/kani#3123
* Upgrade Rust toolchain to nightly-2024-03-29 by @feliperodri in
model-checking/kani#3116
* Remove unnecessary build step for some workflows by @zhassan-aws in
model-checking/kani#3124
* Ensure storage markers are kept in std code by @zhassan-aws in
model-checking/kani#3080


**Full Changelog**:
model-checking/kani@kani-0.48.0...kani-0.49.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution
Projects
None yet
Development

No branches or pull requests

3 participants