mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 21:13:37 +00:00
parent
190a0595a4
commit
ab28f6c249
3 changed files with 56 additions and 22 deletions
20
Cargo.lock
generated
20
Cargo.lock
generated
|
@ -111,18 +111,10 @@ version = "0.1.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "chalk-base"
|
|
||||||
version = "0.10.1-dev"
|
|
||||||
source = "git+https://github.com/rust-lang/chalk.git?rev=5a3b871ca17529ab5aa5787594fabad1634936cb#5a3b871ca17529ab5aa5787594fabad1634936cb"
|
|
||||||
dependencies = [
|
|
||||||
"lazy_static",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chalk-derive"
|
name = "chalk-derive"
|
||||||
version = "0.10.1-dev"
|
version = "0.10.1-dev"
|
||||||
source = "git+https://github.com/rust-lang/chalk.git?rev=5a3b871ca17529ab5aa5787594fabad1634936cb#5a3b871ca17529ab5aa5787594fabad1634936cb"
|
source = "git+https://github.com/rust-lang/chalk.git?rev=329b7f3fdd2431ed6f6778cde53f22374c7d094c#329b7f3fdd2431ed6f6778cde53f22374c7d094c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -133,9 +125,8 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chalk-engine"
|
name = "chalk-engine"
|
||||||
version = "0.10.1-dev"
|
version = "0.10.1-dev"
|
||||||
source = "git+https://github.com/rust-lang/chalk.git?rev=5a3b871ca17529ab5aa5787594fabad1634936cb#5a3b871ca17529ab5aa5787594fabad1634936cb"
|
source = "git+https://github.com/rust-lang/chalk.git?rev=329b7f3fdd2431ed6f6778cde53f22374c7d094c#329b7f3fdd2431ed6f6778cde53f22374c7d094c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chalk-base",
|
|
||||||
"chalk-derive",
|
"chalk-derive",
|
||||||
"chalk-ir",
|
"chalk-ir",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
|
@ -144,18 +135,17 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chalk-ir"
|
name = "chalk-ir"
|
||||||
version = "0.10.1-dev"
|
version = "0.10.1-dev"
|
||||||
source = "git+https://github.com/rust-lang/chalk.git?rev=5a3b871ca17529ab5aa5787594fabad1634936cb#5a3b871ca17529ab5aa5787594fabad1634936cb"
|
source = "git+https://github.com/rust-lang/chalk.git?rev=329b7f3fdd2431ed6f6778cde53f22374c7d094c#329b7f3fdd2431ed6f6778cde53f22374c7d094c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chalk-base",
|
|
||||||
"chalk-derive",
|
"chalk-derive",
|
||||||
|
"lazy_static",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chalk-solve"
|
name = "chalk-solve"
|
||||||
version = "0.10.1-dev"
|
version = "0.10.1-dev"
|
||||||
source = "git+https://github.com/rust-lang/chalk.git?rev=5a3b871ca17529ab5aa5787594fabad1634936cb#5a3b871ca17529ab5aa5787594fabad1634936cb"
|
source = "git+https://github.com/rust-lang/chalk.git?rev=329b7f3fdd2431ed6f6778cde53f22374c7d094c#329b7f3fdd2431ed6f6778cde53f22374c7d094c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chalk-base",
|
|
||||||
"chalk-derive",
|
"chalk-derive",
|
||||||
"chalk-engine",
|
"chalk-engine",
|
||||||
"chalk-ir",
|
"chalk-ir",
|
||||||
|
|
|
@ -27,8 +27,8 @@ test_utils = { path = "../test_utils" }
|
||||||
|
|
||||||
scoped-tls = "1"
|
scoped-tls = "1"
|
||||||
|
|
||||||
chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "5a3b871ca17529ab5aa5787594fabad1634936cb" }
|
chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "329b7f3fdd2431ed6f6778cde53f22374c7d094c" }
|
||||||
chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "5a3b871ca17529ab5aa5787594fabad1634936cb" }
|
chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "329b7f3fdd2431ed6f6778cde53f22374c7d094c" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
insta = "0.16.0"
|
insta = "0.16.0"
|
||||||
|
|
|
@ -2665,7 +2665,6 @@ fn test() {
|
||||||
Enum::Variant.test();
|
Enum::Variant.test();
|
||||||
}
|
}
|
||||||
"#, true),
|
"#, true),
|
||||||
// wrong result, because the built-in Copy impl for fn defs doesn't exist in Chalk yet
|
|
||||||
@r###"
|
@r###"
|
||||||
42..44 '{}': ()
|
42..44 '{}': ()
|
||||||
61..62 'T': {unknown}
|
61..62 'T': {unknown}
|
||||||
|
@ -2674,13 +2673,13 @@ fn test() {
|
||||||
146..150 'self': &Self
|
146..150 'self': &Self
|
||||||
202..282 '{ ...t(); }': ()
|
202..282 '{ ...t(); }': ()
|
||||||
208..211 'foo': fn foo()
|
208..211 'foo': fn foo()
|
||||||
208..218 'foo.test()': {unknown}
|
208..218 'foo.test()': bool
|
||||||
224..227 'bar': fn bar<{unknown}>({unknown}) -> {unknown}
|
224..227 'bar': fn bar<{unknown}>({unknown}) -> {unknown}
|
||||||
224..234 'bar.test()': {unknown}
|
224..234 'bar.test()': bool
|
||||||
240..246 'Struct': Struct(usize) -> Struct
|
240..246 'Struct': Struct(usize) -> Struct
|
||||||
240..253 'Struct.test()': {unknown}
|
240..253 'Struct.test()': bool
|
||||||
259..272 'Enum::Variant': Variant(usize) -> Enum
|
259..272 'Enum::Variant': Variant(usize) -> Enum
|
||||||
259..279 'Enum::...test()': {unknown}
|
259..279 'Enum::...test()': bool
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -2754,3 +2753,48 @@ fn test() {
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn integer_range_iterate() {
|
||||||
|
let t = type_at(
|
||||||
|
r#"
|
||||||
|
//- /main.rs crate:main deps:std
|
||||||
|
fn test() {
|
||||||
|
for x in 0..100 { x<|>; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//- /std.rs crate:std
|
||||||
|
pub mod ops {
|
||||||
|
pub struct Range<Idx> {
|
||||||
|
pub start: Idx,
|
||||||
|
pub end: Idx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub mod iter {
|
||||||
|
pub trait Iterator {
|
||||||
|
type Item;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait IntoIterator {
|
||||||
|
type Item;
|
||||||
|
type IntoIter: Iterator<Item = Self::Item>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T> IntoIterator for T where T: Iterator {
|
||||||
|
type Item = <T as Iterator>::Item;
|
||||||
|
type IntoIter = Self;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
trait Step {}
|
||||||
|
impl Step for i32 {}
|
||||||
|
impl Step for i64 {}
|
||||||
|
|
||||||
|
impl<A: Step> iter::Iterator for ops::Range<A> {
|
||||||
|
type Item = A;
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
assert_eq!(t, "i32");
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue