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

Inferred types cause awful error messages #5124

Closed
jdm opened this issue Feb 26, 2013 · 4 comments
Closed

Inferred types cause awful error messages #5124

jdm opened this issue Feb 26, 2013 · 4 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@jdm
Copy link
Contributor

jdm commented Feb 26, 2013

trait T {
    fn foo();
}

fn bar<V: T>(v: @V) {
    v.foo();
}

fn main() {
    bar(5);
}
/tmp/typecheck.rs:10:8: 10:9 error: mismatched types: expected `@<V0>` but found `<VI0>` (expected @-ptr but found integral variable)
/tmp/typecheck.rs:10     bar(5);
                             ^
/tmp/typecheck.rs:10:4: 10:7 error: cannot determine a type for this bounded type parameter: unconstrained type
/tmp/typecheck.rs:10     bar(5);
                         ^~~
@catamorphism
Copy link
Contributor

Seems non-critical for 0.7. Nominating for milestone 5 (production-ready).

@graydon
Copy link
Contributor

graydon commented May 2, 2013

accepted for production ready

@bstrie
Copy link
Contributor

bstrie commented Jul 2, 2013

More-or-less a dupe of #3723, adding this test case to that one and closing.

@bblum
Copy link
Contributor

bblum commented Jul 3, 2013

thanks for triaging for me @bstrie

bors added a commit to rust-lang-ci/rust that referenced this issue May 2, 2020
Merge backport branch back into master

Merge back backport branch rust-1.42.0 into master.

Waiting on rust-lang#68753

changelog: none
calebcartwright pushed a commit to calebcartwright/rust that referenced this issue Mar 30, 2022
* Fix doc of generic items formmating error

* Remove tracked `attrs_end_with_doc_comment` flag in `RewriteContext`

* Fix duplicated doc comments of const generic params

* Fix `<ast::GenericParam as Spanned>::span()`

* Remove duplicated source file of `doc-of-generic-item.rs`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

5 participants