Skip to content

int array error message gives generic integer #3 type #15290

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

Closed
teburd opened this issue Jul 1, 2014 · 2 comments
Closed

int array error message gives generic integer #3 type #15290

teburd opened this issue Jul 1, 2014 · 2 comments

Comments

@teburd
Copy link

teburd commented Jul 1, 2014

With code like

let x : [int, ..3] = [1,2,3,4]

I get an error message thats probably not the best possible

<anon>:17:33: 17:42 error: mismatched types: expected `[int, .. 3]` but found `[<generic integer #3>, .. 4]` (expected vector but found vector)
<anon>:17         let mut x: [int, ..3] = [1,2,3,4]
@schmee
Copy link
Contributor

schmee commented Jul 3, 2014

This has been fixed somewhere between 14c0b3a and recent master (0aa23ed)! It now prints a much nicer error:

<anon>:2:26: 2:35 error: mismatched types: expected `[int, .. 3]` but found `[int, .. 4]` (expected vector but found vector)
<anon>:2     let x : [int, ..3] = [1,2,3,4];

Possibly fixed by 6b6edf4, but I'm not sure.

@ghost
Copy link

ghost commented Nov 11, 2014

This has been fixed by the recent changes in how type variables are presented in diagnostics. Closing.

@ghost ghost closed this as completed Nov 11, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 24, 2023
…extension, r=lnicola

editor/code: [DX] Use notification command links for debugger installation

This PR improves DX (developer experience) when installing the VS Code extension for the first time. When doing so and trying to debug a Rust file, we get an error notification that either CodeLLDB or C++ extension/debugger should be installed (see image below).

<div align="center">
	<img src="https://github.com/rust-lang/rust-analyzer/assets/20957750/e8ebeb1e-85f4-44e2-b79f-c48cf52e5f36" alt="Rust, prompt to install debug extension">
</div>

The PR enhances the links in the given notification and upon clicking instead of opening the Web page of the extension it installs the extension immediately, without the need to leave the editor.

Note: the feature needs to be refined, maybe an "install in progress" message or something similar, I left that for you guys to decide and implement. I think it also possible to first open the sidebar, open the Extensions tab, then run the extension installation command which would make it more user-friendly.

P.S. it is also possible to open the extension's details in VS Code directly via the same links and then the user would have to manually click on the Install button - if installation is not the desired behavior.

Happy coding! 🎉
This issue was closed.
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

No branches or pull requests

2 participants