Skip to content

Incorrect spans for ABIs that do not match architecture #8537

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
nikomatsakis opened this issue Aug 15, 2013 · 1 comment
Closed

Incorrect spans for ABIs that do not match architecture #8537

nikomatsakis opened this issue Aug 15, 2013 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-frontend Area: Compiler frontend (errors, parsing and HIR)

Comments

@nikomatsakis
Copy link
Contributor

When an ABI does not include an option for the current architecture, we report an error but without any span information. We should not do that. See FIXMEs in the compiler.

See comment.

@huonw
Copy link
Member

huonw commented Nov 7, 2013

Triage: this seems to be fixed in that the error is reported with a span, except it points to the next token. E.g.

extern "foo" {}
type Foo = extern "foo" fn();
extern "foo" fn foo() {}

fn main() {}
8537.rs:1:13: 1:14 error: illegal ABI: expected one of [cdecl, stdcall, fastcall, aapcs, Rust, C, rust-intrinsic], found `foo`
8537.rs:1 extern "foo" {}
                       ^
8537.rs:2:24: 2:26 error: illegal ABI: expected one of [cdecl, stdcall, fastcall, aapcs, Rust, C, rust-intrinsic], found `foo`
8537.rs:2 type Foo = extern "foo" fn();
                                  ^~
8537.rs:3:13: 3:15 error: illegal ABI: expected one of [cdecl, stdcall, fastcall, aapcs, Rust, C, rust-intrinsic], found `foo`
8537.rs:3 extern "foo" fn foo() {}
                       ^~
error: aborting due to 3 previous errors
task '<unnamed>' failed at 'explicit failure', /home/huon/rust/src/libsyntax/diagnostic.rs:101
task '<unnamed>' failed at 'explicit failure', /home/huon/rust/src/librustc/rustc.rs:396

(repurposing this bug for the incorrect spans.)

bors added a commit that referenced this issue May 30, 2014
Fixes #8537
Fixes #14499 (duplicate of #8537)

Old:
```rust
test.rs:2 	pub extern "xxxxx" fn add(x: int, y: int) -> int {
          	                   ^~
```

New:
```rust
test.rs:2 	pub extern "xxxxx" fn add(x: int, y: int) -> int {
          	           ^~~~~~~
```
@bors bors closed this as completed in 1b3a030 May 30, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Mar 24, 2022
…ports-for-macros, r=llogiq

Allow `single_component_path_imports` for all macros

Closes: rust-lang/rust-clippy#7923

It can be useful to have `use macro_name` regardless of the visibility. This removes the visibility filter.

changelog: [`single_component_path_imports`]: no longer triggers on macros
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 A-frontend Area: Compiler frontend (errors, parsing and HIR)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants