Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d2af7da
small code improvements in collect_intra_doc_links
kadiwa4 Jun 19, 2023
b152de2
coverage: Discard code regions that might cause fatal errors in `llvm…
Zalathar Jan 5, 2024
46652dd
llvm: simplify data layout check
davidtwco Jan 17, 2024
bdfc64a
coverage: Add a test that uses `#[bench]`
Zalathar Jan 21, 2024
6d7e80c
Add `#[coverage(off)]` to closures introduced by `#[test]`/`#[bench]`
Zalathar Jan 21, 2024
0e3035b
Manually implement derived `NonZero` traits.
reitermarkus Jan 20, 2024
f58af9b
Add a simpler and more targetted code path for impl trait in assoc items
oli-obk Jan 9, 2024
ac332bd
Pull opaque type check into a separate method
oli-obk Jan 9, 2024
f75361f
Limit impl trait in assoc type defining scope
oli-obk Jan 9, 2024
4e07699
Add some tests
oli-obk Jan 9, 2024
1829aa6
Use an enum instead of a bool
oli-obk Jan 16, 2024
5e5d135
Check that we forbid nested items, but not nested closures
oli-obk Jan 16, 2024
21e5bea
Use debug_assert instead of expanded equivalent
wesleywiser Jan 22, 2024
f700ee4
Do not normalize closure signature when building FnOnce shim
compiler-errors Jan 19, 2024
390ef9b
Fix incorrect suggestion for boxing tail expression in blocks
estebank Jan 22, 2024
ac56a2b
Suggest boxing if then expr if that solves divergent arms
estebank Jan 22, 2024
9525751
linker: Refactor APIs for linking dynamic libraries
petrochenkov Jan 17, 2024
2305e28
linker: Refactor APIs for linking static libraries
petrochenkov Jan 17, 2024
d7712c6
linker: Group library linking methods together and sort them consiste…
petrochenkov Jan 18, 2024
0ae891e
linker: Do not collect search paths unless necessary
petrochenkov Jan 18, 2024
e77af0f
linker: Merge `link_staticlib_*` and `link_whole_staticlib_*`
petrochenkov Jan 18, 2024
42bcccc
linker: Cleanup implementations of `link_staticlib_*`
petrochenkov Jan 18, 2024
161c674
Add Assume custom MIR.
cjgillot Jan 20, 2024
d7a7be4
Add test for jump-threading assume.
cjgillot Jan 20, 2024
afaac75
Do not thread through Assert terminator.
cjgillot Jan 20, 2024
f3682a1
add list of characters to uncommon codepoints lint
HTGAzureX1212 Jan 23, 2024
34f4f3d
Suggest boxing both arms of if expr if that solves divergent arms inv…
estebank Jan 23, 2024
3a07333
address requested changes
HTGAzureX1212 Jan 23, 2024
da1d0c4
tidy
HTGAzureX1212 Jan 23, 2024
851d4c4
add several resolution test cases
bvanjoi Jan 21, 2024
98a7664
Rollup merge of #112806 - kadiwa4:collect_intra_doc_links, r=notriddle
fmease Jan 23, 2024
8201df7
Rollup merge of #119460 - Zalathar:improper-region, r=wesleywiser
fmease Jan 23, 2024
976692f
Rollup merge of #119766 - oli-obk:split_tait_and_atpit, r=compiler-er…
fmease Jan 23, 2024
98c5078
Rollup merge of #120062 - davidtwco:llvm-data-layout-check, r=wesleyw…
fmease Jan 23, 2024
5edd432
Rollup merge of #120099 - petrochenkov:linkapi, r=WaffleLapkin
fmease Jan 23, 2024
8966b50
Rollup merge of #120139 - compiler-errors:fnonce-shim, r=BoxyUwU
fmease Jan 23, 2024
6a534f0
Rollup merge of #120160 - reitermarkus:nonzero-traits, r=dtolnay
fmease Jan 23, 2024
d77a4b0
Rollup merge of #120171 - cjgillot:jump-threading-assume-assert, r=tm…
fmease Jan 23, 2024
798d536
Rollup merge of #120183 - Zalathar:test-closure, r=compiler-errors
fmease Jan 23, 2024
b0267be
Rollup merge of #120195 - bvanjoi:add-some-resolution-test-case, r=pe…
fmease Jan 23, 2024
ed207ae
Rollup merge of #120259 - HTGAzureX1212:HTGAzureX1212/split-diagnosti…
fmease Jan 23, 2024
4756975
Rollup merge of #120261 - estebank:issue-102629, r=wesleywiser
fmease Jan 23, 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
1 change: 1 addition & 0 deletions tests/ui/imports/ambiguous-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ extern crate ambiguous_1;

fn main() {
ambiguous_1::id();
//^ FIXME: `id` should be identified as an ambiguous item.
}
2 changes: 1 addition & 1 deletion tests/ui/imports/ambiguous-4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ extern crate ambiguous_4_extern;

fn main() {
ambiguous_4_extern::id();
// `warning_ambiguous` had been lost at metadata.
//^ FIXME: `id` should be identified as an ambiguous item.
}
10 changes: 10 additions & 0 deletions tests/ui/imports/auxiliary/glob-conflict-cross-crate-2-extern.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
mod a {
pub type C = i8;
}

mod b {
pub type C = i16;
}

pub use a::*;
pub use b::*;
17 changes: 17 additions & 0 deletions tests/ui/imports/auxiliary/issue-114682-2-extern.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
macro_rules! m {
() => {
pub fn max() {}
pub(crate) mod max {}
};
}

mod d {
m! {}
}

mod e {
pub type max = i32;
}

pub use self::d::*;
pub use self::e::*;
16 changes: 16 additions & 0 deletions tests/ui/imports/auxiliary/issue-114682-3-extern.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
mod gio {
pub trait SettingsExt {
fn abc(&self) {}
}
impl<T> SettingsExt for T {}
}

mod gtk {
pub trait SettingsExt {
fn efg(&self) {}
}
impl<T> SettingsExt for T {}
}

pub use gtk::*;
pub use gio::*;
10 changes: 10 additions & 0 deletions tests/ui/imports/auxiliary/issue-114682-4-extern.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
mod a {
pub type Result<T> = std::result::Result<T, ()>;
}

mod b {
pub type Result<T> = std::result::Result<T, ()>;
}

pub use a::*;
pub use b::*;
1 change: 1 addition & 0 deletions tests/ui/imports/auxiliary/issue-114682-5-extern-1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub struct Url;
13 changes: 13 additions & 0 deletions tests/ui/imports/auxiliary/issue-114682-5-extern-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// edition: 2018
// aux-build: issue-114682-5-extern-1.rs
// compile-flags: --extern issue_114682_5_extern_1

pub mod p {
pub use crate::types::*;
pub use crate::*;
}
mod types {
pub mod issue_114682_5_extern_1 {}
}

pub use issue_114682_5_extern_1;
9 changes: 9 additions & 0 deletions tests/ui/imports/auxiliary/issue-114682-6-extern.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mod a {
pub fn log() {}
}
mod b {
pub fn log() {}
}

pub use self::a::*;
pub use self::b::*;
2 changes: 2 additions & 0 deletions tests/ui/imports/extern-with-ambiguous-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ mod s {
use s::*;
use extern_with_ambiguous_2_extern::*;
use error::*;
//^ FIXME: An ambiguity error should be thrown for `error`,
// as there is ambiguity present within `extern-with-ambiguous-2-extern.rs`.

fn main() {}
2 changes: 2 additions & 0 deletions tests/ui/imports/extern-with-ambiguous-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ mod s {
use s::*;
use extern_with_ambiguous_3_extern::*;
use error::*;
//^ FIXME: An ambiguity error should be thrown for `error`,
// as there is ambiguity present within `extern-with-ambiguous-3-extern.rs`.

fn main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ extern crate glob_conflict;

fn main() {
glob_conflict::f(); //~ ERROR cannot find function `f` in crate `glob_conflict`
//^ FIXME: `glob_conflict::f` should raise an
// ambiguity error instead of a not found error.
glob_conflict::glob::f(); //~ ERROR cannot find function `f` in module `glob_conflict::glob`
//^ FIXME: `glob_conflict::glob::f` should raise an
// ambiguity error instead of a not found error.
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0425]: cannot find function `f` in crate `glob_conflict`
--> $DIR/glob-conflict-cross-crate.rs:6:20
--> $DIR/glob-conflict-cross-crate-1.rs:6:20
|
LL | glob_conflict::f();
| ^ not found in `glob_conflict`

error[E0425]: cannot find function `f` in module `glob_conflict::glob`
--> $DIR/glob-conflict-cross-crate.rs:7:26
--> $DIR/glob-conflict-cross-crate-1.rs:9:26
|
LL | glob_conflict::glob::f();
| ^ not found in `glob_conflict::glob`
Expand Down
10 changes: 10 additions & 0 deletions tests/ui/imports/glob-conflict-cross-crate-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// aux-build:glob-conflict-cross-crate-2-extern.rs

extern crate glob_conflict_cross_crate_2_extern;

use glob_conflict_cross_crate_2_extern::*;

fn main() {
let _a: C = 1; //~ ERROR cannot find type `C` in this scope
//^ FIXME: `C` should be identified as an ambiguous item.
}
9 changes: 9 additions & 0 deletions tests/ui/imports/glob-conflict-cross-crate-2.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0412]: cannot find type `C` in this scope
--> $DIR/glob-conflict-cross-crate-2.rs:8:13
|
LL | let _a: C = 1;
| ^ not found in this scope

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/glob-conflict-cross-crate-3.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// check-pass
// aux-build:glob-conflict-cross-crate-2-extern.rs

extern crate glob_conflict_cross_crate_2_extern;

mod a {
pub type C = i32;
}

use glob_conflict_cross_crate_2_extern::*;
use a::*;

fn main() {
let _a: C = 1;
//^ FIXME: `C` should be identified as an ambiguous item.
}
25 changes: 25 additions & 0 deletions tests/ui/imports/issue-114682-1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// https://github.com/rust-lang/rust/pull/114682#discussion_r1420534109

#![feature(decl_macro)]

macro_rules! mac {
() => {
pub macro A() {
println!("non import")
}
}
}

mod m {
pub macro A() {
println!("import")
}
}

pub use m::*;
mac!();

fn main() {
A!();
//~^ ERROR `A` is ambiguous
}
28 changes: 28 additions & 0 deletions tests/ui/imports/issue-114682-1.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
error[E0659]: `A` is ambiguous
--> $DIR/issue-114682-1.rs:23:5
|
LL | A!();
| ^ ambiguous name
|
= note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution
note: `A` could refer to the macro defined here
--> $DIR/issue-114682-1.rs:7:9
|
LL | / pub macro A() {
LL | | println!("non import")
LL | | }
| |_________^
...
LL | mac!();
| ------ in this macro invocation
note: `A` could also refer to the macro imported here
--> $DIR/issue-114682-1.rs:19:9
|
LL | pub use m::*;
| ^^^^
= help: consider adding an explicit import of `A` to disambiguate
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0659`.
19 changes: 19 additions & 0 deletions tests/ui/imports/issue-114682-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// aux-build: issue-114682-2-extern.rs
// https://github.com/rust-lang/rust/pull/114682#issuecomment-1879998900

extern crate issue_114682_2_extern;

use issue_114682_2_extern::max;

type A = issue_114682_2_extern::max;
//~^ ERROR: expected type, found function `issue_114682_2_extern::max`
// FIXME:
// The above error was emitted due to `(Mod(issue_114682_2_extern), Namespace(Type), Ident(max))`
// being identified as an ambiguous item.
// However, there are two points worth discussing:
// First, should this ambiguous item be omitted considering the maximum visibility
// of `issue_114682_2_extern::m::max` in the type namespace is only within the extern crate.
// Second, if we retain the ambiguous item of the extern crate, should it be treated
// as an ambiguous item within the local crate for the same reasoning?

fn main() {}
9 changes: 9 additions & 0 deletions tests/ui/imports/issue-114682-2.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0573]: expected type, found function `issue_114682_2_extern::max`
--> $DIR/issue-114682-2.rs:8:10
|
LL | type A = issue_114682_2_extern::max;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ not a type

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0573`.
24 changes: 24 additions & 0 deletions tests/ui/imports/issue-114682-3.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// check-pass
// aux-build: issue-114682-3-extern.rs
// https://github.com/rust-lang/rust/pull/114682#issuecomment-1880625909

extern crate issue_114682_3_extern;

use issue_114682_3_extern::*;

mod auto {
pub trait SettingsExt {
fn ext(&self) {}
}

impl<T> SettingsExt for T {}
}

pub use self::auto::*;

fn main() {
let a: u8 = 1;
a.ext();
//^ FIXME: it should report `ext` not found because `SettingsExt`
// is an ambiguous item in `issue-114682-3-extern.rs`.
}
13 changes: 13 additions & 0 deletions tests/ui/imports/issue-114682-4.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// check-pass
// aux-build: issue-114682-4-extern.rs
// https://github.com/rust-lang/rust/pull/114682#issuecomment-1880755441

extern crate issue_114682_4_extern;

use issue_114682_4_extern::*;

fn a() -> Result<i32, ()> { // FIXME: `Result` should be identified as an ambiguous item.
Ok(1)
}

fn main() {}
15 changes: 15 additions & 0 deletions tests/ui/imports/issue-114682-5.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// check-pass
// edition: 2018
// aux-build: issue-114682-5-extern-1.rs
// aux-build: issue-114682-5-extern-2.rs
// compile-flags: --extern issue_114682_5_extern_1
// https://github.com/rust-lang/rust/pull/114682#issuecomment-1880755441

extern crate issue_114682_5_extern_2;

use issue_114682_5_extern_2::p::*;
use issue_114682_5_extern_1::Url;
// FIXME: The `issue_114682_5_extern_1` should be considered an ambiguous item,
// as it has already been recognized as ambiguous in `issue_114682_5_extern_2`.

fn main() {}
13 changes: 13 additions & 0 deletions tests/ui/imports/issue-114682-6.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// check-pass
// aux-build: issue-114682-6-extern.rs
// https://github.com/rust-lang/rust/pull/114682#issuecomment-1880755441

extern crate issue_114682_6_extern;

use issue_114682_6_extern::*;

fn main() {
let log = 2;
//^ `log` should be identified as an ambiguous item.
let _ = log;
}