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

Spans for view items are fairly inaccurate #650

Closed
brson opened this issue Jul 9, 2011 · 3 comments
Closed

Spans for view items are fairly inaccurate #650

brson opened this issue Jul 9, 2011 · 3 comments
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Jul 9, 2011

In this test case:

// xfail-stage0                                                                                                                                                               
// error-pattern:'swap' is glob-imported from multiple different modules                                                                                                      
// issue #482                                                                                                                                                                 

use std;
// expecting swap to be defined in vec                                                                                                                                        
import std::vec::*;
import alternate_supplier::*;

mod alternate_supplier {
  fn swap() {}
}

fn main() { swap() }

I get this error:

../src/test/compile-fail/cross-crate-glob-collision.rs:7:10:8:6: note: 'swap' is imported here
../src/test/compile-fail/cross-crate-glob-collision.rs:8:25:10:3: note: 'swap' is imported here
../src/test/compile-fail/cross-crate-glob-collision.rs:14:12:14:17: error: 'swap' is glob-imported from multiple different modules.

The spans for the two imports, while in the general ballpark, are not very exact. I suspect that all types of view items have similar problems with their spans.

@ghost ghost assigned catamorphism Jul 12, 2011
@catamorphism
Copy link
Contributor

I fixed this one, but I'm not sure how to add a regression test when the right error message involves having a certain span. If anyone has suggestions, let me know.

@brson
Copy link
Contributor Author

brson commented Jul 12, 2011

Maybe you could formulate a test where the span is minimally likely to change. Or you could put comments in the test indicated that you're specifically testing for the correct span, so whoever messes with it feels more inclined to update the test. Or you could just skip the test; sometimes that's easiest.

@catamorphism
Copy link
Contributor

Yeah, I'm skipping it for now. But the code example is right here in case anyone wants to add it as a test ;-)

keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
We can't test s390x because qemu segfaults but we can at least verify that it
compiles.

Closes rust-lang#650
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
Clean up CI configuration and add s390x

We can't test s390x because qemu segfaults but we can at least verify that it
compiles.

Closes rust-lang#650
pdietl pushed a commit to pdietl/rust that referenced this issue Apr 23, 2020
our closure syntax comes from Ruby
bors pushed a commit to rust-lang-ci/rust that referenced this issue Oct 26, 2020
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
…en fixed (rust-lang#650)

* Enabled CBMC unknown language mode test now that rust-lang#533 has been fixed and migrated it to a cargo-rmc test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants