about summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2020-08-02Auto merge of #74963 - JohnTitor:ptn-ice, r=petrochenkovbors-19/+7
Fix ICEs with `@ ..` binding This reverts #74557 and introduces an alternative fix while ensuring that #74954 is not broken. The diagnostics are verbose though, it fixes three related issues. cc #74954, #74539, and #74702
2020-08-02Auto merge of #74210 - estebank:type-ascriptomatic, r=petrochenkovbors-80/+126
Deduplicate `::` -> `:` typo errors Deduplicate errors caused by the same type ascription typo, including ones suggested during parsing that would get reported again during resolve. Fix #70382.
2020-08-02Auto merge of #74785 - euclio:deprecation-kinds, r=petrochenkovbors-1/+1
report kind of deprecated item in message This is important for fields, which are incorrectly referred to as "items".
2020-07-31Move from `log` to `tracing`Oliver Scherer-1/+1
2020-07-31Reduce verbosity of some type ascription errorsEsteban Küber-80/+126
* Deduplicate type ascription LHS errors * Remove duplicated `:` -> `::` suggestion from parse error * Tweak wording to be more accurate * Modify `current_type_ascription` to reduce span wrangling * remove now unnecessary match arm * Add run-rustfix to appropriate tests
2020-07-31Fix ICEs with `@ ..` bindingYuki Okushi-3/+1
2020-07-31Revert "Fix an ICE on an invalid `binding @ ...` in a tuple struct pattern"Yuki Okushi-19/+9
This reverts commit f5e5eb6f46ef2cf0dd45dba4f975305509334fc6.
2020-07-27forbid generic params inside of anon consts in ty defaultsBastian Kauschke-8/+76
2020-07-27name `ParamInTyOfConstArg`Bastian Kauschke-5/+5
2020-07-26Hygiene serialization implementationAaron Hill-7/+37
2020-07-26report kind of deprecated item in messageAndy Russell-1/+1
This is important for fields, which are incorrectly referred to as "items".
2020-07-24Rollup merge of #74692 - Mark-Simulacrum:delay-bug, r=pnkfelixManish Goregaokar-12/+18
delay_span_bug instead of silent ignore This is a follow-up to #74557. r? @pnkfelix
2020-07-24Auto merge of #74676 - lcnr:generics-no-sort, r=varkorbors-1/+4
correctly deal with unsorted generic parameters We now stop sorting generic params and instead correctly handle unsorted params in the rest of the compiler. We still restrict const params to come after type params though, so this PR does not change anything which is visible to users. This might slightly influence perf, so let's prevent any unintentional rollups. @bors rollup=never r? @varkor
2020-07-24Rollup merge of #74572 - Mark-Simulacrum:unify-rustc-depr, r=petrochenkovYuki Okushi-12/+7
Internally unify rustc_deprecated and deprecated This PR intentionally tries to be "featureless" in that the behavior is not altered for either attribute, though it more clearly exposes cases where that is the case in the code.
2020-07-23delay_span_bug instead of silent ignoreMark Rousskov-12/+18
2020-07-23cleanupBastian Kauschke-2/+2
2020-07-23fix ICE caused by wrongly ordered generic paramsBastian Kauschke-1/+4
2020-07-20Migrate rustc_depr uses to use deprecation attributeMark Rousskov-12/+7
This should not be a change in behavior.
2020-07-20Rollup merge of #74557 - jakubadamw:issue-74539, r=nagisaManish Goregaokar-1/+7
Fix an ICE on an invalid `binding @ ...` in a tuple struct pattern Fixes #74539.
2020-07-20Fix an ICE on an invalid `binding @ ...` in a tuple struct patternJakub Adam Wieczorek-1/+7
2020-07-19disallow non-static lifetimes in const genericsGabriel Smith-0/+29
This has been put in place to patch over an ICE caused when we encounter a non-static lifetime in a const generic during borrow checking. This restriction may be relaxed in the future, but we need more discussion before then, and in the meantime we should still deal with this ICE. Fixes issue #60814
2020-07-18rustc_metadata: Make crate loading fully speculativeVadim Petrochenkov-9/+6
2020-07-16unwrap() -> expect()Joshua Nelson-6/+11
2020-07-16Use the scope of the imported variable for resolution, not the current scopeJoshua Nelson-2/+2
- Accept DefId in resolve_str_path_error This will probably break lots of internal invariants.
2020-07-16Use get_module instead of `module_map` for `resolve_str_path_error`Joshua Nelson-1/+1
2020-07-16Rollup merge of #74159 - lcnr:const-generic-ty-decl, r=varkorManish Goregaokar-3/+58
forbid generic params in the type of const params implements and closes #74152 fixes #74101, closes #71169, fixes #73491, closes #62878 @eddyb and I talked [on zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/type.20of.20const.20parameters/near/203405696) about this and we probably want to also forbid generic consts in the default type of a parameter, e.g. `struct Foo<T, U = [u8; std::mem::size_of::<T>()]>`, this is currently still allowed and I will probably fix that in a followup PR. r? @varkor @eddyb
2020-07-16update help messageBastian Kauschke-6/+15
2020-07-16forbid generic params in the type of const paramsBastian Kauschke-3/+49
2020-07-15Catch errors for any new item, not just trait implementationsJoshua Nelson-3/+3
This matches the previous behavior of everybody_loops and is also more consistent than special-casing impls.
2020-07-15Fix commentJoshua Nelson-1/+1
2020-07-15Use mem::replace instead of rewriting itJoshua Nelson-4/+2
2020-07-15Avoid unnecessary enumJoshua Nelson-42/+19
Just use a boolean instead.
2020-07-15Add an option not to report resolution errors for rustdocJoshua Nelson-23/+79
- Remove unnecessary `should_loop` variable - Report errors for trait implementations These should give resolution errors because they are visible outside the current scope. Without these errors, rustdoc will give ICEs: ``` thread 'rustc' panicked at 'attempted .def_id() on invalid res: Err', /home/joshua/src/rust/src/libstd/macros.rs:16:9 15: rustc_hir::def::Res<Id>::def_id at /home/joshua/src/rust/src/librustc_hir/def.rs:382 16: rustdoc::clean::utils::register_res at src/librustdoc/clean/utils.rs:627 17: rustdoc::clean::utils::resolve_type at src/librustdoc/clean/utils.rs:587 ``` - Add much more extensive tests + fn -> impl -> fn + fn -> impl -> fn -> macro + errors in function parameters + errors in trait bounds + errors in the type implementing the trait + unknown bounds for the type + unknown types in function bodies + errors generated by macros - Use explicit state instead of trying to reconstruct it from random info - Use an enum instead of a boolean - Add example of ignored error
2020-07-15Don't run everybody_loops for rustdocJoshua Nelson-14/+32
Instead, ignore resolution errors that occur in item bodies. The reason this can't ignore item bodies altogether is because `const fn` could be used in generic types, for example `[T; f()]`
2020-07-15Auto merge of #74175 - nnethercote:more-static-symbols, r=oli-obkbors-18/+16
More static symbols These commits add some more static symbols and convert lots of places to use them. r? @oli-obk
2020-07-15Remove lots of `Symbol::as_str()` calls.Nicholas Nethercote-12/+12
In various ways, such as changing functions to take a `Symbol` instead of a `&str`.
2020-07-15Add and use more static symbols.Nicholas Nethercote-6/+4
Note that the output of `unpretty-debug.stdout` has changed. In that test the hash values are normalized from a symbol numbers to small numbers like "0#0" and "0#1". The increase in the number of static symbols must have caused the original numbers to contain more digits, resulting in different pretty-printing prior to normalization.
2020-07-14Rollup merge of #74211 - estebank:struct-pat-as-unit, r=petrochenkovManish Goregaokar-22/+68
Structured suggestion when not using struct pattern r? @petrochenkov
2020-07-14Suggest struct pat on incorrect unit or tuple patEsteban Küber-22/+68
When encountering a unit or tuple pattern for a struct-like item, suggest using the correct pattern. Use `insert_field_names_local` when evaluating variants and store field names even when the list is empty in order to produce accurate structured suggestions.
2020-07-11Rollup merge of #74213 - pickfire:patch-1, r=jonas-schievinkManish Goregaokar-3/+1
Minor refactor for rustc_resolve diagnostics match Use `matches!` instead of old `if let`
2020-07-11Rollup merge of #74197 - estebank:self-sugg, r=petrochenkovManish Goregaokar-2/+2
Reword incorrect `self` token suggestion
2020-07-11Rollup merge of #74168 - JohnTitor:help-for-in-band-lifetimes, r=petrochenkovManish Goregaokar-0/+11
Add a help to use `in_band_lifetimes` in nightly Fixes #73775
2020-07-10Avoid "whitelist"Tamir Duberstein-1/+1
Other terms are more inclusive and precise.
2020-07-10Minor refactor for rustc_resolve diagnostics matchIvan Tham-3/+1
Use `matches!` instead of old `if let`
2020-07-10Tweak wordingYuki Okushi-1/+1
2020-07-10Add a help to use `in_band_lifetimes` in nightlyYuki Okushi-0/+11
2020-07-09Reword incorrect `self` token suggestionEsteban Küber-2/+2
2020-07-09Rollup merge of #74188 - estebank:tweak-ascription-typo-heuristic, ↵Manish Goregaokar-35/+33
r=petrochenkov Tweak `::` -> `:` typo heuristic and reduce verbosity Do not trigger on correct type ascription expressions with trailing operators and _do_ trigger on likely path typos where a turbofish is used. On likely path typos, remove note explaining type ascription. Clean up indentation. r? @petrochenkov
2020-07-09Rollup merge of #74150 - tamird:blocklist, r=nikomatsakisManish Goregaokar-23/+23
Avoid "blacklist" Other terms are more inclusive and precise. Clippy still has a lint named "blacklisted-name", but renaming it would be a breaking change, so is left for future work. The target configuration option "abi-blacklist" has been depreciated and renamed to "unsupported-abis". The old name continues to work.
2020-07-09Reduce indentationEsteban Küber-35/+33