Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a0fcc8e
Add `display` method to `OsStr`
riverbl Jan 7, 2024
e060274
tests: Fix typo unix_sigpipe-error.rs -> unix_sigpipe-sig_ign.rs
Enselic Feb 9, 2024
a1cb3db
tests: Rename unix_sigpipe.rs to unix_sigpipe-bare.rs for clarity
Enselic Feb 9, 2024
d14f158
tests: Combine unix_sigpipe-not-used.rs and unix_sigpipe-only-feature.rs
Enselic Feb 9, 2024
948b1d6
tests: Add unix_sigpipe-different-duplicates.rs test variant
Enselic Feb 9, 2024
0da1b71
Add test case for primitive links in alias js
notriddle Feb 24, 2024
3bcef2d
Fix issues in suggesting importing extern crate paths
chenyukang Feb 17, 2024
03a10a9
Changing some attributes to only_local.
surechen Feb 27, 2024
8719b74
Fix link generation for locate foreign macro in jump to definition fe…
GuillaumeGomez Feb 27, 2024
4dd05e6
Add regression test for link generation on foreign macro in jump to d…
GuillaumeGomez Feb 27, 2024
7e10a5c
handle unavailable creation time as `io::ErrorKind::Unsupported`
janstarke Feb 27, 2024
1feef44
rename RPITIT from opaque to synthetic
compiler-errors Feb 27, 2024
b57ddfe
Print RPITIT like an opaque
compiler-errors Feb 27, 2024
8a6d353
Split rustc_type_ir to avoid rustc_ast from depending on it
oli-obk Feb 27, 2024
c7476f8
CFI: Fix typo in test file names
rcvalle Feb 27, 2024
cc584ba
Process alias-relate obligations in CoerceUnsized loop
compiler-errors Feb 27, 2024
5e29e26
Remove the `UntranslatableDiagnosticTrivial` lint.
nnethercote Feb 5, 2024
d840408
Rollup merge of #120051 - riverbl:os-str-display, r=m-ou-se
GuillaumeGomez Feb 28, 2024
c5dafe6
Rollup merge of #121226 - chenyukang:yukang-fix-import-alias, r=david…
GuillaumeGomez Feb 28, 2024
587d828
Rollup merge of #121423 - nnethercote:rm-UntranslatableDiagnosticTriv…
GuillaumeGomez Feb 28, 2024
d8e6550
Rollup merge of #121527 - Enselic:unix_sigpipe-tests-fixes, r=davidtwco
GuillaumeGomez Feb 28, 2024
65b190d
Rollup merge of #121572 - notriddle:notriddle/test-case-121106, r=Gui…
GuillaumeGomez Feb 28, 2024
796af69
Rollup merge of #121661 - surechen:change_attribute_to_local_20240226…
GuillaumeGomez Feb 28, 2024
b609afe
Rollup merge of #121680 - GuillaumeGomez:foreign-macro-jump-to-def, r…
GuillaumeGomez Feb 28, 2024
a0027e8
Rollup merge of #121686 - compiler-errors:rpitit-printing, r=lcnr
GuillaumeGomez Feb 28, 2024
2492f93
Rollup merge of #121691 - janstarke:handle-missing-creation-time-as-u…
GuillaumeGomez Feb 28, 2024
a62cfe0
Rollup merge of #121695 - oli-obk:split_ty_utils, r=compiler-errors
GuillaumeGomez Feb 28, 2024
ca69a1f
Rollup merge of #121698 - rcvalle:rust-cfi-fix-typo, r=compiler-errors
GuillaumeGomez Feb 28, 2024
1b08d1a
Rollup merge of #121702 - compiler-errors:coerce-alias-relate, r=lcnr
GuillaumeGomez Feb 28, 2024
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
12 changes: 11 additions & 1 deletion compiler/rustc_resolve/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1294,10 +1294,20 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let mut path_segments = path_segments.clone();
path_segments.push(ast::PathSegment::from_ident(ident));

let alias_import = if let NameBindingKind::Import { import, .. } =
name_binding.kind
&& let ImportKind::ExternCrate { source: Some(_), .. } = import.kind
&& import.parent_scope.expansion == parent_scope.expansion
{
true
} else {
false
};

let is_extern_crate_that_also_appears_in_prelude =
name_binding.is_extern_crate() && lookup_ident.span.at_least_rust_2018();

if !is_extern_crate_that_also_appears_in_prelude {
if !is_extern_crate_that_also_appears_in_prelude || alias_import {
// add the module to the lookup
if seen_modules.insert(module.def_id()) {
if via_import { &mut worklist_via_import } else { &mut worklist }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub struct Foo<T>(pub core::ptr::NonNull<T>);
14 changes: 14 additions & 0 deletions tests/ui/imports/import-alias-issue-121168.edition2015.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0412]: cannot find type `Foo` in this scope
--> $DIR/import-alias-issue-121168.rs:11:12
|
LL | let _: Foo<i32> = todo!();
| ^^^ not found in this scope
|
help: consider importing this struct
|
LL + use nice_crate_name::Foo;
|

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0412`.
16 changes: 16 additions & 0 deletions tests/ui/imports/import-alias-issue-121168.edition2018.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
error[E0412]: cannot find type `Foo` in this scope
--> $DIR/import-alias-issue-121168.rs:11:12
|
LL | let _: Foo<i32> = todo!();
| ^^^ not found in this scope
|
help: consider importing one of these items
|
LL + use crate::nice_crate_name::Foo;
|
LL + use import_alias_issue_121168_extern::Foo;
|

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0412`.
16 changes: 16 additions & 0 deletions tests/ui/imports/import-alias-issue-121168.edition2021.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
error[E0412]: cannot find type `Foo` in this scope
--> $DIR/import-alias-issue-121168.rs:11:12
|
LL | let _: Foo<i32> = todo!();
| ^^^ not found in this scope
|
help: consider importing one of these items
|
LL + use crate::nice_crate_name::Foo;
|
LL + use import_alias_issue_121168_extern::Foo;
|

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0412`.
14 changes: 14 additions & 0 deletions tests/ui/imports/import-alias-issue-121168.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//@ revisions: edition2015 edition2018 edition2021
//@ [edition2015] edition:2015
//@ [edition2018] edition:2018
//@ [edition2021] edition:2021
//@ compile-flags: --extern import_alias_issue_121168_extern
//@ aux-build: import-alias-issue-121168-extern.rs

extern crate import_alias_issue_121168_extern as nice_crate_name;

fn use_foo_from_another_crate_without_importing_it_first() {
let _: Foo<i32> = todo!(); //~ ERROR cannot find type `Foo` in this scope
}

fn main() {}