Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
51b51b51d7931da85280382a81c4dd80c73ca754
rust/tests/ui/hygiene/hir-res-hygiene.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
314 B
Rust
Raw Normal View History

hir: introduce `QPath::LangItem` This commit introduces `QPath::LangItem` to the HIR and uses it in AST lowering instead of constructing a `hir::Path` from a slice of symbols. This might be better for performance, but is also much cleaner as the previous approach is fragile. In addition, it resolves a bug (#61019) where an extern crate imported as "std" would result in the paths created during AST lowering being resolved incorrectly (or not at all). Co-authored-by: Matthew Jasper <mjjasper1@gmail.com> Signed-off-by: David Wood <david@davidtw.co>
2020-08-04 14:34:24 +01:00
//@ check-pass
tests: add test for #61019's current behaviour This commit adds a test for #61019 where a extern crate is imported as `std` which results in name resolution to fail due to the uses of `std` types introduced from lowering. Signed-off-by: David Wood <david@davidtw.co>
2020-08-04 10:47:07 +01:00
//@ edition:2018
//@ aux-build:not-libstd.rs
// Check that paths created in HIR are not affected by in scope names.
extern crate not_libstd as std;
async fn the_future() {
async {}.await;
}
fn main() -> Result<(), ()> {
for i in 0..10 {}
for j in 0..=10 {}
Ok(())?;
Ok(())
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2144ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API