summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/late.rs
AgeCommit message (Collapse)AuthorLines
2023-05-23Ignore "non-real" type Res in rustdoc intra doc link resolutionGuillaume Gomez-7/+8
2023-05-18fix(resolve): only disambiguate binding key during definebohan-2/+3
2023-05-16Rollup merge of #111428 - bvanjoi:fix-109250, r=NilstriebNilstrieb-4/+0
refactor(resolve): clean up the early error return caused by non-call closes https://github.com/rust-lang/rust/issues/109250 It seems no bad happened, r? ``@Nilstrieb``
2023-05-11Rollup merge of #111460 - clubby789:lowercase-box-self, r=compiler-errorsMichael Goulet-0/+9
Improve suggestion for `self: Box<self>` Fixes #110642
2023-05-11Improve error for `self: Box<self>`clubby789-0/+9
2023-05-10Only warn single-use lifetime when the binders match.Camille GILLOT-5/+11
2023-05-10refactor(resolve): clean up the early error return caused by non-callbohan-4/+0
2023-05-05improve diagnostics and bless testsBoxy-2/+2
2023-05-05misc nameres changes for anon constsBoxy-101/+161
2023-05-04Rollup merge of #110982 - cjgillot:elided-self-const, r=petrochenkovMatthias Krüger-0/+4
Do not recurse into const generic args when resolving self lifetime elision. Fixes https://github.com/rust-lang/rust/issues/110899 r? `@petrochenkov`
2023-05-04Rollup merge of #111070 - WaffleLapkin:break_ribs, r=lcnrMatthias Krüger-80/+78
Don't suffix `RibKind` variants This PR - Removes `use RibKind::*` - Renames `RibKind::{SomethingRibKind => Something}` It seems unnecessary to have "RibKind" in the end of all variants, if we can just use it as a normal enum. Additionally previously it was weird that `MacroDefinition` is the only unsuffixed variant.
2023-05-03Do not recurse into const generic args when resolving self lifetime elision.Camille GILLOT-0/+4
2023-05-03Restrict `From<S>` for `{D,Subd}iagnosticMessage`.Nicholas Nethercote-1/+1
Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile.
2023-05-01Remove "RibKind" suffix from `RibKind` variantsMaybe Waffle-80/+74
2023-05-01Don't `use RibKind::*`Maybe Waffle-71/+75
2023-05-01fix testsyukang-3/+7
2023-05-01clean up debug codeyukang-1/+4
2023-05-01remove current_type_ascription from DiagnosticMetadatayukang-13/+1
2023-05-01Rip it outNilstrieb-11/+4
My type ascription Oh rip it out Ah If you think we live too much then You can sacrifice diagnostics Don't mix your garbage Into my syntax So many weird hacks keep diagnostics alive Yet I don't even step outside So many bad diagnostics keep tyasc alive Yet tyasc doesn't even bother to survive!
2023-04-30Rollup merge of #110984 - cjgillot:const-infer-lifetime, r=compiler-errorsMatthias Krüger-2/+2
Do not resolve anonymous lifetimes in consts to be static. Fixes https://github.com/rust-lang/rust/issues/110931
2023-04-29Do not force anonymous lifetimes in consts to be static.Camille GILLOT-2/+2
2023-04-28Don't duplicate anonymous lifetimes for async fn in traitsMichael Goulet-5/+1
2023-04-17Spelling - compilerJosh Soref-2/+2
* account * achieved * advising * always * ambiguous * analysis * annotations * appropriate * build * candidates * cascading * category * character * clarification * compound * conceptually * constituent * consts * convenience * corresponds * debruijn * debug * debugable * debuggable * deterministic * discriminant * display * documentation * doesn't * ellipsis * erroneous * evaluability * evaluate * evaluation * explicitly * fallible * fulfill * getting * has * highlighting * illustrative * imported * incompatible * infringing * initialized * into * intrinsic * introduced * javascript * liveness * metadata * monomorphization * nonexistent * nontrivial * obligation * obligations * offset * opaque * opportunities * opt-in * outlive * overlapping * paragraph * parentheses * poisson * precisely * predecessors * predicates * preexisting * propagated * really * reentrant * referent * responsibility * rustonomicon * shortcircuit * simplifiable * simplifications * specify * stabilized * structurally * suggestibility * translatable * transmuting * two * unclosed * uninhabited * visibility * volatile * workaround Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-12Rollup merge of #110203 - compiler-errors:rtn-dots, r=eholkMatthias Krüger-1/+0
Remove `..` from return type notation `@nikomatsakis` and I decided that using `..` in the return-type notation syntax is probably overkill. r? `@eholk` since you reviewed the last one Since this is piggybacking now totally off of a pre-existing syntax (parenthesized generics), let me know if you need any explanation of the logic here, since it's a bit more complicated now.
2023-04-10Remove `..` from return type notationMichael Goulet-1/+0
2023-04-10Fix typos in compilerDaniPopes-1/+1
2023-04-09Remove turbofishNilstrieb-1/+1
2023-04-09Some simple `clippy::perf` fixesNilstrieb-1/+1
2023-04-09Auto merge of #110041 - fmease:diag-sugg-adding-const-param, r=compiler-errorsbors-2/+2
Suggest defining const parameter when appropriate Helps a bit with #91119. Following #105523's lead, I use placeholder `/* Type */` instead of `_` in the suggestion. It should be easier for newcomers to parse. `@rustbot` label A-diagnostics r? diagnostics
2023-04-07suggest adding const paramLeón Orell Valerian Liehr-2/+2
2023-04-07Use smart-resolve when checking for trait in RHS of UFCSMichael Goulet-2/+30
2023-04-04Rename `ast::Static` to `ast::StaticItem` to match `ast::ConstItem`Oli Scherer-1/+1
2023-04-04box a bunch of large typesOli Scherer-4/+4
2023-04-04Split out ast::ItemKind::Const into its own structOli Scherer-5/+5
2023-04-04rust-analyzer guided tuple field to named fieldOli Scherer-1/+2
2023-04-04rust-analyzer guided enum variant structificationOli Scherer-1/+1
2023-04-01fix clippy::iter_kv_mapMatthias Krüger-2/+1
2023-03-28Add `(..)` syntax for RTNMichael Goulet-0/+1
2023-03-23rustdoc: Skip doc link resolution for non-exported itemsVadim Petrochenkov-1/+4
2023-03-22Remove comment about re-using Rib allocationsLukas Wirth-1/+0
2023-03-17Do not ICE for unexpected lifetime with ConstGeneric ribyukang-2/+3
2023-03-13resolve: Centralize retrieval of items span and item nameVadim Petrochenkov-1/+1
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-3/+6
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-02-21Auto merge of #105462 - oli-obk:feeding_full, r=cjgillot,petrochenkovbors-17/+18
give the resolver access to TyCtxt The resolver is now created after TyCtxt is created. Then macro expansion and name resolution are run and the results fed into queries just like before this PR. Since the resolver had (before this PR) mutable access to the `CStore` and the source span table, these two datastructures are now behind a `RwLock`. To ensure that these are not mutated anymore after the resolver is done, a read lock to them is leaked right after the resolver finishes. ### PRs split out of this one and leading up to it: * https://github.com/rust-lang/rust/pull/105423 * https://github.com/rust-lang/rust/pull/105357 * https://github.com/rust-lang/rust/pull/105603 * https://github.com/rust-lang/rust/pull/106776 * https://github.com/rust-lang/rust/pull/106810 * https://github.com/rust-lang/rust/pull/106812 * https://github.com/rust-lang/rust/pull/108032
2023-02-20Prepare for adding a `TyCtxt` to `Resolver`Oli Scherer-17/+18
2023-02-20remove FIXME that doesn't require fixingDeadbeef-3/+3
2023-02-19Rollup merge of #107951 - petrochenkov:procmacdoc, r=jackh726Dylan DPC-1/+6
resolve: Fix doc links referring to other crates when documenting proc macro crates directly Fixes https://github.com/rust-lang/rust/issues/107950
2023-02-16Make things actually workMichael Goulet-1/+7
2023-02-16Rename some region-specific stuffMichael Goulet-2/+2
2023-02-14Separate the lifetime of the session and the arena in the resolverOli Scherer-14/+14