Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ pub fn compiler_entrypoint(at_args: &[String], callbacks: &mut (dyn Callbacks +
let sopts =
config::build_session_options(&mut default_early_dcx, &matches, warn_unspecified_edition);
let ice_file = ice_path_with_config(Some(&sopts.unstable_opts)).clone();
let _ = ICE_COLOR.set(sopts.color);

if let Some(ref code) = matches.opt_str("explain") {
handle_explain(&default_early_dcx, code, sopts.color);
Expand Down Expand Up @@ -1395,6 +1396,7 @@ pub fn catch_with_exit_code<T: Termination>(f: impl FnOnce() -> T) -> ExitCode {
}
}

static ICE_COLOR: OnceLock<ColorConfig> = OnceLock::new();
static ICE_PATH: OnceLock<Option<PathBuf>> = OnceLock::new();

// This function should only be called from the ICE hook.
Expand Down Expand Up @@ -1541,9 +1543,10 @@ fn report_ice(
extra_info: fn(DiagCtxtHandle<'_>),
using_internal_features: &AtomicBool,
) {
let color = ICE_COLOR.get().copied().unwrap_or(ColorConfig::Auto);
let emitter =
Box::new(rustc_errors::annotate_snippet_emitter_writer::AnnotateSnippetEmitter::new(
stderr_destination(rustc_errors::ColorConfig::Auto),
stderr_destination(color),
));
let dcx = DiagCtxt::new(emitter);
let dcx = dcx.handle();
Expand Down
2 changes: 1 addition & 1 deletion src/doc/unstable-book/src/library-features/try-as-dyn.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The most obvious one: if you have `impl IsStatic for &'static str`, then determi
### Each outlives `where` bound (`Type: 'a` and `'a: 'b`) does not mention lifetime-infected parameters.

Parameters are considered lifetime-infected if they are defined in an `impl` block's generic parameter list.
Const generics are excempt, as they can't affect lifetimes.
Const generics are exempt, as they can't affect lifetimes.
`for<'a>` lifetimes (and in the future types) are not lifetime-infected.

We can create lifetime discrimination this way. For instance, given `impl<'a, 'b> Outlives<'a> for &'b str where 'b : 'a {}`, `Outlives<'static>` amounts to `IsStatic` from previous bullet.
Expand Down
4 changes: 4 additions & 0 deletions tests/rustdoc-html/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ Same as `tests/rustdoc-html/enum` but for struct items.

Somewhat equivalent to the `auto` folder's tests. Both should likely be merged.

## `tests/rustdoc-html/trait`

Same as `tests/rustdoc-html/enum` but for trait items.

## `tests/rustdoc-html/typedef`

Contains tests checking type aliases (`type X = Y`) rendering. In particular when the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ pub struct Bar;
impl Foo for Bar {
//@ has quix/struct.Bar.html '//a[@href="../src/quix/trait-src-link.rs.html#14"]' 'Source'
fn required() {}
// For the `provided` method.
//@ has quix/struct.Bar.html '//a[@href="../src/quix/trait-src-link.rs.html#7"]' 'Source'
}

pub struct Baz;

impl Foo for Baz {
//@ has quix/struct.Baz.html '//a[@href="../src/quix/trait-src-link.rs.html#22"]' 'Source'
//@ has quix/struct.Baz.html '//a[@href="../src/quix/trait-src-link.rs.html#23"]' 'Source'
fn required() {}

//@ has quix/struct.Baz.html '//a[@href="../src/quix/trait-src-link.rs.html#25"]' 'Source'
//@ has quix/struct.Baz.html '//a[@href="../src/quix/trait-src-link.rs.html#26"]' 'Source'
fn provided() {}
}
Loading