mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-10-31 12:04:43 +00:00 
			
		
		
		
	Merge pull request #19826 from lnicola/sync-from-rust
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				metrics / build_metrics (push) Has been cancelled
				
			
		
			
				
	
				rustdoc / rustdoc (push) Has been cancelled
				
			
		
			
				
	
				metrics / other_metrics (diesel-1.4.8) (push) Has been cancelled
				
			
		
			
				
	
				metrics / other_metrics (hyper-0.14.18) (push) Has been cancelled
				
			
		
			
				
	
				metrics / other_metrics (ripgrep-13.0.0) (push) Has been cancelled
				
			
		
			
				
	
				metrics / other_metrics (self) (push) Has been cancelled
				
			
		
			
				
	
				metrics / other_metrics (webrender-2022) (push) Has been cancelled
				
			
		
			
				
	
				metrics / generate_final_metrics (push) Has been cancelled
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	metrics / build_metrics (push) Has been cancelled
				
			rustdoc / rustdoc (push) Has been cancelled
				
			metrics / other_metrics (diesel-1.4.8) (push) Has been cancelled
				
			metrics / other_metrics (hyper-0.14.18) (push) Has been cancelled
				
			metrics / other_metrics (ripgrep-13.0.0) (push) Has been cancelled
				
			metrics / other_metrics (self) (push) Has been cancelled
				
			metrics / other_metrics (webrender-2022) (push) Has been cancelled
				
			metrics / generate_final_metrics (push) Has been cancelled
				
			minor: Sync from downstream
This commit is contained in:
		
						commit
						96a253112c
					
				
					 13 changed files with 53 additions and 28 deletions
				
			
		
							
								
								
									
										28
									
								
								Cargo.lock
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										28
									
								
								Cargo.lock
									
										
									
										generated
									
									
									
								
							|  | @ -1750,9 +1750,9 @@ dependencies = [ | ||||||
| 
 | 
 | ||||||
| [[package]] | [[package]] | ||||||
| name = "ra-ap-rustc_abi" | name = "ra-ap-rustc_abi" | ||||||
| version = "0.110.0" | version = "0.113.0" | ||||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | source = "registry+https://github.com/rust-lang/crates.io-index" | ||||||
| checksum = "912228bd8ed3beff1f6f9e5e2d4b37c0827ba3e2070060bf3858a311d0e29e30" | checksum = "c33b8fa229789975647ca5426be432c7c327ebde89ab15889928185dbcee3230" | ||||||
| dependencies = [ | dependencies = [ | ||||||
|  "bitflags 2.9.0", |  "bitflags 2.9.0", | ||||||
|  "ra-ap-rustc_hashes", |  "ra-ap-rustc_hashes", | ||||||
|  | @ -1762,18 +1762,18 @@ dependencies = [ | ||||||
| 
 | 
 | ||||||
| [[package]] | [[package]] | ||||||
| name = "ra-ap-rustc_hashes" | name = "ra-ap-rustc_hashes" | ||||||
| version = "0.110.0" | version = "0.113.0" | ||||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | source = "registry+https://github.com/rust-lang/crates.io-index" | ||||||
| checksum = "ba520764daf057a9d963fa769f4762eaf87ac5d4900ae76195eeead64cd35afd" | checksum = "0d68a3e389927002f552938a90b04787f6435f55b46fc5691360470d1cb2e99d" | ||||||
| dependencies = [ | dependencies = [ | ||||||
|  "rustc-stable-hash", |  "rustc-stable-hash", | ||||||
| ] | ] | ||||||
| 
 | 
 | ||||||
| [[package]] | [[package]] | ||||||
| name = "ra-ap-rustc_index" | name = "ra-ap-rustc_index" | ||||||
| version = "0.110.0" | version = "0.113.0" | ||||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | source = "registry+https://github.com/rust-lang/crates.io-index" | ||||||
| checksum = "b76b5f9ee55f2d0e5a65bea23f6d738893349ce8d3d17a6720933e647ab04978" | checksum = "32502273df2838d0ca13f1c67e2a48feef940e591f9771869f07e2db2acede53" | ||||||
| dependencies = [ | dependencies = [ | ||||||
|  "ra-ap-rustc_index_macros", |  "ra-ap-rustc_index_macros", | ||||||
|  "smallvec", |  "smallvec", | ||||||
|  | @ -1781,9 +1781,9 @@ dependencies = [ | ||||||
| 
 | 
 | ||||||
| [[package]] | [[package]] | ||||||
| name = "ra-ap-rustc_index_macros" | name = "ra-ap-rustc_index_macros" | ||||||
| version = "0.110.0" | version = "0.113.0" | ||||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | source = "registry+https://github.com/rust-lang/crates.io-index" | ||||||
| checksum = "ddd972eb1face2fcaa0d94c01d97862fb955b5561d4f5932003bce8a6cadd8c6" | checksum = "8a32f081864ae34c7ae6634edfa7a95ab9260ba85015e8b1d347580eda79d14f" | ||||||
| dependencies = [ | dependencies = [ | ||||||
|  "proc-macro2", |  "proc-macro2", | ||||||
|  "quote", |  "quote", | ||||||
|  | @ -1792,9 +1792,9 @@ dependencies = [ | ||||||
| 
 | 
 | ||||||
| [[package]] | [[package]] | ||||||
| name = "ra-ap-rustc_lexer" | name = "ra-ap-rustc_lexer" | ||||||
| version = "0.110.0" | version = "0.113.0" | ||||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | source = "registry+https://github.com/rust-lang/crates.io-index" | ||||||
| checksum = "ba3a9876456fb2521097deef33ddeac1c18260c8eafb68054d986f8b9d6ce9fa" | checksum = "ed34c51974718c5bd90d876d1364d9725159fc8030c2382b9cb837034152ed68" | ||||||
| dependencies = [ | dependencies = [ | ||||||
|  "memchr", |  "memchr", | ||||||
|  "unicode-properties", |  "unicode-properties", | ||||||
|  | @ -1803,9 +1803,9 @@ dependencies = [ | ||||||
| 
 | 
 | ||||||
| [[package]] | [[package]] | ||||||
| name = "ra-ap-rustc_parse_format" | name = "ra-ap-rustc_parse_format" | ||||||
| version = "0.110.0" | version = "0.113.0" | ||||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | source = "registry+https://github.com/rust-lang/crates.io-index" | ||||||
| checksum = "8e85de58dfcc60a5f9d5ec0157a657e3f84abd8f22c8a0c4d707cfb42c9011f4" | checksum = "ff0440e5d27facbf4ff13ea651e48c2f6e360b3dbfc56251b41d60719b965fb8" | ||||||
| dependencies = [ | dependencies = [ | ||||||
|  "ra-ap-rustc_lexer", |  "ra-ap-rustc_lexer", | ||||||
|  "rustc-literal-escaper", |  "rustc-literal-escaper", | ||||||
|  | @ -1813,9 +1813,9 @@ dependencies = [ | ||||||
| 
 | 
 | ||||||
| [[package]] | [[package]] | ||||||
| name = "ra-ap-rustc_pattern_analysis" | name = "ra-ap-rustc_pattern_analysis" | ||||||
| version = "0.110.0" | version = "0.113.0" | ||||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | source = "registry+https://github.com/rust-lang/crates.io-index" | ||||||
| checksum = "ceadf9db550db67deff7eff2e2765109b860c9d7e5bdfca144863020289c823d" | checksum = "a6056efa57aba3aa0cc69a0bf1a8281624c23ad25b05748d11ebcd4668037bfc" | ||||||
| dependencies = [ | dependencies = [ | ||||||
|  "ra-ap-rustc_index", |  "ra-ap-rustc_index", | ||||||
|  "rustc-hash 2.1.1", |  "rustc-hash 2.1.1", | ||||||
|  |  | ||||||
							
								
								
									
										15
									
								
								Cargo.toml
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								Cargo.toml
									
										
									
									
									
								
							|  | @ -85,11 +85,11 @@ vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" } | ||||||
| vfs = { path = "./crates/vfs", version = "0.0.0" } | vfs = { path = "./crates/vfs", version = "0.0.0" } | ||||||
| edition = { path = "./crates/edition", version = "0.0.0" } | edition = { path = "./crates/edition", version = "0.0.0" } | ||||||
| 
 | 
 | ||||||
| ra-ap-rustc_lexer = { version = "0.110", default-features = false } | ra-ap-rustc_lexer = { version = "0.113", default-features = false } | ||||||
| ra-ap-rustc_parse_format = { version = "0.110", default-features = false } | ra-ap-rustc_parse_format = { version = "0.113", default-features = false } | ||||||
| ra-ap-rustc_index = { version = "0.110", default-features = false } | ra-ap-rustc_index = { version = "0.113", default-features = false } | ||||||
| ra-ap-rustc_abi = { version = "0.110", default-features = false } | ra-ap-rustc_abi = { version = "0.113", default-features = false } | ||||||
| ra-ap-rustc_pattern_analysis = { version = "0.110", default-features = false } | ra-ap-rustc_pattern_analysis = { version = "0.113", default-features = false } | ||||||
| 
 | 
 | ||||||
| # local crates that aren't published to crates.io. These should not have versions. | # local crates that aren't published to crates.io. These should not have versions. | ||||||
| 
 | 
 | ||||||
|  | @ -132,7 +132,10 @@ pulldown-cmark-to-cmark = "10.0.4" | ||||||
| pulldown-cmark = { version = "0.9.6", default-features = false } | pulldown-cmark = { version = "0.9.6", default-features = false } | ||||||
| rayon = "1.10.0" | rayon = "1.10.0" | ||||||
| rowan = "=0.15.15" | rowan = "=0.15.15" | ||||||
| salsa = { version = "0.21.1", default-features = false, features = ["rayon","salsa_unstable"] } | salsa = { version = "0.21.1", default-features = false, features = [ | ||||||
|  |   "rayon", | ||||||
|  |   "salsa_unstable", | ||||||
|  | ] } | ||||||
| salsa-macros = "0.21.1" | salsa-macros = "0.21.1" | ||||||
| semver = "1.0.26" | semver = "1.0.26" | ||||||
| serde = { version = "1.0.219" } | serde = { version = "1.0.219" } | ||||||
|  |  | ||||||
|  | @ -224,7 +224,7 @@ impl ExprCollector<'_> { | ||||||
| 
 | 
 | ||||||
|                     curarg = parser.curarg; |                     curarg = parser.curarg; | ||||||
| 
 | 
 | ||||||
|                     let to_span = |inner_span: rustc_parse_format::InnerSpan| { |                     let to_span = |inner_span: std::ops::Range<usize>| { | ||||||
|                         is_direct_literal.then(|| { |                         is_direct_literal.then(|| { | ||||||
|                             TextRange::new( |                             TextRange::new( | ||||||
|                                 inner_span.start.try_into().unwrap(), |                                 inner_span.start.try_into().unwrap(), | ||||||
|  |  | ||||||
|  | @ -214,7 +214,7 @@ pub(crate) fn parse( | ||||||
|         }; |         }; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     let to_span = |inner_span: parse::InnerSpan| { |     let to_span = |inner_span: std::ops::Range<usize>| { | ||||||
|         is_source_literal.then(|| { |         is_source_literal.then(|| { | ||||||
|             TextRange::new(inner_span.start.try_into().unwrap(), inner_span.end.try_into().unwrap()) |             TextRange::new(inner_span.start.try_into().unwrap(), inner_span.end.try_into().unwrap()) | ||||||
|         }) |         }) | ||||||
|  | @ -297,7 +297,8 @@ pub(crate) fn parse( | ||||||
|                     unfinished_literal.clear(); |                     unfinished_literal.clear(); | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 let span = parser.arg_places.get(placeholder_index).and_then(|&s| to_span(s)); |                 let span = | ||||||
|  |                     parser.arg_places.get(placeholder_index).and_then(|s| to_span(s.clone())); | ||||||
|                 placeholder_index += 1; |                 placeholder_index += 1; | ||||||
| 
 | 
 | ||||||
|                 let position_span = to_span(position_span); |                 let position_span = to_span(position_span); | ||||||
|  |  | ||||||
|  | @ -301,6 +301,7 @@ impl<'db> MatchCheckCtx<'db> { | ||||||
|             // ignore this issue.
 |             // ignore this issue.
 | ||||||
|             Ref => PatKind::Deref { subpattern: subpatterns.next().unwrap() }, |             Ref => PatKind::Deref { subpattern: subpatterns.next().unwrap() }, | ||||||
|             Slice(_) => unimplemented!(), |             Slice(_) => unimplemented!(), | ||||||
|  |             DerefPattern(_) => unimplemented!(), | ||||||
|             &Str(void) => match void {}, |             &Str(void) => match void {}, | ||||||
|             Wildcard | NonExhaustive | Hidden | PrivateUninhabited => PatKind::Wild, |             Wildcard | NonExhaustive | Hidden | PrivateUninhabited => PatKind::Wild, | ||||||
|             Never => PatKind::Never, |             Never => PatKind::Never, | ||||||
|  | @ -351,6 +352,7 @@ impl PatCx for MatchCheckCtx<'_> { | ||||||
|             }, |             }, | ||||||
|             Ref => 1, |             Ref => 1, | ||||||
|             Slice(..) => unimplemented!(), |             Slice(..) => unimplemented!(), | ||||||
|  |             DerefPattern(..) => unimplemented!(), | ||||||
|             Never | Bool(..) | IntRange(..) | F16Range(..) | F32Range(..) | F64Range(..) |             Never | Bool(..) | IntRange(..) | F16Range(..) | F32Range(..) | F64Range(..) | ||||||
|             | F128Range(..) | Str(..) | Opaque(..) | NonExhaustive | PrivateUninhabited |             | F128Range(..) | Str(..) | Opaque(..) | NonExhaustive | PrivateUninhabited | ||||||
|             | Hidden | Missing | Wildcard => 0, |             | Hidden | Missing | Wildcard => 0, | ||||||
|  | @ -411,6 +413,7 @@ impl PatCx for MatchCheckCtx<'_> { | ||||||
|                 } |                 } | ||||||
|             }, |             }, | ||||||
|             Slice(_) => unreachable!("Found a `Slice` constructor in match checking"), |             Slice(_) => unreachable!("Found a `Slice` constructor in match checking"), | ||||||
|  |             DerefPattern(_) => unreachable!("Found a `DerefPattern` constructor in match checking"), | ||||||
|             Never | Bool(..) | IntRange(..) | F16Range(..) | F32Range(..) | F64Range(..) |             Never | Bool(..) | IntRange(..) | F16Range(..) | F32Range(..) | F64Range(..) | ||||||
|             | F128Range(..) | Str(..) | Opaque(..) | NonExhaustive | PrivateUninhabited |             | F128Range(..) | Str(..) | Opaque(..) | NonExhaustive | PrivateUninhabited | ||||||
|             | Hidden | Missing | Wildcard => { |             | Hidden | Missing | Wildcard => { | ||||||
|  |  | ||||||
|  | @ -5789,7 +5789,7 @@ The tracking issue for this feature is: [#120301] | ||||||
| 
 | 
 | ||||||
| ------------------------ | ------------------------ | ||||||
| 
 | 
 | ||||||
| Add the methods `from_mins`, `from_hours` and `from_days` to `Duration`. | Add the methods `from_days` and `from_weeks` to `Duration`. | ||||||
| "##,
 | "##,
 | ||||||
|         default_severity: Severity::Allow, |         default_severity: Severity::Allow, | ||||||
|         warn_since: None, |         warn_since: None, | ||||||
|  |  | ||||||
|  | @ -179,6 +179,18 @@ impl<'a> Converter<'a> { | ||||||
|                     COMMENT |                     COMMENT | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|  |                 rustc_lexer::TokenKind::Frontmatter { | ||||||
|  |                     has_invalid_preceding_whitespace, | ||||||
|  |                     invalid_infostring, | ||||||
|  |                 } => { | ||||||
|  |                     if *has_invalid_preceding_whitespace { | ||||||
|  |                         err = "invalid preceding whitespace for frontmatter opening" | ||||||
|  |                     } else if *invalid_infostring { | ||||||
|  |                         err = "invalid infostring for frontmatter" | ||||||
|  |                     } | ||||||
|  |                     FRONTMATTER | ||||||
|  |                 } | ||||||
|  | 
 | ||||||
|                 rustc_lexer::TokenKind::Whitespace => WHITESPACE, |                 rustc_lexer::TokenKind::Whitespace => WHITESPACE, | ||||||
| 
 | 
 | ||||||
|                 rustc_lexer::TokenKind::Ident if token_text == "_" => UNDERSCORE, |                 rustc_lexer::TokenKind::Ident if token_text == "_" => UNDERSCORE, | ||||||
|  |  | ||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -173,7 +173,6 @@ fn test_fn_like_macro_clone_raw_ident() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #[test] | #[test] | ||||||
| #[cfg(not(bootstrap))] |  | ||||||
| fn test_fn_like_fn_like_span_join() { | fn test_fn_like_fn_like_span_join() { | ||||||
|     assert_expand( |     assert_expand( | ||||||
|         "fn_like_span_join", |         "fn_like_span_join", | ||||||
|  | @ -200,7 +199,6 @@ fn test_fn_like_fn_like_span_join() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #[test] | #[test] | ||||||
| #[cfg(not(bootstrap))] |  | ||||||
| fn test_fn_like_fn_like_span_ops() { | fn test_fn_like_fn_like_span_ops() { | ||||||
|     assert_expand( |     assert_expand( | ||||||
|         "fn_like_span_ops", |         "fn_like_span_ops", | ||||||
|  |  | ||||||
|  | @ -133,6 +133,7 @@ Meta = | ||||||
| 
 | 
 | ||||||
| SourceFile = | SourceFile = | ||||||
|   '#shebang'? |   '#shebang'? | ||||||
|  |   '#frontmatter'? | ||||||
|   Attr* |   Attr* | ||||||
|   Item* |   Item* | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1524,6 +1524,10 @@ impl ast::HasAttrs for SourceFile {} | ||||||
| impl ast::HasDocComments for SourceFile {} | impl ast::HasDocComments for SourceFile {} | ||||||
| impl ast::HasModuleItem for SourceFile {} | impl ast::HasModuleItem for SourceFile {} | ||||||
| impl SourceFile { | impl SourceFile { | ||||||
|  |     #[inline] | ||||||
|  |     pub fn frontmatter_token(&self) -> Option<SyntaxToken> { | ||||||
|  |         support::token(&self.syntax, T![frontmatter]) | ||||||
|  |     } | ||||||
|     #[inline] |     #[inline] | ||||||
|     pub fn shebang_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![shebang]) } |     pub fn shebang_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![shebang]) } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -1 +1 @@ | ||||||
| 6e23095adf9209614a45f7f75fea36dad7b92afb | a8e4c68dcb4dc1e48a0db294c5323cab0227fcb9 | ||||||
|  |  | ||||||
|  | @ -670,6 +670,7 @@ fn generate_syntax_kinds(grammar: KindsSrc) -> String { | ||||||
|             [ident] => { $crate::SyntaxKind::IDENT }; |             [ident] => { $crate::SyntaxKind::IDENT }; | ||||||
|             [string] => { $crate::SyntaxKind::STRING }; |             [string] => { $crate::SyntaxKind::STRING }; | ||||||
|             [shebang] => { $crate::SyntaxKind::SHEBANG }; |             [shebang] => { $crate::SyntaxKind::SHEBANG }; | ||||||
|  |             [frontmatter] => { $crate::SyntaxKind::FRONTMATTER }; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         impl ::core::marker::Copy for SyntaxKind {} |         impl ::core::marker::Copy for SyntaxKind {} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Laurențiu Nicola
						Laurențiu Nicola