mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Merge commit '8231fee46
' into HEAD
This commit is contained in:
commit
2374c0b368
111 changed files with 5796 additions and 5130 deletions
|
@ -295,13 +295,13 @@ fn test_concat_expand() {
|
|||
#[rustc_builtin_macro]
|
||||
macro_rules! concat {}
|
||||
|
||||
fn main() { concat!("foo", "r", 0, r#"bar"#, "\n", false); }
|
||||
fn main() { concat!("foo", "r", 0, r#"bar"#, "\n", false, '"', '\0'); }
|
||||
"##,
|
||||
expect![[r##"
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! concat {}
|
||||
|
||||
fn main() { "foor0bar\nfalse"; }
|
||||
fn main() { "foor0bar\nfalse\"\u{0}"; }
|
||||
"##]],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -885,7 +885,7 @@ macro_rules! m {
|
|||
($t:ty) => ( fn bar() -> $ t {} )
|
||||
}
|
||||
|
||||
fn bar() -> & 'a Baz<u8> {}
|
||||
fn bar() -> &'a Baz<u8> {}
|
||||
|
||||
fn bar() -> extern "Rust"fn() -> Ret {}
|
||||
"#]],
|
||||
|
@ -1578,7 +1578,7 @@ macro_rules !register_methods {
|
|||
($$($val: expr), *) = > {
|
||||
struct Foo;
|
||||
impl Foo {
|
||||
$(fn $method()-> & 'static[u32] {
|
||||
$(fn $method()-> &'static[u32] {
|
||||
&[$$($$val), *]
|
||||
}
|
||||
)*
|
||||
|
@ -1591,10 +1591,10 @@ macro_rules !implement_methods {
|
|||
($($val: expr), *) = > {
|
||||
struct Foo;
|
||||
impl Foo {
|
||||
fn alpha()-> & 'static[u32] {
|
||||
fn alpha()-> &'static[u32] {
|
||||
&[$($val), *]
|
||||
}
|
||||
fn beta()-> & 'static[u32] {
|
||||
fn beta()-> &'static[u32] {
|
||||
&[$($val), *]
|
||||
}
|
||||
}
|
||||
|
@ -1602,10 +1602,10 @@ macro_rules !implement_methods {
|
|||
}
|
||||
struct Foo;
|
||||
impl Foo {
|
||||
fn alpha() -> & 'static[u32] {
|
||||
fn alpha() -> &'static[u32] {
|
||||
&[1, 2, 3]
|
||||
}
|
||||
fn beta() -> & 'static[u32] {
|
||||
fn beta() -> &'static[u32] {
|
||||
&[1, 2, 3]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@ macro_rules! int_base {
|
|||
}
|
||||
}
|
||||
#[stable(feature = "rust1", since = "1.0.0")] impl fmt::Binary for isize {
|
||||
fn fmt(&self , f: &mut fmt::Formatter< '_>) -> fmt::Result {
|
||||
fn fmt(&self , f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
Binary.fmt_int(*self as usize, f)
|
||||
}
|
||||
}
|
||||
|
@ -724,7 +724,7 @@ macro_rules! delegate_impl {
|
|||
}
|
||||
}
|
||||
}
|
||||
impl <> Data for & 'amut G where G: Data {}
|
||||
impl <> Data for &'amut G where G: Data {}
|
||||
"##]],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ m!(static bar: &'static str = "hello";);
|
|||
macro_rules! m {
|
||||
($($t:tt)*) => { $($t)*}
|
||||
}
|
||||
static bar: & 'static str = "hello";
|
||||
static bar: &'static str = "hello";
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ fn foo() { bar.; blub }
|
|||
fn foo() { bar.; blub }
|
||||
|
||||
fn foo() {
|
||||
bar. ;
|
||||
bar.;
|
||||
blub
|
||||
}"##]],
|
||||
);
|
||||
|
|
|
@ -73,10 +73,12 @@ impl ModDir {
|
|||
candidate_files.push(self.dir_path.join_attr(attr_path, self.root_non_dir_owner))
|
||||
}
|
||||
None if file_id.is_include_macro(db.upcast()) => {
|
||||
let name = name.unescaped();
|
||||
candidate_files.push(format!("{}.rs", name));
|
||||
candidate_files.push(format!("{}/mod.rs", name));
|
||||
}
|
||||
None => {
|
||||
let name = name.unescaped();
|
||||
candidate_files.push(format!("{}{}.rs", self.dir_path.0, name));
|
||||
candidate_files.push(format!("{}{}/mod.rs", self.dir_path.0, name));
|
||||
}
|
||||
|
|
|
@ -132,9 +132,9 @@ pub struct Bar;
|
|||
expect![[r#"
|
||||
crate
|
||||
Bar: t v
|
||||
async: t
|
||||
r#async: t
|
||||
|
||||
crate::async
|
||||
crate::r#async
|
||||
Bar: t v
|
||||
"#]],
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue