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

Mega-sync from rust-lang/rust #13676

Merged
merged 56 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
a1f1b95
Merge commit 'e36a20c24f35a4cee82bbdc600289104c9237c22' into ra-sync-…
fasterthanlime Jul 26, 2022
9d2cb42
:arrow_up: rust-analyzer
lnicola Aug 2, 2022
2c7f2c1
proc_macro/bridge: send diagnostics over the bridge as a struct
mystor Jul 25, 2022
22c8c9c
:arrow_up: rust-analyzer
lnicola Aug 9, 2022
8231fee
:arrow_up: rust-analyzer
lnicola Aug 16, 2022
3a1aa37
avoid a `&str` to `String` conversion
TaKO8Ki Aug 16, 2022
1347018
Rollup merge of #100643 - TaKO8Ki:point-at-type-parameter-shadowing-a…
matthiaskrgr Aug 18, 2022
31519bb
:arrow_up: rust-analyzer
lnicola Aug 23, 2022
3e358a6
:arrow_up: rust-analyzer
lnicola Aug 30, 2022
c1918fc
Auto merge of #100210 - mystor:proc_macro_diag_struct, r=eddyb
bors Sep 1, 2022
65e1dc4
:arrow_up: rust-analyzer
lnicola Sep 6, 2022
459bbb4
:arrow_up: rust-analyzer
lnicola Sep 13, 2022
f5fde4d
:arrow_up: rust-analyzer
lnicola Sep 20, 2022
6f13f12
rustc_typeck to rustc_hir_analysis
lcnr Sep 26, 2022
ed532e5
Fix duplicate usage of `a` article.
JarvisCraft Oct 2, 2022
02ae3d5
Auto merge of #2583 - RalfJung:rustup, r=oli-obk
bors Oct 8, 2022
3a57388
update to syn-1.0.102
zertosh Oct 9, 2022
4f55ebb
:arrow_up: rust-analyzer
lnicola Oct 11, 2022
8536eb0
rename rustc_allocator_nounwind to rustc_nounwind
RalfJung Oct 6, 2022
4b61e5e
merge rustc history
RalfJung Oct 12, 2022
a99a48e
:arrow_up: rust-analyzer
lnicola Oct 18, 2022
26a413e
merge rustc history
RalfJung Oct 21, 2022
8807fc4
:arrow_up: rust-analyzer
lnicola Oct 26, 2022
c60b1f6
:arrow_up: rust-analyzer
lnicola Nov 1, 2022
7d2a1ee
Remove `unescape_byte_literal`.
nnethercote Nov 4, 2022
a65ca91
Rollup merge of #103919 - nnethercote:unescaping-cleanups, r=matklad
Dylan-DPC Nov 9, 2022
79923c3
:arrow_up: rust-analyzer
lnicola Nov 9, 2022
61c744d
Rollup merge of #104211 - lnicola:rust-analyzer-2022-11-09, r=lnicola
compiler-errors Nov 10, 2022
a2a1d99
:arrow_up: rust-analyzer
lnicola Nov 23, 2022
2566e06
Merge commit '8e38833c3674c1be7d81c6069c62e6ed52b18b27' into HEAD
fasterthanlime Nov 25, 2022
db84a00
Merge commit '22c8c9c40' into HEAD
fasterthanlime Nov 25, 2022
03a723e
Merge commit '634cfe3d72e785c843ca5d412b12be137b2e14fb' into HEAD
fasterthanlime Nov 25, 2022
2374c0b
Merge commit '8231fee46' into HEAD
fasterthanlime Nov 25, 2022
797ee29
Merge commit 'b6d59f2bb4fae0ba4f74e2c967b5e2f777f8c860' into HEAD
fasterthanlime Nov 25, 2022
6ac43ec
Merge commit '31519bb39' into HEAD
fasterthanlime Nov 25, 2022
8117027
Merge commit 'a670ff888437f4b6a3d24cc2996e9f969a87cbae' into HEAD
fasterthanlime Nov 25, 2022
ff2b468
Merge commit '3e358a682' into HEAD
fasterthanlime Nov 25, 2022
ae878f2
Merge commit 'e8e598f6415461e7fe957eec1bee6afb55927d59' into HEAD
fasterthanlime Nov 25, 2022
318fdac
Merge commit '65e1dc4d9' into HEAD
fasterthanlime Nov 25, 2022
be2fca9
Merge commit '67920f797511c360b25dab4d30730be304848f32' into HEAD
fasterthanlime Nov 25, 2022
dec148e
Merge commit '459bbb422' into HEAD
fasterthanlime Nov 25, 2022
b355362
Merge commit '2e9f1204ca01c3e20898d4a67c8b84899d394a88' into HEAD
fasterthanlime Nov 25, 2022
969e250
Merge commit 'f5fde4df4' into HEAD
fasterthanlime Nov 25, 2022
bc9b613
Merge commit '187bee0bb100111466a3557c20f80defcc0f4db3' into HEAD
fasterthanlime Nov 25, 2022
e6540cf
Merge commit '4f55ebbd4' into HEAD
fasterthanlime Nov 25, 2022
299c293
Merge commit '61504c8d951c566eb03037dcb300c96f4bd9a8b6' into HEAD
fasterthanlime Nov 25, 2022
251b18a
Merge commit 'a99a48e78' into HEAD
fasterthanlime Nov 25, 2022
2dbda1a
Merge commit '0531aab522f25d6aae30b2cc23a09f4b9257eedc' into HEAD
fasterthanlime Nov 25, 2022
2f65294
Merge commit '8807fc4cc' into HEAD
fasterthanlime Nov 25, 2022
682a4de
Merge commit '43fb9563b2943d6abc5f3552195f3e27ac618966' into HEAD
fasterthanlime Nov 25, 2022
e070dc5
Merge commit 'c60b1f641' into HEAD
fasterthanlime Nov 25, 2022
8514f3f
Merge commit 'ba28e19b7838e3ad4223ae82d074dc3950ef1548' into HEAD
fasterthanlime Nov 25, 2022
ae43043
Merge commit '79923c382' into HEAD
fasterthanlime Nov 25, 2022
d9e16c8
Merge commit 'd03c1c87d4ca2d524646316387d47b12524ac451' into HEAD
fasterthanlime Nov 25, 2022
e96c0b1
Merge commit 'a2a1d9954' into HEAD
fasterthanlime Nov 25, 2022
38c98d1
Merge commit '26562973b3482a635416b2b663a13016d4d90e20' into HEAD
fasterthanlime Nov 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bench_data/glorious_old_parser
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,7 @@ impl<'a> Parser<'a> {
err.span_suggestion(
span,
"declare the type after the parameter binding",
String::from("<identifier>: <type>"),
"<identifier>: <type>",
Applicability::HasPlaceholders,
);
} else if require_name && is_trait_item {
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-def/src/builtin_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
// ==========================================================================

rustc_attr!(rustc_allocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
rustc_attr!(rustc_allocator_nounwind, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
rustc_attr!(rustc_nounwind, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
gated!(
alloc_error_handler, Normal, template!(Word), WarnFollowing,
experimental!(alloc_error_handler)
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-def/src/nameres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ mod path_resolution;
#[cfg(test)]
mod tests;

use std::{ops::Deref, sync::Arc};
use std::{cmp::Ord, ops::Deref, sync::Arc};

use base_db::{CrateId, Edition, FileId};
use hir_expand::{name::Name, InFile, MacroCallId, MacroDefId};
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/autoderef.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! In certain situations, rust automatically inserts derefs as necessary: for
//! example, field accesses `foo.bar` still work when `foo` is actually a
//! reference to a type with the field `bar`. This is an approximation of the
//! logic in rustc (which lives in librustc_typeck/check/autoderef.rs).
//! logic in rustc (which lives in rustc_hir_analysis/check/autoderef.rs).

use std::sync::Arc;

Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! the type of each expression and pattern.
//!
//! For type inference, compare the implementations in rustc (the various
//! check_* methods in librustc_typeck/check/mod.rs are a good entry point) and
//! check_* methods in rustc_hir_analysis/check/mod.rs are a good entry point) and
//! IntelliJ-Rust (org.rust.lang.core.types.infer). Our entry point for
//! inference here is the `infer` function, which infers the types of all
//! expressions in a given function.
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/infer/coerce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! like going from `&Vec<T>` to `&[T]`.
//!
//! See <https://doc.rust-lang.org/nomicon/coercions.html> and
//! `librustc_typeck/check/coercion.rs`.
//! `rustc_hir_analysis/check/coercion.rs`.

use std::{iter, sync::Arc};

Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/method_resolution.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! This module is concerned with finding methods that a given type provides.
//! For details about how this works in rustc, see the method lookup page in the
//! [rustc guide](https://rust-lang.github.io/rustc-guide/method-lookup.html)
//! and the corresponding code mostly in librustc_typeck/check/method/probe.rs.
//! and the corresponding code mostly in rustc_hir_analysis/check/method/probe.rs.
use std::{iter, ops::ControlFlow, sync::Arc};

use arrayvec::ArrayVec;
Expand Down
2 changes: 1 addition & 1 deletion crates/ide-db/src/imports/merge_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ fn path_cmp_short(a: &ast::Path, b: &ast::Path) -> Ordering {
}

/// Compares two paths, if one ends earlier than the other the has_tl parameters decide which is
/// greater as a a path that has a tree list should be greater, while one that just ends without
/// greater as a path that has a tree list should be greater, while one that just ends without
/// a tree list should be considered less.
pub(super) fn use_tree_path_cmp(
a: &ast::Path,
Expand Down
59 changes: 4 additions & 55 deletions crates/proc-macro-srv/src/abis/abi_sysroot/ra_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,6 @@ pub struct SourceFile {
type Level = super::proc_macro::Level;
type LineColumn = super::proc_macro::LineColumn;

/// A structure representing a diagnostic message and associated children
/// messages.
#[derive(Clone, Debug)]
pub struct Diagnostic {
level: Level,
message: String,
spans: Vec<Span>,
children: Vec<Diagnostic>,
}

impl Diagnostic {
/// Creates a new diagnostic with the given `level` and `message`.
pub fn new<T: Into<String>>(level: Level, message: T) -> Diagnostic {
Diagnostic { level, message: message.into(), spans: vec![], children: vec![] }
}
}

pub struct FreeFunctions;

#[derive(Default)]
Expand All @@ -65,8 +48,6 @@ impl server::Types for RustAnalyzer {
type FreeFunctions = FreeFunctions;
type TokenStream = TokenStream;
type SourceFile = SourceFile;
type MultiSpan = Vec<Span>;
type Diagnostic = Diagnostic;
type Span = Span;
type Symbol = Symbol;
}
Expand All @@ -90,6 +71,10 @@ impl server::FreeFunctions for RustAnalyzer {
span: tt::TokenId::unspecified(),
})
}

fn emit_diagnostic(&mut self, _: bridge::Diagnostic<Self::Span>) {
// FIXME handle diagnostic
}
}

impl server::TokenStream for RustAnalyzer {
Expand Down Expand Up @@ -282,30 +267,6 @@ impl server::SourceFile for RustAnalyzer {
}
}

impl server::Diagnostic for RustAnalyzer {
fn new(&mut self, level: Level, msg: &str, spans: Self::MultiSpan) -> Self::Diagnostic {
let mut diag = Diagnostic::new(level, msg);
diag.spans = spans;
diag
}

fn sub(
&mut self,
_diag: &mut Self::Diagnostic,
_level: Level,
_msg: &str,
_spans: Self::MultiSpan,
) {
// FIXME handle diagnostic
//
}

fn emit(&mut self, _diag: Self::Diagnostic) {
// FIXME handle diagnostic
// diag.emit()
}
}

impl server::Span for RustAnalyzer {
fn debug(&mut self, span: Self::Span) -> String {
format!("{:?}", span.0)
Expand Down Expand Up @@ -372,18 +333,6 @@ impl server::Span for RustAnalyzer {
}
}

impl server::MultiSpan for RustAnalyzer {
fn new(&mut self) -> Self::MultiSpan {
// FIXME handle span
vec![]
}

fn push(&mut self, other: &mut Self::MultiSpan, span: Self::Span) {
//TODP
other.push(span)
}
}

impl server::Symbol for RustAnalyzer {
fn normalize_and_validate_ident(&mut self, string: &str) -> Result<Self::Symbol, ()> {
// FIXME: nfc-normalize and validate idents
Expand Down
2 changes: 1 addition & 1 deletion crates/rust-analyzer/src/bin/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ where

let ext = span.extensions();

// `FormattedFields` is a a formatted representation of the span's
// `FormattedFields` is a formatted representation of the span's
// fields, which is stored in its extensions by the `fmt` layer's
// `new_span` method. The fields will have been formatted
// by the same field formatter that's provided to the event
Expand Down
6 changes: 2 additions & 4 deletions crates/syntax/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
mod block;

use rowan::Direction;
use rustc_lexer::unescape::{
self, unescape_byte, unescape_byte_literal, unescape_char, unescape_literal, Mode,
};
use rustc_lexer::unescape::{self, unescape_byte, unescape_char, unescape_literal, Mode};

use crate::{
algo,
Expand Down Expand Up @@ -143,7 +141,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
ast::LiteralKind::ByteString(s) => {
if !s.is_raw() {
if let Some(without_quotes) = unquote(text, 2, '"') {
unescape_byte_literal(without_quotes, Mode::ByteStr, &mut |range, char| {
unescape_literal(without_quotes, Mode::ByteStr, &mut |range, char| {
if let Err(err) = char {
push_err(2, (range.start, err));
}
Expand Down